zd1 / telseq

A software for calculating telomere length
GNU General Public License v3.0
66 stars 26 forks source link

telseq on cram files #26

Open jalwillcox opened 5 years ago

jalwillcox commented 5 years ago

Hello Zhihao,

Thanks for designing this useful tool!

I was wondering if there is a simple way to adapt it for cram input. It looks like bamtools doesn't support cram files, so maybe it's not possible, but I thought I'd check just in case.

Thanks,

Jon

agilly commented 4 years ago

Agreed, it would be very helpful.

trickytank commented 4 years ago

There is a simple way using samtools if you are ok to perform it on one file at a time. In bash, you use samtools to convert CRAM to BAM in memory and pipe into telseq. I had the exact same result using a bam file created from the cram file.

samtools view -u data.cram | telseq -r 151 - > output.txt

I used the -u option for an uncompressed BAM since it doesn't need to be written to disk, hence no need for compression. The "-" in the telseq command takes standard input coming from the samtools command.

This won't work if you are wanting to use an input file with the paths of your CRAM files.

I tested this using samtools 1.6.