annotate draw_features.xml @ 6:d5a5d145cfce draft

Uploaded
author greg
date Fri, 10 Mar 2023 18:02:00 +0000
parents c318e520dca1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
1 <tool id="draw_features" name="PIMA: draw features" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
2 <description>of annotated assemblies</description>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
3 <macros>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
4 <import>macros.xml</import>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
5 </macros>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
6 <expand macro="requirements"/>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
7 <command detect_errors="exit_code"><![CDATA[
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
8 #import re
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
9
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
10 #if $contigs.is_of_type('fasta.gz'):
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
11 gunzip -c '$contigs' > 'contigs.fasta' &&
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
12 #else:
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
13 ln -s '$contigs' 'contigs.fasta' &&
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
14 #end if
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
15
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
16 mkdir feature_hits_dir &&
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
17 mkdir output_dir &&
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
18
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
19 #for $i in $feature_hits:
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
20 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
6
d5a5d145cfce Uploaded
greg
parents: 5
diff changeset
21 ln -s $i 'feature_hits_dir/$identifier' &&
0
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
22 #end for
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
23
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
24 python '$__tool_directory__/draw_features.py'
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
25 --contigs 'contigs.fasta'
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
26 --feature_hits_dir 'feature_hits_dir'
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
27 --output_dir 'output_dir'
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
28 #if str($output_process_log) == 'yes':
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
29 && mv 'process_log' '$process_log'
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
30 #end if
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
31 ]]></command>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
32 <inputs>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
33 <param name="contigs" type="data" format="fasta,fasta.gz" label="Fasta file of assembled contigs"/>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
34 <param name="feature_hits" format="bed" type="data_collection" collection_type="list" label="Collection of feature hits BED files"/>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
35 <param name="output_process_log" type="select" display="radio" label="Output process log file?">
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
36 <option value="no" selected="true">No</option>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
37 <option value="yes">Yes</option>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
38 </param>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
39 </inputs>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
40 <outputs>
4
3ba596014675 Uploaded
greg
parents: 2
diff changeset
41 <data name="process_log" format="txt" label="${tool.name} on ${on_string} (process log)">
0
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
42 <filter>output_process_log == 'yes'</filter>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
43 </data>
4
3ba596014675 Uploaded
greg
parents: 2
diff changeset
44 <collection name="features_bed" type="list" format="bed" label="${tool.name} on ${on_string} (best bed)">
5
c318e520dca1 Uploaded
greg
parents: 4
diff changeset
45 <discover_datasets pattern="__name__" directory="feature_hits_dir" format="bed"/>
4
3ba596014675 Uploaded
greg
parents: 2
diff changeset
46 </collection>
3ba596014675 Uploaded
greg
parents: 2
diff changeset
47 <collection name="features_png" type="list" format="png" label="${tool.name} on ${on_string} (png)">
0
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
48 <discover_datasets pattern="(?P&lt;designation&gt;.+)\.(?P&lt;ext&gt;png)" directory="output_dir"/>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
49 </collection>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
50 </outputs>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
51 <tests>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
52 <test>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
53 <param name="contigs" value="PS01519_contigs.fasta.gz" ftype="fasta.gz"/>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
54 <param name="feature_hits">
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
55 <collection type="list">
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
56 <element name="amr_cds.bed" value="amr_cds.bed"/>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
57 </collection>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
58 </param>
4
3ba596014675 Uploaded
greg
parents: 2
diff changeset
59 <output_collection name="features_bed" type="list" count="1">
5
c318e520dca1 Uploaded
greg
parents: 4
diff changeset
60 <element name="amr_cds.bed" ftype="bed">
4
3ba596014675 Uploaded
greg
parents: 2
diff changeset
61 <assert_contents>
6
d5a5d145cfce Uploaded
greg
parents: 5
diff changeset
62 <has_size value="610" delta="10"/>
4
3ba596014675 Uploaded
greg
parents: 2
diff changeset
63 </assert_contents>
3ba596014675 Uploaded
greg
parents: 2
diff changeset
64 </element>
3ba596014675 Uploaded
greg
parents: 2
diff changeset
65 </output_collection>
0
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
66 <output_collection name="features_png" type="list" count="1">
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
67 <element name="contig_1" ftype="png">
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
68 <assert_contents>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
69 <has_size value="25383" delta="100"/>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
70 </assert_contents>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
71 </element>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
72 </output_collection>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
73 </test>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
74 </tests>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
75 <help>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
76 **What it does**
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
77
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
78 Accepts a FASTA file of assembled contigs and a collection of 2 BED files containing the feature hits and plots
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
79 the features.
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
80 </help>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
81 <expand macro="citations"/>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
82 </tool>
636eeb4fb9ac Uploaded
greg
parents:
diff changeset
83