LTLA / InteractionSet

Clone of the Bioconductor repository for the InteractionSet package, see https://bioconductor.org/packages/devel/bioc/html/InteractionSet.html for the official development version.
2 stars 0 forks source link

import and export GInteraction object #1

Closed crazyhottommy closed 6 years ago

crazyhottommy commented 6 years ago

Hi, Thanks for this useful package.

How to easily import a bedpe file to GInteraction object and save the object to a bedpe file on disk? now, I am doing

library(rtracklayer)
library(InteractionSet)

encode_bedpe<- rtracklayer::import("my.bedpe", format = "bedpe")

gi<- GInteractions(first(encode_bedpe), second(encode_bedpe), mode= "strict")

# how to save gi to bedpe file?

Thanks! Tommy

LTLA commented 6 years ago

We have a makeGInteractionsFromGRangesPairs to go from Pairs object to a GInteractions.

You can go the other way using the pairs function, from which I presume you should be able to save to a BEDPE format using rtracklayer::export. I've never tried this, though.

crazyhottommy commented 6 years ago

It works. Thank you! Tommy