Entering edit mode
Paul Leo
▴
970
@paul-leo-2092
Last seen 10.2 years ago
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.met
a.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..