<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>生信菜鸟团 &#187; mpileup</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/mpileup/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bio-info-trainee.com</link>
	<description>欢迎去论坛biotrainee.com留言参与讨论，或者关注同名微信公众号biotrainee</description>
	<lastBuildDate>Sat, 28 Jun 2025 14:30:13 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.33</generator>
	<item>
		<title>Samtools无法同时得到mpileup格式的数据和bcftools格式的数据</title>
		<link>http://www.bio-info-trainee.com/809.html</link>
		<comments>http://www.bio-info-trainee.com/809.html#comments</comments>
		<pubDate>Mon, 01 Jun 2015 01:47:15 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[bcf]]></category>
		<category><![CDATA[mpileup]]></category>
		<category><![CDATA[samtools]]></category>
		<category><![CDATA[snp]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=809</guid>
		<description><![CDATA[ 来自于： https://www.biostars.org/p/63429/  &#8230; <a href="http://www.bio-info-trainee.com/809.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h3> 来自于： <a href="https://www.biostars.org/p/63429/">https://www.biostars.org/p/63429/</a></h3>
<p>I'm using <a href="http://samtools.sourceforge.net/">samtools</a> mpileup and would like to generate both a pileup file and a vcf file as output. I can see how to generate one or the other, but not both (unless I run mpileup twice). I suspect I am missing something simple.</p>
<p>Specifically, calling mpileup with the -g or -u flag causes it to compute genotype likelihoods and output a bcf. Leaving these flags off just gives a pileup. Is there any way to get both, without redoing the work of producing the pileup file? Can I get <a href="http://samtools.sourceforge.net/">samtools</a> to generate the bcf _from_ the pileup file in some way? Generating the bcf from the <a href="http://samtools.sourceforge.net/SAM1.pdf">bam</a> file, when I already have the pileup, seems wasteful.</p>
<p>Thanks for any help!</p>
<p>我写了脚本来运行，才发现我居然需要两个重复的步骤来得到mpileup格式的数据和bcftools格式的数据，而这很明显的重复并且浪费时间的工作</p>
<p>for i in *sam</p>
<p>do</p>
<p>echo $i</p>
<p>samtools view -bS $i &gt;${i%.*}.bam</p>
<p>samtools sort ${i%.*}.bam ${i%.*}.sorted</p>
<p>samtools index ${i%.*}.sorted.bam</p>
<p>samtools mpileup -f /home/jmzeng/ref-database/hg19.fa  ${i%.*}.sorted.bam  &gt;${i%.*}.mpileup</p>
<p>samtools mpileup -guSDf  /home/jmzeng/ref-database/hg19.fa  ${i%.*}.sorted.bam  | bcftools view -cvNg - &gt; ${i%.*}.vcf</p>
<p>Done</p>
<p>我想得到mpileup格式，是因为后续的varscan等软件需要这个文件来call snp</p>
<p>而得到bcftools格式可以直接用bcftools进行snp-calling</p>
<p>samtools mpileup 命令只有用了-g或者-u那么就只会输出bcf文件</p>
<p>如果想得到mpileup格式的数据，就只能用-f参数。</p>
<ul>
<li>bcftools doesn't work on pileup format data. It works on bcf/vcf files.</li>
<li>samtools provides a script called sam2vcf.pl, which works on the output of "samtools pileup". However, this command is deserted in newer versions. The output of "samtools mpileup" does not satisfy the requirement of sam2vcf.pl. You can check the required pileup format on lines 95-99, which is different from output of "samtools mpileup".</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/809.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
