李雷廷的个人博客分享 http://blog.sciencenet.cn/u/llt001

博文

Extract unmapped read pairs from a bam file

已有 2448 次阅读 2019-1-31 14:03 |系统分类:科研笔记

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 120x0004 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

References

  1. http://www.htslib.org/doc/sam.html

  2. http://www.htslib.org/doc/samtools.html




https://blog.sciencenet.cn/blog-656335-1160083.html

上一篇:Overlapping variants called by GATK HaplotypeCaller
下一篇:安装 Picard 软件
收藏 IP: 202.127.144.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

全部作者的精选博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-25 04:30

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部