Merging CRAM files in a specified genomic interval using an input list
Hello,
I usually merge BAM files in a specified interval from a list of files like so:
samtools merge -R "chr1:0-100000" -b bam_files_list.txt -u -o - | command2
However, this command fails when I use a list of CRAM files; the samtools documentation says -b must be a list of input BAM files.
Is there a way to merge from a list of CRAM files using samtools?
Thank you.
• 1,332 views
•
link
0 answers
No answers yet.
Log in to answer this question.
what's the error ?
what in bam_file_list.txt ? did you use full paths ? are the bam files indexed ?version of samtools, etc...
Mostly when the documentation states BAM, it means SAM, BAM or CRAM. Historically the code had explicit commands that only worked on SAM or only worked on BAM. We changed all of that to be agnostic, bar specific things such as file concatenation and reheader, which are very different operations per type of file.
How many files are in your list? CRAM reading has a higher memory footprint as the block size is bigger. If you have many thousands of files, that may become an issue.
When reporting issues like this, please always report the version of the tool you're using (eg from
samtools version), and the actual error message. People cannot help you if you don't give enough information to diagnose the fault.