[BioC] Add extra columns to GRanges Metadata

Steve Lianoglou mailinglist.honeypot at gmail.com
Mon Feb 20 19:36:07 CET 2012


Hi Tim,

These functions are quite handy ... definitely going to poach them.
Also ... you need an editor with better code folding support ;-)

Pual,

Aslo, to do what you want to do, namely:

> extra.blank<-matrix(data=NA,nrow=length(a.grs),ncol=length(missing.meta.cols))
> old.meta<-as.data.frame(values(a.grs))
> new.meta<-cbind(old.meta,extra.blank)
> values(a.grs)<-new.meta

Using vanilla GenomicRanges functionality, you just do this:

R> values(a.grs) <- cbind(values(a.grs), DataFrame(extra.blank))

HTH,

-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the Bioconductor mailing list