Entering edit mode
8.5 years ago
endrebak
▴
970
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?
There is no mapping between the two genomicRanges.