I am extracting unmapped reads from a cram file using the command:
samtools view -b -f 4 in.cram > out.cram
However, I wonder if there is a faster way of doing this. Either another program or using more threads.
I am extracting unmapped reads from a cram file using the command:
samtools view -b -f 4 in.cram > out.cram
However, I wonder if there is a faster way of doing this. Either another program or using more threads.
-@
parameter for more threads, beyond that probably no, samtools
is top of the pops for these kinds of things. Be sure that the reference file you used for CRAM generation is available or explicitely specify it with -T
as suggested by Pierre Lindenbaum
CRAM files rely on the reference file to decode the sequences.
Don't you? I mean, technically (from my understanding) the unmapped reads are not compressed against the reference, but doesn't samtools throw an error if there is no reference for a CRAM that contains at least some mapped reads? Not sure, maybe you're right and you do not need it at all. As said samtools can implicitely search for the reference on your disk so maybe it uses it without that you note it.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.