cram to fastq
2
0
Entering edit mode
22 months ago
junnna ▴ 10

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.

cram fastq • 597 views
ADD COMMENT
1
Entering edit mode
22 months ago

form the samtools manual:

The input to this program must be collated by name. Run 'samtools collate' or 'samtools sort -n' to achieve this.

ADD COMMENT
1
Entering edit mode
22 months ago
ATpoint 81k

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.

ADD COMMENT

Login before adding your answer.

Traffic: 3137 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6