Does anybody have recommended Java or Scala library for writing BigWig / BedGraph files?
I am aware that there is a Java bigwig library that was developed by the IGV team. However, it seems to only provide BigWig / BedGraph reading functions; nothing on writing. After contacting the developers I was told that the library will not be further developed.
This feels like like something that could have been used by a number of people out there. So before I even attempt to reinvent the wheel, I feel like I should ask :).
Not wig and bed per se, but yes, I do need them. Unless there is a similar (or better) format that allows me to view tracks without uploading them to the track browser..
I don't know what IGV specifically requires for a track; personally, I find their coverage plot from bam+bai files to be sufficient for most uses. What exactly do you need that is not present in the bam files or IGV display of bam files? I might already be able to generate it.
I need to share data with other people and sometimes load them into the track browser myself. BAM files are not that suitable because wading through multiple BAM files in IGV slows it down quite a lot. This is not the case with BigWig files. It's also easier and more compact to share BigWig files given their size.
ADD REPLY
• link
updated 2.8 years ago by
Ram
44k
•
written 10.0 years ago by
bow
▴
790
1
Entering edit mode
Other advantages of bigwig/tdf. 1) it keeps mean/median depth for different window lengths. When you zoom out to the entire chromosome, IGV can only display depth with bigwig/tdf. 2) The index of bigwig/tdf is integrated in data and the index can be retrieved partially. This is much more convenient for remote access.
ADD REPLY
• link
updated 2.8 years ago by
Ram
44k
•
written 10.0 years ago by
lh3
33k
If you want something manageable for IGV look at the TDF format which can be created with igvtools.
If you want to create bigwig from bam you could use bedtools genomeCoverageBed followed by bedGraphToBigWig (from UCSC utilities). So something on these lines:
Hmm..the TDF format is usable only within IGV it seems?
And yes, I am aware of other ways to create BigWig files from BAM files. This is actually the way we are doing this now in-house. But we're trying to reduce external dependencies (that step, for example, requires 2 executables and 1 extra data file, not to mention unecessary disk space for the intermediate file), since this makes it more difficult to share things (also when we work on different environments). Not a new problem really. So we want to move this into our Scala-based toolkit. All the information to create the BigWig file is already present in the BAM file anyway, so I thought this should be doable via a single step without any extra data files.
ADD REPLY
• link
updated 2.8 years ago by
Ram
44k
•
written 10.0 years ago by
bow
▴
790
1
Entering edit mode
I see... In fact I'm surprised myself that the bam -> bigwig conversion is somewhat clunky at the moment.
Not wig and bed per se, but yes, I do need them. Unless there is a similar (or better) format that allows me to view tracks without uploading them to the track browser..
I don't know what IGV specifically requires for a track; personally, I find their coverage plot from bam+bai files to be sufficient for most uses. What exactly do you need that is not present in the bam files or IGV display of bam files? I might already be able to generate it.
I need to share data with other people and sometimes load them into the track browser myself. BAM files are not that suitable because wading through multiple BAM files in IGV slows it down quite a lot. This is not the case with BigWig files. It's also easier and more compact to share BigWig files given their size.
Other advantages of bigwig/tdf. 1) it keeps mean/median depth for different window lengths. When you zoom out to the entire chromosome, IGV can only display depth with bigwig/tdf. 2) The index of bigwig/tdf is integrated in data and the index can be retrieved partially. This is much more convenient for remote access.