{"id":423,"date":"2025-02-20T10:05:41","date_gmt":"2025-02-20T02:05:41","guid":{"rendered":"https:\/\/www.kz-hub.tech\/?p=423"},"modified":"2025-07-10T11:39:46","modified_gmt":"2025-07-10T03:39:46","slug":"mantastrelka2-varscan2-call-somatic-mutation","status":"publish","type":"post","link":"https:\/\/www.kz-hub.tech\/index.php\/2025\/02\/20\/mantastrelka2-varscan2-call-somatic-mutation\/","title":{"rendered":"manta+strelka2\/varscan2 call somatic mutation"},"content":{"rendered":"<h2>manta+strelka2 call somatic mutation<\/h2>\n<pre><code>bgzip -f AgilentV6_GRCh38_ex_region.sort.filtered.bed \ntabix -p bed AgilentV6_GRCh38_ex_region.sort.filtered.bed.gz\n\nmkdir {manta,strelka2}\n\nconda activate strelka2\n\ncd manta\nperl -ne &#039;chomp; next if \/^$\/; @a = split \/\\t\/; print &quot;configManta.py --tumorBam ..\/align\/$a[0]_bqsr.bam --normalBam ..\/align\/$a[1]_bqsr.bam --referenceFasta \/data02\/zhangmengmeng\/database\/hg38\/gencode_GRCh38.p14.genome.fa --callRegions \/data02\/zhangmengmeng\/database\/gatk_resource_bundle\/hg38\/AgilentV6_GRCh38_ex_region.sort.filtered.bed.gz --generateEvidenceBam --runDir \/data02\/zhangmengmeng\/BPT\/LCM-WES\/manta\/$a[0] --exome --outputContig \\n&quot;&#039; sample_pair.txt &gt; CreateRunManta.sh\n.\/CreateRunManta.sh |grep &quot;runWorkflow.py&quot; &gt; RunManta.sh\nnohup .\/RunManta.sh &gt; RunManta.log 2&gt;&amp;1 &amp;\ncat RunManta.log |grep &quot;Manta workflow successfully completed&quot;\n\n# \u6ce8\u610fstrelka2\u7684conda\u7248\u672c\u4f3c\u4e4e\u6709\u95ee\u9898\uff0c\u9700\u8981\u4ecegithub\u4e0b\u8f7d\u540e\u89e3\u538b\u4f7f\u7528\ncd ..\/strelka2\nperl -ne &#039;chomp; next if \/^$\/; @a = split \/\\t\/; print &quot;\/data02\/zhangmengmeng\/software\/strelka-2.9.10.centos6_x86_64\/bin\/configureStrelkaSomaticWorkflow.py --tumorBam ..\/align\/$a[0]_bqsr.bam --normalBam ..\/align\/$a[1]_bqsr.bam --referenceFasta \/data02\/zhangmengmeng\/database\/hg38\/gencode_GRCh38.p14.genome.fa --callRegions \/data02\/zhangmengmeng\/database\/gatk_resource_bundle\/hg38\/AgilentV6_GRCh38_ex_region.sort.filtered.bed.gz --indelCandidates \/data02\/zhangmengmeng\/BPT\/LCM-WES\/manta\/$a[0]\/results\/variants\/candidateSmallIndels.vcf.gz --runDir \/data02\/zhangmengmeng\/BPT\/LCM-WES\/strelka2\/$a[0] --exome \\n&quot;&#039; sample_pair.txt &gt; CreateRunStrelka2.sh\n.\/CreateRunStrelka2.sh |grep &quot;runWorkflow.py&quot; &gt; RunStrelka2.sh\nsed -i &#039;s#$# -m local -j 4#&#039; RunStrelka2.sh\ncat RunStrelka2.log |grep &quot;Strelka somatic workflow successfully completed&quot;<\/code><\/pre>\n<h4>\u8fd0\u884c\u5b8c\u540e\u5904\u7406\uff1a<\/h4>\n<h5>1.\u5c06\u6240\u6709vcf\u6587\u4ef6copy\u5230\u65b0\u7684\u6587\u4ef6\u5939<\/h5>\n<pre><code># cp_results.sh\nmkdir -p snp indel\n\n# Move and rename somatic.snvs.vcf.gz\nfind . -path &quot;*\/results\/variants\/somatic.snvs.vcf.gz&quot; | while read file; do\n    new_name=$(echo &quot;$file&quot; | awk -F&#039;\/&#039; &#039;{print $(NF-3) &quot;.somatic.snvs.vcf.gz&quot;}&#039;)\n    cp &quot;$file&quot; &quot;snp\/$new_name&quot;\ndone\n\n# Move and rename somatic.indels.vcf.gz\nfind . -path &quot;*\/results\/variants\/somatic.indels.vcf.gz&quot; | while read file; do\n    new_name=$(echo &quot;$file&quot; | awk -F&#039;\/&#039; &#039;{print $(NF-3) &quot;.somatic.indels.vcf.gz&quot;}&#039;)\n    cp &quot;$file&quot; &quot;indel\/$new_name&quot;\ndone<\/code><\/pre>\n<h5>2.\u89e3\u538b\u5e76\u7b5b\u9009pass<\/h5>\n<pre><code class=\"language-bash\">cd snp\ngunzip .\/*.gz\n\ncd indel\ngunzip .\/*.gz\n\ncd ..\/\n# filter_pass.sh:\n# Process VCF files in the snp directory\nfor file in snp\/*.vcf; do\n    grep &#039;^#&#039; &quot;$file&quot; &gt; &quot;${file%.vcf}_filtered.vcf&quot;  # Extract headers\n    awk &#039;$7 == &quot;PASS&quot;&#039; &quot;$file&quot; &gt;&gt; &quot;${file%.vcf}_filtered.vcf&quot;  # Append PASS rows\ndone\n\n# Process VCF files in the indel directory\nfor file in indel\/*.vcf; do\n    grep &#039;^#&#039; &quot;$file&quot; &gt; &quot;${file%.vcf}_filtered.vcf&quot;  # Extract headers\n    awk &#039;$7 == &quot;PASS&quot;&#039; &quot;$file&quot; &gt;&gt; &quot;${file%.vcf}_filtered.vcf&quot;  # Append PASS rows\ndone\n<\/code><\/pre>\n<h2>varscan2 call somatic mutation<\/h2>\n<pre><code>cd align\nls *_bqsr.bam|perl -ne &#039;chomp;if($_=~\/(\\S+)\\_bqsr\/){print &quot;samtools view -b -u -q 20 $1_bqsr.bam | samtools mpileup -f \/data02\/zhangmengmeng\/database\/hg38\/gencode_GRCh38.p14.genome.fa - \\&gt; $1.mpileup &amp;&amp; echo $1 ok\\n&quot;}&#039; &gt; samtools_mpileup.sh\n\ncd varscan2\n# \u540c\u65f6\u8fd0\u884cvarscan somatic + varscan processSomatic\uff1a\nperl -ne &#039;chomp; next if \/^$\/; @a = split \/\\t\/; print &quot;varscan somatic ..\/..\/align\/$a[1].mpileup ..\/..\/align\/$a[0].mpileup $a[0] --strand-filter 1 --min-coverage 100 --min-reads 3 --min-var-freq 0.05 --p-value 0.05 --output-vcf 1 &amp;&amp; varscan processSomatic $a[0].snp.vcf --min-tumor-freq 0.05 --max-normal-freq 0.05 --p-value 0.05 &amp;&amp; varscan processSomatic $a[0].indel.vcf --min-tumor-freq 0.05 --max-normal-freq 0.05 --p-value 0.05 &amp;&amp; echo $a[0] varscan2 ok\\n&quot;&#039; ..\/..\/somatic\/sample_pair.txt &gt; varscan2.sh\n\n# \u5355\u72ec\u8fd0\u884cvarscan2\u540eprocessSomatic\uff1a\nperl -ne &#039;chomp; next if \/^$\/; @a = split \/\\t\/; print &quot;varscan somatic ..\/..\/align\/$a[1].mpileup ..\/..\/align\/$a[0].mpileup $a[0] --strand-filter 1 --min-coverage 250 --min-reads 3 --min-var-freq 0.05 --p-value 0.05 --output-vcf 1 &amp;&amp; echo $a[0] varscan2 ok\\n&quot;&#039; ..\/..\/somatic\/sample_pair.txt &gt; varscan2.sh\nperl -ne &#039;chomp; next if \/^$\/; @a = split \/\\t\/; print &quot;varscan processSomatic $a[0].snp.vcf --min-tumor-freq 0.05 --max-normal-freq 0.05 --p-value 0.05 &amp;&amp; varscan processSomatic $a[0].indel.vcf --min-tumor-freq 0.05 --max-normal-freq 0.05 --p-value 0.05 &amp;&amp; echo $a[0] varscan2 processSomatic ok\\n&quot;&#039; ..\/..\/somatic\/sample_pair.txt &gt; varscan2_processSomatic.sh\n\n# varscan\u7ed3\u675f\u540e\u8fd0\u884cvcf2maf\uff1a\nconda activate vcf2maf\nperl -ne &#039;chomp;next if($_=~\/^$\/);my @a=split \/\\t\/;print &quot;vcf2maf.pl --input-vcf $a[0].snp.Somatic.hc.vcf --output-maf $a[0].snp.Somatic.hc.maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id TUMOR --vcf-normal-id NORMAL --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; vcf2maf.pl --input-vcf $a[0].snp.Germline.hc.vcf --output-maf $a[0].snp.Germline.hc.maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id TUMOR --vcf-normal-id NORMAL --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; vcf2maf.pl --input-vcf $a[0].snp.LOH.hc.vcf --output-maf $a[0].snp.LOH.hc.maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id TUMOR --vcf-normal-id NORMAL --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; vcf2maf.pl --input-vcf $a[0].indel.Somatic.hc.vcf --output-maf $a[0].indel.Somatic.hc.maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id TUMOR --vcf-normal-id NORMAL --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; vcf2maf.pl --input-vcf $a[0].indel.Germline.hc.vcf --output-maf $a[0].indel.Germline.hc.maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id TUMOR --vcf-normal-id NORMAL --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; vcf2maf.pl --input-vcf $a[0].indel.LOH.hc.vcf --output-maf $a[0].indel.LOH.hc.maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id TUMOR --vcf-normal-id NORMAL --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; echo $a[0] vcf2maf ok\\n&quot;&#039; ..\/..\/somatic\/sample_pair.txt &gt;vcf2maf.sh\n\n# \u6279\u91cf\u8fd0\u884cAnnovar\nls *.Somatic.hc.vcf | perl -ne &#039;chomp; my $name = $1 if ($_ =~ \/([^\\\/]+)\\.Somatic\\.hc\\.vcf\/); print &quot;table_annovar.pl $name.Somatic.hc.vcf \/home\/zhoukaiwen\/database\/Annovar\/humandb_hg38 -buildver hg38 -out $name.Somatic.hc -remove -protocol refGene,cytoBand,avsnp151,exac03,gnomad41_exome,EAS.sites.2015_08,cosmic102_unique -operation g,r,f,f,f,f,f -nastring . -vcfinput \\n&quot;&#039;&gt;annovar.sh\n\n# \u628aAnnovar\u6ce8\u91ca\u540evcf\u8f6c\u6362\u6210maf\nperl -ne &#039;chomp;next if($_=~\/^$\/);my @a=split \/\\t\/;print &quot;vcf2maf.pl --input-vcf $a[0].snp.Somatic.hc.hg38_multianno.vcf --output-maf $a[0].snp.Somatic.hc.hg38_multianno.maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id TUMOR --vcf-normal-id NORMAL --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].snp.Somatic.hc.hg38_multianno.maf|grep -E \\&quot;version|FILTER|PASS\\&quot; &gt; $a[0].snp_pass.Somatic.hc.hg38_multianno.maf &amp;&amp; vcf2maf.pl --input-vcf $a[0].indel.Somatic.hc.hg38_multianno.vcf --output-maf $a[0].indel.Somatic.hc.hg38_multianno.maf --normal-id $a[1] --tumor-id $a[0] --vcf-tumor-id TUMOR --vcf-normal-id NORMAL --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].indel.Somatic.hc.hg38_multianno.maf|grep -E \\&quot;version|FILTER|PASS\\&quot; &gt; $a[0].indel_pass.Somatic.hc.hg38_multianno.maf  &amp;&amp; echo $a[0] vcf2maf ok\\n&quot;&#039; ..\/..\/somatic\/sample_pair.txt &gt;vcf2maf2.sh\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>manta+strelka2 call somatic mutation bgzip -f AgilentV6&#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-423","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\/423","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=423"}],"version-history":[{"count":23,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/423\/revisions"}],"predecessor-version":[{"id":607,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/423\/revisions\/607"}],"wp:attachment":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/media?parent=423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/categories?post=423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/tags?post=423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}