changeset 1:e8510e04a86a draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vcf2maf commit f2287e6aab30c72ef1334688127711fc9624352e
author iuc
date Tue, 11 Oct 2022 20:30:54 +0000
parents 2973994fecd6
children
files vcf2maf.xml
diffstat 1 files changed, 37 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vcf2maf.xml	Tue Jun 28 21:07:04 2022 +0000
+++ b/vcf2maf.xml	Tue Oct 11 20:30:54 2022 +0000
@@ -1,7 +1,8 @@
-<tool id="vcf2maf" name="Convert VCF to MAF" version="@TOOL_VERSION@">
+<tool id="vcf2maf" name="Convert VCF to MAF" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
 	<description>with vcf2maf</description>
 	<macros>
 		<token name="@TOOL_VERSION@">1.6.21</token>
+		<token name="@VERSION_SUFFIX@">1</token>
 		<token name="@DB_VERSION@">106</token>
 	</macros>
 	<requirements>
@@ -9,15 +10,23 @@
 		<requirement type="package" version="@DB_VERSION@.1">ensembl-vep</requirement>
 	</requirements>
 	<command detect_errors="exit_code"><![CDATA[
+		## cBioPortal only supports human and mouse but requires their assembly name in NCBI format so we have to translate the dbkey for those
+		#set $ncbi_names = {"hg19": "GRCh37", "hg38": "GRCh38", "mm10": "GRCm38", "mm39": "GRCm39"}
+
 		ln -s '${input1}' MainInput.vcf &&
 		#if $ref_seq.ref_source == "cached":
 			ln -s '${ref_seq.ref.fields.path}' reference.fa &&
 		#elif $ref_seq.ref_source == "history":
 			ln -s '${ref_seq.ref}' reference.fa &&
 		#end if
-		vcf2maf.pl --input-vcf MainInput.vcf --output-maf MainOutput.maf --ref-fasta reference.fa
+		vcf2maf.pl --input-vcf MainInput.vcf --output-maf #if $include_header then 'MainOutput.maf' else 'temp.maf'# --ref-fasta reference.fa
 		#if $annotation_cache.source == "no_vep":
 			--inhibit-vep
+			#if $input1.metadata.dbkey in $ncbi_names:
+				--ncbi-build '${ncbi_names[$input1.metadata.dbkey]}'
+			#else:
+				--ncbi-build '${input1.metadata.dbkey}'
+			#end if
 		#else:
 			--vep-path \$(dirname \$(which vep))
 			--vep-data '${annotation_cache.cache_file.fields.path}'
@@ -57,6 +66,9 @@
 		#if $adv_opt.retain_ann:
 			--retain-ann '${adv_opt.retain_ann}'
 		#end if
+		#if not $include_header:
+			&& tail -n+2 temp.maf > MainOutput.maf
+		#end if
 	]]></command>
 	<inputs>
 		<param type="data" name="input1" label="VCF input file" format="vcf">
@@ -108,6 +120,7 @@
 		<param argument="--normal-id" type="text" optional="true" label="Enter normal sample ID (optional)" help="Used to fill the Matched_Norm_Sample_Barcode column of the output MAF with the normal sample ID."/>
 		<param argument="--vcf-tumor-id" type="text" optional="true" label="Enter name of tumor genotype column (optional)" help="VCFs from variant callers like VarScan use hardcoded sample IDs TUMOR/NORMAL to name genotype columns. Use this parameter to have vcf2maf correctly locate these columns to parse genotypes, while still printing proper sample IDs in the output MAF."/>
 		<param argument="--vcf-normal-id" type="text" optional="true" label="Enter name of normal genotype column (optional)" help="VCFs from variant callers like VarScan use hardcoded sample IDs TUMOR/NORMAL to name genotype columns. Use this parameter to have vcf2maf correctly locate these columns to parse genotypes, while still printing proper sample IDs in the output MAF."/>
+		<param name="include_header" type="boolean" checked="true" label="Include MAF version header in output file" help="The MAF version header is a comment that indicates the MAF version and is written into the first row of the ouput file. This is required by some downstream tools. The row containing column headers follows next."/>
 		
 		<section name="adv_opt" title="Advanced options">
 			<param argument="--any-allele" type="boolean" optional="true" checked="false" label="Allow also mismatched variant alleles when reporting co-located variants"/>
@@ -127,6 +140,9 @@
 			<param name="ref_source" value="history" />
 			<param name="ref" dbkey="hg19" value="test1.fa" ftype="fasta" />
 			<param name="annotation_cache.source" value="no_vep" />
+			<assert_command>
+				<has_text text="--ncbi-build 'GRCh37'"/>
+			</assert_command>
 			<output name="output1" file="output_test1.tabular" ftype="tabular" />
 		</test>
 		<test expect_num_outputs="1">
@@ -134,14 +150,33 @@
 			<param name="ref_source" value="cached" />
 			<param name="ref" value="hg19test" />
 			<param name="annotation_cache.source" value="no_vep" />
+			<assert_command>
+				<has_text text="--ncbi-build 'GRCh37'"/>
+			</assert_command>
 			<output name="output1" file="output_test1.tabular" ftype="tabular" />
 		</test>
 		<test expect_num_outputs="1">
+			<param name="input1" dbkey="hg19" value="input_test1.vcf" ftype="vcf" />
+			<param name="ref_source" value="cached" />
+			<param name="ref" value="hg19test" />
+			<param name="annotation_cache.source" value="no_vep" />
+			<param name="include_header" value="False" />
+			<output name="output1" ftype="tabular" >
+				<assert_contents>
+					<has_n_lines n="2" />
+					<not_has_text text="#version 2.4" />
+				</assert_contents>
+			</output>
+		</test>
+		<test expect_num_outputs="1">
 			<param name="input1" dbkey="dm6" value="input_test2.vcf" ftype="vcf" />
 			<param name="ref_source" value="history" />
 			<param name="ref" dbkey="dm6" value="test2.fa" ftype="fasta" />
 			<param name="source" value="restricted" />
 			<param name="cache_file" value="drosophila_melanogaster_vep_106_BDGP6.32" />
+			<assert_command>
+				<has_text text="--ncbi-build 'BDGP6.32'"/>
+			</assert_command>
 			<output name="output1" file="output_test2.tabular" ftype="tabular" />
 		</test>
 	</tests>