Question: How to annotate one GenomicRanges object using another?
0
gravatar for endrebak
2.8 years ago by
endrebak700
endrebak700 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 • 889 views
ADD COMMENTlink modified 2.8 years ago by EVR510 • written 2.8 years ago by endrebak700
0
gravatar for EVR
2.8 years ago by
EVR510
Earth
EVR510 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 2.8 years ago by EVR510

There is no mapping between the two genomicRanges.

ADD REPLYlink written 2.8 years ago by endrebak700
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: 766 users visited in the last hour