bedtools 转换bam文件为fastq文件
bamToFastq
Tool: bedtools bamtofastq (aka bamToFastq)
Version: v2.25.0
Summary: Convert BAM alignments to FASTQ files.
Usage: bamToFastq [OPTIONS] -i <BAM> -fq <FQ>
Options:
-fq2 FASTQ for second end. Used if BAM contains paired-end data.
BAM should be sorted by query name is creating paired FASTQ.
-tags Create FASTQ based on the mate info
in the BAM R2 and Q2 tags.
Tips:
If you want to create a single, interleaved FASTQ file
for paired-end data, you can just write both to /dev/stdout:
bedtools bamtofastq -i x.bam -fq /dev/stdout -fq2 /dev/stdout > x.ilv.fq
直接转换成fastq 例如可以:
bamToFastq -i unmapped.bam -fq unmapped.fastq
结果如下
如果需要区分出bam文件中paired reads 可以:
bamToFastq -i unmapped.bam -fq unmappedRead1.fastq -fq2 unmappedRead2.fastq
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!