This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Can we use CRAM files for Telomerecat?

Hi friends,

I am trying to use a tool called Telomerecat for estimating telomere length.

The tool takes BAM file as input.

I would like to use CRAM file as input instead of BAM files.

Anyone has tried it in the past using CRAM files? Because the bam files are ~ 100gb each. If I process 100-1000 storage is the issue.

I tried this command,

samtools view -T reference.fasta sample.cram -b -h | Telomerecat bam2length - —output telomere_length.csv

This give me error.

whole genome sequence

A few points:

  1. Are you passing the BAM file as input to the samtools command? If so, your command above does not reflect that. Please give us the exact command you're running.
  2. Please avoid using SMS/IM jargon like "bcos" - that takes away from the professional nature of the discussion. I've edited it to the proper form of the word.
  3. Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.
    code_formatting

Sorry for the mistake. I have updated the command with sample.cram. I am using CRAM file as input instead of BAM. While converting CRAM2BAM, each BAM file is -100gb. That’s why I am not saving the intermediate BAM files. But the tool mainly uses BAM as input.

https://github.com/cancerit/telomerecat

CRAM file format is different than BAM so if the tool is not designed to take CRAM then the answer would be no.

BAM (for Binary Alignment Map) is a lossless compression while CRAM can range from lossless to lossy depending on how much compression you want to achieve (up to very much indeed). BAMs and CRAMs hold the same information as their SAM equivalent, structured in the same way; what is different between them is how the files themselves are encoded.

OP is converting CRAM to BAM and piping it to the tool, so the tool's file type limitations should not be a problem as long as the tool can work with streaming input. And any command line tool that needs a BAM file should ideally work on streaming input.

Indeed. I was specifically addressing this part of the original question

The tool takes BAM file as input.

I would like to use CRAM file as input instead of BAM files.

I see. OP should have clarified that they only have CRAM files and are trying to convert them to BAM on the fly. bioinforesearchquestions - please take note. You mention in your comment that you're converting CRAM to BAM on the fly ("without saving the intermediate file"), but this should have been made clear in the original post.

0 answers

No answers yet.

Log in to answer this question.