Search
Question: GenomicInteractions package read in meta data file
1
3.0 years ago by
tangming200590
United States
tangming200590 wrote:

Hi there,

I am using GenomicInteractions package to read in the bedpe file.

There are several columns for meta data and I did not find a way to add them.

if I use:

mydata<- makeGenomicInteractionsFromFile("my.bedpe" ,
type="bedpe",
experiment_name="my test",
description="test")

meta<- meta[, 11:13]

mcols(mydata)<- meta

it throws me an error:

Error in elementMetadata<-(x, ..., value = value) :
replacement 'elementMetadata' value must be a DataTable object or NULL

But I can add the meta to a GRange object without problem:

gr<- anchorOne(mydata)

mcols(gr)<- meta

Thanks and happy new year!

Ming

modified 2.9 years ago by Malcolm Perry40 • written 3.0 years ago by tangming200590
1
2.9 years ago by
London, UK
Malcolm Perry40 wrote:

At first I was surprised by this question, since we do not use data.table to import bedpe files in our package. It turns out the answer is hiding in the way S4Vectors handles metadata.

The quick solution is to give mcols what it wants, which in this case in a DataFrame:

mcols(mydata) <- DataFrame(meta)

GenomicInteractions is based around the "Vector"<font face="monospace"> c</font>lass from the S4Vectors core package, which is where all of the mcols functionality is handled. Bioconductor-developed classes store metadata in a DataFrame object, which is a bioconductor-specific class based around DataTable. The GRanges mcols methods appears to perform this conversion implicitly. I am not sure why the mcols(granges) method is different from the mcols(GenomicInteractions) method, I will email the development list about it.

This will probably be fixed in the next version of GenomicInteractions, because we will use InteractionSet underneath our class which will change a lot of implementation details, although this also uses Vector so the fix might have to be upstream.

Hope that helps,

Malcolm

Thanks, I figured it out by myself  and indeed DataFrame(meta) works.

Just a side note, I saw some discussion on implementing the bedpe format in rtracklyer package  http://comments.gmane.org/gmane.science.biology.informatics.conductor.devel/8445

It would be very useful for me to handle structural variants data.

Thanks,

Ming

1

This is now fixed thanks to Herve.

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by Malcolm Perry40

That will hopefully be in the next release of Bioconductor.

Malcolm

It's fixed in release (BioC 3.2) and devel (BioC 3.3). The fix is in S4Vectors release (0.8.6) and devel (0.9.16).  If everything goes well with the build system, both versions should become available via biocLite() in the next 24 hours.

Cheers,

H.

ADD REPLYlink written 2.9 years ago by Hervé Pagès ♦♦ 13k