[BioC] Add extra columns to GRanges Metadata

Paul Leo p.leo at uq.edu.au
Mon Feb 20 07:26:57 CET 2012


I want to add extra column(s) to the elementMetaData of a GRanges object
is there a short hand way of doing that? 

Other than extracting the meta data as a data frame ... adding what I
want... and then reassigning:

THAT IS  NOT:
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


I'm missing something obvious ...!

Thanks
Paul


Wish LIST:
Other wise it would be extremely helpful to have a native 

c(..., .interesction)
c(..., .union)

where you could combine GRanges with different metaData , where
intersection just kept the metadata in common and union just added NA
for missing metavalues.

.... for use in combining vcf files for say snp, and deletion adat where
the meta data might have different attributes and it's not convenient to
use a list..



More information about the Bioconductor mailing list