GenomicInteractions package read in meta data file
1
1
Entering edit mode
tangming2005 ▴ 200
@tangming2005-6754
Last seen 8 weeks ago
United States

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<- read.table("my.bedpe")

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

 

GenomicInteractions • 2.3k views
ADD COMMENT
1
Entering edit mode
@malcolm-perry-6958
Last seen 3.6 years ago
Cambridge

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

ADD COMMENT
0
Entering edit mode
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

ADD REPLY
1
Entering edit mode

This is now fixed thanks to Herve.

ADD REPLY
0
Entering edit mode

That will hopefully be in the next release of Bioconductor.

Malcolm

ADD REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

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