cram to fastq
Hi,
I have paired end Illumina raw data stored as cram files and would like to get fastq files.
I tried
samtools fastq --reference {input.cram_ref} -1 {output.f1} -2 {output.f2} {input.cram}
but I get an error when I try to map the files with BWA:
[mem_sam_pe] paired reads have different names:
I think I need to sort the cram before converting to fastq, but not sure how to do this.
Thanks.
• 1,381 views
•
link
2 answers
form the samtools manual:
The input to this program must be collated by name. Run 'samtools collate' or 'samtools sort -n' to achieve this.
• 0 views
•
link
Yes, either sort or collate (collate=group by name). Sort takes longer, so I would simply use samtools collate and feed the output into samtools fastq.
• 0 views
•
link
Log in to answer this question.