Question: How to annotate one GenomicRanges object using another?
0
gravatar for endrebak
3.2 years ago by
endrebak770
https://github.com/endrebak
endrebak770 wrote:

I have two genomicranges, one containing the gencode GFF v24

library(GenomicFeatures)

gen = makeTxDbFromGFF("gencode.gff")

tss = promoters(gen, upstream = 5000, downstream = 5000)

# > tss
# GRanges object with 199169 ranges and 2 metadata columns:
# seqnames     ranges strand  |   tx_id      tx_name
# <Rle>   <IRanges> <Rle>  | <integer>    <character>
# [1]   chr1 [ 6869, 16868]  +  |     1 ENST00000456328.2
# [2]   chr1 [ 7010, 17009]   +  |     2 ENST00000450305.2
# ...
# [199169]   chrM [11024, 21023]   -  |  199169 ENST00000387461.2
# -------
# seqinfo: 25 sequences (1 circular) from an unspecified genome; no seqlengths

another containing the regions I want annotated:

> mydata
GRanges object with 322394 ranges and 0 metadata columns:
           seqnames                 ranges strand
              <Rle>              <IRanges>  <Rle>
       [1]    chr10 [100005001, 100005200]      *
       [2]    chr10 [100005201, 100005400]      *

  [322394]     chrY   [56881001, 56881200]      *
  -------
  seqinfo: 25 sequences from an unspecified genome; no seqlengths

How do I transfer the gene names (tx_name) from my annotation to the data I want annotated?

genomicfeatures R • 982 views
ADD COMMENTlink modified 3.2 years ago by EVR540 • written 3.2 years ago by endrebak770
0
gravatar for EVR
3.2 years ago by
EVR540
Earth
EVR540 wrote:

Hi,

I think you can coerce the "tss" and "mydata" object into a data.frame and later and using a column which is common between the "tss" and "mydata", you can create a new data frame which you can later convert into genomic Ranges.

ADD COMMENTlink written 3.2 years ago by EVR540

There is no mapping between the two genomicRanges.

ADD REPLYlink written 3.2 years ago by endrebak770
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1818 users visited in the last hour