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.
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.