Hi all, I am running nf-core/bamtofastq to convert...
# bamtofastq
s
Hi all, I am running nf-core/bamtofastq to convert CRAM files into FASTQ files. What happens with the unmapped reads that were preserved in the CRAM file? What happens with the unmapped reads during the conversion to FASTQ? Can I save the unmapped_1.fq and unmapped_2.fq as output? [vsc46248@gligar10 DNA141207]$ samtools flagstat DNA141207.cram 94606758 + 0 in total (QC-passed reads + QC-failed reads) 94606758 + 0 primary 0 + 0 secondary 0 + 0 supplementary 8566647 + 0 duplicates 8566647 + 0 primary duplicates 93816793 + 0 mapped (99.16% : N/A) 93816793 + 0 primary mapped (99.16% : N/A) 94606758 + 0 paired in sequencing 47303379 + 0 read1 47303379 + 0 read2 92647620 + 0 properly paired (97.93% : N/A) 93544458 + 0 with itself and mate mapped 272335 + 0 singletons (0.29% : N/A) 803486 + 0 with mate mapped to a different chr 589777 + 0 with mate mapped to a different chr (mapQ>=5) [vsc46248@gligar10 DNA141207]$ samtools view -c -f 4 DNA141207.cram 789965 #C050TCYSCFM
f
I would say the unmapped reads are also added to the fastq files: https://github.com/nf-core/bamtofastq/blob/master/subworkflows/local/alignment_to_fastq.nf they are concatenated and then part of the fastq files that you get as output.
You can probably extract them with a custom config though.