Adding gene to GRange objects with single base
0
0
Entering edit mode
5 weeks ago
QX • 0

Hi all,

I have a Grange objects look like this:

GRanges object with 4598553 ranges and 2 metadata columns:
          seqnames    ranges strand |         ref         alt
             <Rle> <IRanges>  <Rle> | <character> <character>
        1     chr1     51479      * |           T           A
        2     chr1     51803      * |           T           C
        3     chr1     52238      * |           T           G
        4     chr1     54490      * |           G           A
        5     chr1     54712      * |   TTTTCTTTC           T

and a bed files in Grange:

GRanges object with 57736 ranges and 1 metadata column:
          seqnames            ranges strand |   gene_name
             <Rle>         <IRanges>  <Rle> | <character>
      [1]        1       11869-14412      * |     DDX11L1
      [2]        1       14363-29806      * |      WASH7P
      [3]        1       29554-31109      * |  MIR1302-10
      [4]        1       34554-36081      * |     FAM138A
      [5]        1       52473-54936      * |      OR4G4P
      ...      ...               ...    ... .         ...

How can I merge two Grange objects so that I can know which SNP is belongs to which genes, for e.g: from this post

GRanges object with 4 ranges and 1 metadata column:
      seqnames    ranges strand |       names
         <Rle> <IRanges>  <Rle> | <character>
  [1]        I       1-3      * |   ENS001912
  [2]        I       6-8      * |        <NA>
  [3]        I     11-13      * |   ENS003901
  [4]        I     16-18      * |        <NA>
GRanges genomics • 183 views
ADD COMMENT
0
Entering edit mode

Use findOverlaps but be sure that the chromosome identifiers are the same. Here you have 1, chr1 and I all three mixed.

ADD REPLY

Login before adding your answer.

Traffic: 1519 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6