comparison draw_amr_matrix.xml @ 4:33a0ea992043 draft

Uploaded
author greg
date Tue, 21 Feb 2023 19:55:42 +0000
parents 9fcc1ffd7526
children 389c98d344ce
comparison
equal deleted inserted replaced
3:7d7884f2d921 4:33a0ea992043
6 <expand macro="requirements"/> 6 <expand macro="requirements"/>
7 <command detect_errors="exit_code"><![CDATA[ 7 <command detect_errors="exit_code"><![CDATA[
8 #import re 8 #import re
9 9
10 mkdir amr_feature_hits_dir && 10 mkdir amr_feature_hits_dir &&
11 mkdir mutations_dir &&
11 mkdir output_dir && 12 mkdir output_dir &&
13
14 #if $reference_source.reference_source_selector == 'history':
15 ln -f -s '$reference_source.ref_file' reference.fa &&
16 #else:
17 ln -f -s '$reference_source.ref_file.fields.path' reference.fa &&
18 #end if
12 19
13 #for $i in $amr_feature_hits: 20 #for $i in $amr_feature_hits:
14 #set file_name = $i.file_name 21 #set file_name = $i.file_name
15 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier)) 22 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
16 ln -s '$file_name' 'amr_feature_hits_dir/$identifier' && 23 ln -s '$file_name' 'amr_feature_hits_dir/$identifier' &&
17 #end for 24 #end for
18 25
19 python '$__tool_directory__/draw_amr_matrix.py' 26 python '$__tool_directory__/draw_amr_matrix.py'
27 --amr_feature_hits_dir 'amr_feature_hits_dir'
28 #if str($amr_deletions_file) != 'None':
29 --amr_deletions_file '$amr_deletions_file'
30 #end if
31 #if str($amr_mutations_file) != 'None':
32 --amr_mutations_file '$amr_mutations_file'
33 #end if
34 #if str($amr_mutation_regions_file) != 'None':
35 --amr_mutation_regions_file '$amr_mutation_regions_file'
36 --region_mutations_output_file '$region_mutations_output_file'
37 #end if
20 --amr_gene_drug_file '$amr_gene_drug_file' 38 --amr_gene_drug_file '$amr_gene_drug_file'
21 --amr_deletions_file '$amr_deletions_file' 39 --reference_genome reference.fa
22 --amr_feature_hits_dir 'amr_feature_hits_dir' 40 --mutations_dir 'mutations_dir'
23 --output_dir 'output_dir' 41 --output_dir 'output_dir'
24 #if str($output_process_log) == 'yes': 42 #if str($output_process_log) == 'yes':
25 && mv 'process_log' '$process_log' 43 && mv 'process_log' '$process_log'
26 #end if 44 #end if
27 ]]></command> 45 ]]></command>
28 <inputs> 46 <inputs>
47 <conditional name="reference_source">
48 <param name="reference_source_selector" type="select" label="Select a reference genome from your history or use a cached genome index?">
49 <option value="cached">Use a cached genome index</option>
50 <option value="history">Select a genome from the history and build the index</option>
51 </param>
52 <when value="cached">
53 <param name="ref_file" type="select" label="Using reference genome" help="Select reference genome">
54 <options from_data_table="all_fasta">
55 <filter type="sort_by" column="2"/>
56 <validator type="no_options" message="No reference genomes are available"/>
57 </options>
58 </param>
59 </when>
60 <when value="history">
61 <param name="ref_file" type="data" format="fasta,fastq" label="Select the reference sequence" help="You can upload a FASTA file and use it as reference"/>
62 </when>
63 </conditional>
29 <param argument="--amr_feature_hits" format="bed" type="data_collection" collection_type="list" label="Collection of feature hits BED files"/> 64 <param argument="--amr_feature_hits" format="bed" type="data_collection" collection_type="list" label="Collection of feature hits BED files"/>
30 <param argument="--amr_deletions_file" type="data" format="bed" optional="true" label="AMR deletions file" help="Optional, leave blank to ignore"/> 65 <param argument="--amr_deletions_file" type="data" format="bed" optional="true" label="AMR deletions file" help="Optional, leave blank to ignore"/>
31 <param argument="--amr_mutations_file" type="data" format="tabular,tsv" optional="true" label="AMR mutations file" help="Optional, leave blank to ignore"/> 66 <param argument="--amr_mutations_file" type="data" format="tabular,tsv" optional="true" label="AMR mutations file" help="Optional, leave blank to ignore"/>
67 <param argument="--amr_mutation_regions_file" type="data" format="bed" optional="true" label="AMR mutation regions BED file" help="Optional, leave blank to ignore"/>
32 <param argument="--amr_gene_drug_file" type="data" format="tabular,tsv" label="AMR gene drugs file"/> 68 <param argument="--amr_gene_drug_file" type="data" format="tabular,tsv" label="AMR gene drugs file"/>
33 <param name="output_process_log" type="select" display="radio" label="Output process log file?"> 69 <param name="output_process_log" type="select" display="radio" label="Output process log file?">
34 <option value="no" selected="true">No</option> 70 <option value="no" selected="true">No</option>
35 <option value="yes">Yes</option> 71 <option value="yes">Yes</option>
36 </param> 72 </param>
37 </inputs> 73 </inputs>
38 <outputs> 74 <outputs>
39 <data name="process_log" format="txt" label="${tool.name} on ${on_string} (Process log)"> 75 <data name="process_log" format="txt" label="${tool.name} on ${on_string} (process log)">
40 <filter>output_process_log == 'yes'</filter> 76 <filter>output_process_log == 'yes'</filter>
77 </data>
78 <data name="region_mutations_output_file" format="tsv" label="${tool.name} on ${on_string} (region mutations)">
79 <filter>amr_mutation_regions_file not in [None, 'None']</filter>
41 </data> 80 </data>
42 <collection name="amr_matrix_png" type="list" format="png"> 81 <collection name="amr_matrix_png" type="list" format="png">
43 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.(?P&lt;ext&gt;png)" directory="output_dir"/> 82 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.(?P&lt;ext&gt;png)" directory="output_dir"/>
44 </collection> 83 </collection>
45 </outputs> 84 </outputs>
46 <tests> 85 <tests>
47 <test> 86 <test>
87 <param name="reference_source_selector" value="history"/>
88 <param name="ref_file" ftype="fasta" value="ref_genome.fasta"/>
48 <param name="amr_feature_hits"> 89 <param name="amr_feature_hits">
49 <collection type="list"> 90 <collection type="list">
50 <element name="amr_cds.bed" value="amr_cds.bed"/> 91 <element name="amr_pima_md.bed" value="amr_pima_md.bed"/>
51 </collection> 92 </collection>
52 </param> 93 </param>
53 <param name="amr_gene_drug_file" value="amr_gene_drug.tsv" ftype="tsv"/> 94 <param name="amr_gene_drug_file" value="amr_gene_drug.tsv" ftype="tsv"/>
54 <output_collection name="amr_matrix_png" type="list" count="1"> 95 <output_collection name="amr_matrix_png" type="list" count="1">
55 <element name="contig_1" ftype="png"> 96 <element name="contig_1" ftype="png">