|
The command samtools fastq
will directly convert a bam file to fastq files. Combining with the filter parameter, we could output unmapped read pairs by -f 12
. 0x0004
in the flag field of the SAM format means “the query sequence itself is unmapped” and 0x0008
in the flag field of the SAM format means “the mate is unmapped”. Therefore, 0x0004 + 0x0008
or 0x0004 | 0x0008
, i.e. -f 12
means both the query sequence itself and its mate are unmapped.
samtools fastq -f 12 -n -1 out.R1.fq -2 out.R2.fq in.bam
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-25 04:30
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社