comparison snpEff_create_db.xml @ 25:5c7b70713fb5 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/snpeff commit a4c17efb8ec4b3a315766f5b5602effa275fade3
author iuc
date Wed, 03 Aug 2022 16:33:45 +0000
parents cfcf33df7fc0
children 9473cd297a76
comparison
equal deleted inserted replaced
24:cfcf33df7fc0 25:5c7b70713fb5
1 <tool id="snpEff_build_gb" name="SnpEff build:" version="@WRAPPER_VERSION@.galaxy4"> 1 <tool id="snpEff_build_gb" name="SnpEff build:" version="@WRAPPER_VERSION@.galaxy5">
2 <description> database from Genbank or GFF record</description> 2 <description> database from Genbank or GFF record</description>
3 <macros> 3 <macros>
4 <import>snpEff_macros.xml</import> 4 <import>snpEff_macros.xml</import>
5 </macros> 5 </macros>
6 <requirements> 6 <requirements>
7 <expand macro="requirement" /> 7 <expand macro="requirement" />
8 <requirement type="package" version="3.6">python</requirement> 8 <requirement type="package" version="1.79">biopython</requirement>
9 <requirement type="package" version="1.70">biopython</requirement>
10 <requirement type="package" version="0.4.15">python-magic</requirement>
11 <requirement type="package" version="5.32">libmagic</requirement>
12 </requirements> 9 </requirements>
13 <expand macro="stdio" /> 10 <expand macro="stdio" />
14 <expand macro="version_command" /> 11 <expand macro="version_command" />
15 <command><![CDATA[ 12 <command><![CDATA[
16 #if str( $input_type.input_type_selector ) == "gb": 13 #if str($input_type.input_type_selector) == "gb" and str($input_type.fasta) == "yes":
17 #if str( $input_type.fasta ) == "yes": 14 python3 '$__tool_directory__/gbk2fa.py' '${input_type.input}' '${output_fasta}' ${input_type.remove_version} &&
18 python3 '$__tool_directory__/gbk2fa.py' '${input_type.input_gbk}' '${output_fasta}' 15 #end if
19 #if $input_type.remove_version: 16
20 '${input_type.remove_version}' 17 mkdir -p '${snpeff_output.files_path}'/'${genome_version}' &&
18
19 #if str($input_type.input_type_selector) == "gb":
20 #if $input_type.input.is_of_type("genbank"):
21 ln -s '${input_type.input}' '${snpeff_output.files_path}/${genome_version}/genes.gbk' &&
22 #elif $input_type.input.is_of_type("genbank.gz"):
23 ln -s '${input_type.input}' '${snpeff_output.files_path}/${genome_version}/genes.gbk.gz' &&
24 #end if
25 #else:
26 #if $input_type.reference_source.reference_source_selector == "history":
27 #if $input_type.reference_source.input_fasta.is_of_type("fasta"):
28 ln -s '${input_type.reference_source.input_fasta}' '${snpeff_output.files_path}/${genome_version}/sequences.fa' &&
29 #elif $input_type.reference_source.input_fasta.is_of_type("fasta.gz"):
30 ln -s '${input_type.reference_source.input_fasta}' '${snpeff_output.files_path}/${genome_version}/sequences.fa.gz' &&
21 #end if 31 #end if
22 && 32 #elif $input_type.reference_source.reference_source_selector == "cached":
33 ln -s '${input_type.reference_source.ref_file.fields.path}' '${snpeff_output.files_path}/${genome_version}/sequences.fa' &&
23 #end if 34 #end if
24 #end if 35 ln -s '${input_type.input}' '${snpeff_output.files_path}/${genome_version}/genes.${input_type.input_type_selector}' &&
25
26 mkdir -p '${snpeff_output.files_path}'/'${genome_version}' &&
27
28 #if str( $input_type.input_type_selector ) == "gb":
29 #if $input_type.input_gbk.is_of_type("genbank"):
30 ln -s '${input_type.input_gbk}' '${snpeff_output.files_path}'/'${genome_version}'/genes.gbk &&
31 #elif $input_type.input_gbk.is_of_type("genbank.gz"):
32 ln -s '${input_type.input_gbk}' '${snpeff_output.files_path}'/'${genome_version}'/genes.gbk.gz &&
33 #end if
34 #elif str( $input_type.input_type_selector ) == "gff":
35 #if $input_type.reference_source.reference_source_selector == "history":
36 #if $input_type.reference_source.input_fasta.is_of_type("fasta"):
37 ln -s '${input_type.reference_source.input_fasta}' '${snpeff_output.files_path}'/'${genome_version}'/sequences.fa &&
38 #elif $input_type.reference_source.input_fasta.is_of_type("fasta.gz"):
39 ln -s '${input_type.reference_source.input_fasta}' '${snpeff_output.files_path}'/'${genome_version}'/sequences.fa.gz &&
40 #end if
41 #elif $input_type.reference_source.reference_source_selector == "cached":
42 ln -s '${input_type.reference_source.ref_file.fields.path}' '${snpeff_output.files_path}'/'${genome_version}'/sequences.fa &&
43 #end if
44 ln -s '${input_type.input_gff}' '${snpeff_output.files_path}'/'${genome_version}'/genes.gff &&
45 #elif str( $input_type.input_type_selector ) == "gtf":
46 #if $input_type.reference_source.reference_source_selector == "history":
47 #if $input_type.reference_source.input_fasta.is_of_type("fasta"):
48 ln -s '${input_type.reference_source.input_fasta}' '${snpeff_output.files_path}'/'${genome_version}'/sequences.fa &&
49 #elif $input_type.reference_source.input_fasta.is_of_type("fasta.gz"):
50 ln -s '${input_type.reference_source.input_fasta}' '${snpeff_output.files_path}'/'${genome_version}'/sequences.fa.gz &&
51 #end if
52 #elif $input_type.reference_source.reference_source_selector == "cached":
53 ln -s '${input_type.reference_source.ref_file.fields.path}' '${snpeff_output.files_path}'/'${genome_version}'/sequences.fa &&
54 #end if
55 ln -s '${input_type.input_gtf}' '${snpeff_output.files_path}'/'${genome_version}'/genes.gtf &&
56 #end if 36 #end if
57 37
58 snpEff @JAVA_OPTIONS@ build -v 38 snpEff @JAVA_OPTIONS@ build -v
59 -configOption '${genome_version}'.genome='${genome_version}' 39 -configOption '${genome_version}'.genome='${genome_version}'
60 -configOption '${genome_version}'.codonTable='${codon_table}' 40 -configOption '${genome_version}'.codonTable='${codon_table}'
61 #if str( $input_type.input_type_selector ) == "gb": 41 #if str($input_type.input_type_selector) == "gb":
62 -genbank 42 -genbank
63 #elif str( $input_type.input_type_selector ) == "gff": 43 #elif str($input_type.input_type_selector) == "gff":
64 -gff3 44 -gff3
65 #elif str( $input_type.input_type_selector ) == "gtf": 45 #elif str($input_type.input_type_selector) == "gtf":
66 -gtf22 46 -gtf22
67 #end if 47 #end if
68 -dataDir '${snpeff_output.files_path}' '${genome_version}' && 48 -dataDir '${snpeff_output.files_path}' '${genome_version}' &&
69 echo "${genome_version}.genome : ${genome_version}" >> '${snpeff_output.files_path}'/snpEff.config && 49 echo '${genome_version}.genome : ${genome_version}' >> '${snpeff_output.files_path}'/snpEff.config &&
70 echo "${genome_version}.codonTable : ${codon_table}" >> '${snpeff_output.files_path}'/snpEff.config 50 echo '${genome_version}.codonTable : ${codon_table}' >> '${snpeff_output.files_path}'/snpEff.config
71
72 ]]></command> 51 ]]></command>
73 <inputs> 52 <inputs>
74 <param name="genome_version" type="text" value="" label="Name for the database" help="For E. coli K12 you may want to use 'EcK12' etc."> 53 <param name="genome_version" type="text" value="" label="Name for the database" help="For E. coli K12, for example, you may want to use 'EcK12'. Note: Spaces are not allowed in the name and will get converted to underscores.">
54 <sanitizer>
55 <valid initial="string.ascii_letters,string.digits">
56 <add value="_" />
57 <add value="." />
58 <add value="-" />
59 </valid>
60 <mapping>
61 <add source=" " target="_" />
62 </mapping>
63 </sanitizer>
75 <validator type="empty_field" message="A genome version name is required" /> 64 <validator type="empty_field" message="A genome version name is required" />
76 </param> 65 </param>
77 <conditional name="input_type"> 66 <conditional name="input_type">
78 <param name="input_type_selector" type="select" display="radio" label="Input annotations are in" help="Specify format for annotations you are using to create SnpEff database"> 67 <param name="input_type_selector" type="select" display="radio" label="Input annotations are in" help="Specify format for annotations you are using to create SnpEff database">
79 <option value="gb" selected="true">GenBank</option> 68 <option value="gb" selected="true">GenBank</option>
80 <option value="gff">GFF</option> 69 <option value="gff">GFF</option>
81 <option value="gtf">GTF</option> 70 <option value="gtf">GTF</option>
82 </param> 71 </param>
83 <when value="gb"> 72 <when value="gb">
84 <param name="input_gbk" type="data" format="genbank,genbank.gz" label="Genbank dataset to build database from" help="This Genbank file will be used to generate snpEff database"/> 73 <param name="input" type="data" format="genbank,genbank.gz" label="Genbank dataset to build database from" help="This Genbank file will be used to generate snpEff database"/>
85 <param name="fasta" type="select" display="radio" label="Parse Genbank into Fasta" help="This will generate an additional dataset containing all sequences from Genbank file in FASTA format"> 74 <param name="fasta" type="select" display="radio" label="Parse Genbank into Fasta" help="This will generate an additional dataset containing all sequences from Genbank file in FASTA format">
86 <option value="yes" selected="true">Yes</option> 75 <option value="yes" selected="true">Yes</option>
87 <option value="no">No</option> 76 <option value="no">No</option>
88 </param> 77 </param>
89 <param argument="--remove_version" type="boolean" truevalue="--remove_version" falsevalue="" checked="true" label="Remove sequence version label?" help="Genbank sequences have vesion numbers such as B000564.2. This option removes them leaving only B000564" /> 78 <param argument="--remove_version" type="boolean" truevalue="--remove_version" falsevalue="" checked="true" label="Remove sequence version label?" help="Genbank sequences have version numbers such as B000564.2. This option removes them leaving only B000564" />
90 </when> 79 </when>
91 <when value="gff"> 80 <when value="gff">
92 <param name="input_gff" type="data" format="gff3" label="GFF dataset to build database from" help="This GFF file will be used to generate snpEff database"/> 81 <param name="input" type="data" format="gff3" label="GFF dataset to build database from" help="This GFF file will be used to generate snpEff database"/>
93 <conditional name="reference_source"> 82 <expand macro="ref_select" />
94 <param name="reference_source_selector" type="select" label="Choose the source for the reference genome">
95 <option value="cached">Locally cached</option>
96 <option value="history">History</option>
97 </param>
98 <when value="cached">
99 <param name="ref_file" type="select" label="Select reference genome">
100 <options from_data_table="fasta_indexes"/>
101 </param>
102 </when>
103 <when value="history">
104 <param name="input_fasta" type="data" format="fasta,fasta.gz" label="Genome in FASTA format" help="This dataset is required for generating SnpEff database. See help section below."/>
105 </when>
106 </conditional>
107 </when> 83 </when>
108 <when value="gtf"> 84 <when value="gtf">
109 <param name="input_gtf" type="data" format="gtf" label="GTF dataset to build database from" help="This GTF file will be used to generate snpEff database"/> 85 <param name="input" type="data" format="gtf" label="GTF dataset to build database from" help="This GTF file will be used to generate snpEff database"/>
110 <conditional name="reference_source"> 86 <expand macro="ref_select" />
111 <param name="reference_source_selector" type="select" label="Choose the source for the reference genome">
112 <option value="cached">Locally cached</option>
113 <option value="history">History</option>
114 </param>
115 <when value="cached">
116 <param name="ref_file" type="select" label="Select reference genome">
117 <options from_data_table="fasta_indexes"/>
118 </param>
119 </when>
120 <when value="history">
121 <param name="input_fasta" type="data" format="fasta,fasta.gz" label="Genome in FASTA format" help="This dataset is required for generating SnpEff database. See help section below."/>
122 </when>
123 </conditional>
124 </when> 87 </when>
125 </conditional> 88 </conditional>
126 <param name="codon_table" type="select" label="Select genetic code for this sequence" help="If this sequence uses non-standard genetic code, select one from these options"> 89 <param name="codon_table" type="select" label="Select genetic code for this sequence" help="If this sequence uses non-standard genetic code, select one from these options">
127 <option selected="true" value="Standard">Standard</option> 90 <option selected="true" value="Standard">Standard</option>
128 <option value="Vertebrate_Mitochondrial">Vertebrate_Mitochondrial</option> 91 <option value="Vertebrate_Mitochondrial">Vertebrate_Mitochondrial</option>
160 </outputs> 123 </outputs>
161 <tests> 124 <tests>
162 <test> 125 <test>
163 <param name="genome_version" value="pBR322"/> 126 <param name="genome_version" value="pBR322"/>
164 <param name="input_type_selector" value="gb"/> 127 <param name="input_type_selector" value="gb"/>
165 <param name="input_gbk" value="pBR322.gbk" /> 128 <param name="input" value="pBR322.gbk" />
166 <output name="snpeff_output"> 129 <output name="snpeff_output">
167 <assert_contents> 130 <assert_contents>
168 <has_text text="pBR322" /> 131 <has_text text="pBR322" />
169 </assert_contents> 132 </assert_contents>
170 </output> 133 </output>
171 <output name="output_fasta" value="pBR322_test1.fna"/> 134 <output name="output_fasta" value="pBR322_test1.fna"/>
172 </test> 135 </test>
173 <test> 136 <test>
174 <param name="genome_version" value="pBR322"/> 137 <param name="genome_version" value="pBR322"/>
175 <param name="input_type_selector" value="gb"/> 138 <param name="input_type_selector" value="gb"/>
176 <param name="input_gbk" value="pBR322.gbk.gz" /> 139 <param name="input" value="pBR322.gbk.gz" />
177 <output name="snpeff_output"> 140 <output name="snpeff_output">
178 <assert_contents> 141 <assert_contents>
179 <has_text text="pBR322" /> 142 <has_text text="pBR322" />
180 </assert_contents> 143 </assert_contents>
181 </output> 144 </output>
184 <test> 147 <test>
185 <param name="genome_version" value="pBR322"/> 148 <param name="genome_version" value="pBR322"/>
186 <param name="input_type_selector" value="gff"/> 149 <param name="input_type_selector" value="gff"/>
187 <param name="reference_source_selector" value="history"/> 150 <param name="reference_source_selector" value="history"/>
188 <param name="input_fasta" value="pBR322_test2.fna" /> 151 <param name="input_fasta" value="pBR322_test2.fna" />
189 <param name="input_gff" value="pBR322.gff3"/> 152 <param name="input" value="pBR322.gff3"/>
190 <output name="snpeff_output"> 153 <output name="snpeff_output">
191 <assert_contents> 154 <assert_contents>
192 <has_text text="pBR322" /> 155 <has_text text="pBR322" />
193 </assert_contents> 156 </assert_contents>
194 </output> 157 </output>
196 <test> 159 <test>
197 <param name="genome_version" value="pBR322"/> 160 <param name="genome_version" value="pBR322"/>
198 <param name="input_type_selector" value="gff"/> 161 <param name="input_type_selector" value="gff"/>
199 <param name="reference_source_selector" value="history"/> 162 <param name="reference_source_selector" value="history"/>
200 <param name="input_fasta" value="pBR322_test2.fna.gz" /> 163 <param name="input_fasta" value="pBR322_test2.fna.gz" />
201 <param name="input_gff" value="pBR322.gff3"/> 164 <param name="input" value="pBR322.gff3"/>
202 <output name="snpeff_output"> 165 <output name="snpeff_output">
203 <assert_contents> 166 <assert_contents>
204 <has_text text="pBR322" /> 167 <has_text text="pBR322" />
205 </assert_contents> 168 </assert_contents>
206 </output> 169 </output>
208 <test> 171 <test>
209 <param name="genome_version" value="Saccharomyces_mito"/> 172 <param name="genome_version" value="Saccharomyces_mito"/>
210 <param name="input_type_selector" value="gtf"/> 173 <param name="input_type_selector" value="gtf"/>
211 <param name="reference_source_selector" value="history"/> 174 <param name="reference_source_selector" value="history"/>
212 <param name="input_fasta" value="Saccharomyces_mito.fa.gz" /> 175 <param name="input_fasta" value="Saccharomyces_mito.fa.gz" />
213 <param name="input_gtf" value="Saccharomyces_mito.gtf" /> 176 <param name="input" value="Saccharomyces_mito.gtf" />
214 <output name="snpeff_output"> 177 <output name="snpeff_output">
215 <assert_contents> 178 <assert_contents>
216 <has_text text="Saccharomyces_mito" /> 179 <has_text text="Saccharomyces_mito" />
217 </assert_contents> 180 </assert_contents>
218 </output> 181 </output>