{"id":540,"date":"2025-04-27T11:58:44","date_gmt":"2025-04-27T03:58:44","guid":{"rendered":"https:\/\/www.kz-hub.tech\/?p=540"},"modified":"2025-06-26T16:54:34","modified_gmt":"2025-06-26T08:54:34","slug":"%e4%bd%bf%e7%94%a8vcftools%e6%8b%86%e5%88%86%e5%a4%9a%e6%a0%b7%e6%9c%acvcf%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.kz-hub.tech\/index.php\/2025\/04\/27\/%e4%bd%bf%e7%94%a8vcftools%e6%8b%86%e5%88%86%e5%a4%9a%e6%a0%b7%e6%9c%acvcf%e6%96%87%e4%bb%b6\/","title":{"rendered":"\u4f7f\u7528vcftools\u62c6\u5206\u591a\u6837\u672cvcf\u6587\u4ef6"},"content":{"rendered":"<h3>vcftools\u4e0b\u8f7d\u5730\u5740\uff1a<\/h3>\n<p><a href=\"https:\/\/vcftools.github.io\/\">https:\/\/vcftools.github.io\/<\/a><br \/>\n\u5b89\u88c5\uff1a<\/p>\n<pre><code>autogen.sh\n.\/configure --prefix=\/data02\/zhangmengmeng\/software\/vcftools-vcftools-d511f46\nmake\nmake install\n\n# ~\/.bashrc \u4e2d\u6dfb\u52a0\uff1a\nexport PATH=\/data02\/zhangmengmeng\/software\/vcftools-vcftools-d511f46\/bin:$PATH\nexport PERL5LIB=\/data02\/zhangmengmeng\/software\/vcftools-vcftools-d511f46\/src\/perl\/:$PERL5LIB\n<\/code><\/pre>\n<h3>\u53c2\u8003\u94fe\u63a5\uff1a<\/h3>\n<p><a href=\"https:\/\/www.biostars.org\/p\/108112\/#108816\">https:\/\/www.biostars.org\/p\/108112\/#108816<\/a><\/p>\n<h3>\u62c6\u5206\u6587\u4ef6<\/h3>\n<pre><code># Use VCFtools&#039; vcf-query to make a list of all the sample IDs in the multisample VCF:\nvcf-query --list-columns allsamples.vcf &gt; sample_ids\n\u6b64\u5904\u9700\u8981\u624b\u52a8\u6253\u5f00\u6587\u4ef6\u5220\u9664normal\u6837\u672c\uff08\u6b64\u5904\u4e3a-B\uff09\n\n# For each sample ID, run vcf-subset to create per-sample VCFs in a subfolder:\nmkdir vcf2maf\ncat FETB01_sample_ids | perl -ne &#039;chomp; print `cat FETB01.somatic.passed.vcf | vcf-subset --columns FETB01-B,$_ &gt; vcf2maf\/$_.vcf`&#039;\ncat FETB02_sample_ids | perl -ne &#039;chomp; print `cat FETB02.somatic.passed.vcf | vcf-subset --columns FETB02-B,$_ &gt; vcf2maf\/$_.vcf`&#039;\ncat FETB03_sample_ids | perl -ne &#039;chomp; print `cat FETB03.somatic.passed.vcf | vcf-subset --columns FETB03-B,$_ &gt; vcf2maf\/$_.vcf`&#039;\ncat FETB04_sample_ids | perl -ne &#039;chomp; print `cat FETB04.somatic.passed.vcf | vcf-subset --columns FETB04-B,$_ &gt; vcf2maf\/$_.vcf`&#039;\ncat FETB05_sample_ids | perl -ne &#039;chomp; print `cat FETB05.somatic.passed.vcf | vcf-subset --columns FETB05-B,$_ &gt; vcf2maf\/$_.vcf`&#039;\ncat FETB06_sample_ids | perl -ne &#039;chomp; print `cat FETB06.somatic.passed.vcf | vcf-subset --columns FETB06-B,$_ &gt; vcf2maf\/$_.vcf`&#039;\n\n# For each VCF, run vcf2maf with the `--tumor-id` specified, to create per-sample MAFs into the subfolder:\nperl -ne &#039;chomp; print &quot;perl vcf2maf.pl --input-vcf vcf2maf\/$_.vcf --output-maf vcf2maf\/$_.vep.maf --tumor-id $_\\n&quot;&#039; *sample_ids &gt;&gt; vcf2maf\/vcf2maf.sh\n# or:\nperl -ne &#039;chomp;next if($_=~\/^$\/);my @a=split \/\\t\/;print &quot;vcf2maf.pl --input-vcf $a[0].vcf --output-maf $a[0].maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id $a[0] --vcf-normal-id $a[1] --vep-path \/home\/zhoukaiwen\/software\/anaconda3\/envs\/vcf2maf\/bin --vep-data \/home\/zhoukaiwen\/database\/vep\/ --ref-fasta \/home\/zhoukaiwen\/database\/GRCh38\/genecode_GRCh38.p14.genome.fa --verbose --ncbi-build GRCh38 --cache-version 114 &amp;&amp; cat $a[0].maf|grep -E \\&quot;version|FILTER|PASS\\&quot; &gt; $a[0]_filtered.maf &amp;&amp; echo $a[0] vcf2maf ok\\n&quot;&#039; ..\/..\/somatic\/sample_pair.txt &gt;vcf2maf.sh\n\n# Concatenate the per-sample MAFs together, making sure that the MAF header is not duplicated:\ncat *_filtered.maf | egrep &quot;^#|^Hugo_Symbol&quot; | head -2 &gt; AllSamples_filtered.maf\ncat *_filtered.maf | egrep -v &quot;^#|^Hugo_Symbol&quot; &gt;&gt; AllSamples_filtered.maf\n\ncat *M_filtered.maf | egrep &quot;^#|^Hugo_Symbol&quot; | head -2 &gt; AllSamples_M_filtered.maf\ncat *M_filtered.maf | egrep -v &quot;^#|^Hugo_Symbol&quot; &gt;&gt; AllSamples_M_filtered.maf\n\ncat *E_filtered.maf | egrep &quot;^#|^Hugo_Symbol&quot; | head -2 &gt; AllSamples_E_filtered.maf\ncat *M_filtered.maf | egrep -v &quot;^#|^Hugo_Symbol&quot; &gt;&gt; AllSamples_E_filtered.maf<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>vcftools\u4e0b\u8f7d\u5730\u5740\uff1a https:\/\/vcftools.github.io\/ \u5b89\u88c5\uff1a autogen.s&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-540","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/comments?post=540"}],"version-history":[{"count":9,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/540\/revisions"}],"predecessor-version":[{"id":580,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/540\/revisions\/580"}],"wp:attachment":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/media?parent=540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/categories?post=540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/tags?post=540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}