This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Alternative to samtools quickcheck with bash scripting

Is there an alternative to samtools quickcheck? I need to perform a check some bam files in order to verify that they're not truncated. Nevertheless, I can't use samtools since in the linux machine where I have the data I can't install the suite.

In the past I've checked the EOF of bam files (1f8b08040000000000ff0600424302001b0003000000000000000000), but I can see that quickcheck also verifies that beginning of the file contains a valid header (all formats) containing at least one target sequence. Which are these valid header formats?

quickcheck samtools bash

I can't use samtools since in the linux machine where I have the data I can't install the suite.

So not even via conda?

You may want to consider solving what appears to be the real problem (can't install samtools) rather than the perceived problem. There are many examples how to install samtools (see here or here or here or simply Google it).

With conda:

conda install -c bioconda samtools

Solving the real problem will likely benefit you in the future even if you need to spend more time now.

The resources at the machine regarding disk space are limited. Thus, I was interested in understanding in the underlying process at quickcheck.

1 answer

Is there an alternative to samtools quickcheck?

try

gunzip -t in.bam && echo OK

or/and

samtools view -c in.bam > /dev/null && echo OK

Log in to answer this question.