Skip to content

Instantly share code, notes, and snippets.

@sirusb
Created February 18, 2015 14:16
Show Gist options
  • Select an option

  • Save sirusb/6d0851b5b951c3c8eebe to your computer and use it in GitHub Desktop.

Select an option

Save sirusb/6d0851b5b951c3c8eebe to your computer and use it in GitHub Desktop.

Revisions

  1. sirusb created this gist Feb 18, 2015.
    32 changes: 32 additions & 0 deletions access_GR.r
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    gr[1:2]
    #GRanges object with 2 ranges and 1 metadata column:
    # seqnames ranges strand | score
    # <Rle> <IRanges> <Rle> | <numeric>
    # [1] chr1 [ 130, 379] + | 0.0297835641540587
    # [2] chr1 [30050, 31349] + | 0.42395940516144
    # -------
    # seqinfo: 3 sequences from an unspecified genome; no seqlengths

    start(gr)
    #[1] 130 30050 4509 69098

    end(gr)
    #[1] 379 31349 4908 69687

    width(gr)
    #[1] 250 1300 400 590

    seqnames(gr)
    #factor-Rle of length 4 with 3 runs
    # Lengths: 2 1 1
    # Values : chr1 chr2 chrX
    #Levels(3): chr1 chr2 chrX

    values(gr)
    #DataFrame with 4 rows and 1 column
    # score
    # <numeric>
    #1 0.02978356
    #2 0.42395941
    #3 0.11233843
    #4 0.80039317