R_Granges_adding merged Metadata columns
0
0
Entering edit mode
me.saichi • 0
@mesaichi-15345
Last seen 6.7 years ago

Hello,

I am working on a g range object, and I would like to add a meta data column which contains the names (variant accessions) of variants which have already been merged by overlap.

Thank you very Much for your help. 

Melissa S

Msc Bioinformatics (Paris Diderot) 

granges findoverlaps • 1.0k views
ADD COMMENT
0
Entering edit mode

Hi Melissa,

Without a reproducible example, there is not much specific help that fellow Bioconductor users can provide.

If you have the ranges of those variants that have been merged, you can use findOverlaps to find the overlapping ranges in the original GRanges that correspond to those variant accessions. You can then create a vector of variant accessions with NA values for those that do not overlap and add the vector to the mcols of the original GRanges (if that is what you intend to do). See below for adding a column to mcols.

library(GenomicRanges)
example(GRanges)
mcols(gr)
mcols(gr) <- DataFrame(mcols(gr), score2 = rnorm(10))

Similarly, you can also do:

mcols(gr)$score3 <- rnorm(10)

Regards, Marcel

ADD REPLY

Login before adding your answer.

Traffic: 994 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