0
|
1 <tool id="draw_features" name="PIMA: draw features" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
|
|
2 <description>of annotated assemblies</description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements"/>
|
|
7 <command detect_errors="exit_code"><![CDATA[
|
|
8 #import re
|
|
9
|
|
10 #if $contigs.is_of_type('fasta.gz'):
|
|
11 gunzip -c '$contigs' > 'contigs.fasta' &&
|
|
12 #else:
|
|
13 ln -s '$contigs' 'contigs.fasta' &&
|
|
14 #end if
|
|
15
|
|
16 mkdir feature_hits_dir &&
|
|
17 mkdir output_dir &&
|
|
18
|
|
19 #for $i in $feature_hits:
|
|
20 #set file_name = $i.file_name
|
|
21 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
2
|
22 cat '$i' | awk '$7 != "."' | awk '{OFS="\t";locus=$7"\t"$8"\t"$9; if($5 > s[locus]){s[locus]=$5;id = sprintf("%.3f", $5); b[locus] = $1"\t"$2"\t"$3"\t"$4"\t"id"\t"$6}} END{for(i in b){print b[i]}}' | sort -k 1,1 -k2,2n > 'feature_hits_dir/$identifier' &&
|
0
|
23 #end for
|
|
24
|
|
25 python '$__tool_directory__/draw_features.py'
|
|
26 --contigs 'contigs.fasta'
|
|
27 --feature_hits_dir 'feature_hits_dir'
|
|
28 --output_dir 'output_dir'
|
|
29 #if str($output_process_log) == 'yes':
|
|
30 && mv 'process_log' '$process_log'
|
|
31 #end if
|
|
32 ]]></command>
|
|
33 <inputs>
|
|
34 <param name="contigs" type="data" format="fasta,fasta.gz" label="Fasta file of assembled contigs"/>
|
|
35 <param name="feature_hits" format="bed" type="data_collection" collection_type="list" label="Collection of feature hits BED files"/>
|
|
36 <param name="output_process_log" type="select" display="radio" label="Output process log file?">
|
|
37 <option value="no" selected="true">No</option>
|
|
38 <option value="yes">Yes</option>
|
|
39 </param>
|
|
40 </inputs>
|
|
41 <outputs>
|
|
42 <data name="process_log" format="txt" label="${tool.name} on ${on_string} (Process log)">
|
|
43 <filter>output_process_log == 'yes'</filter>
|
|
44 </data>
|
|
45 <collection name="features_png" type="list" format="png">
|
|
46 <discover_datasets pattern="(?P<designation>.+)\.(?P<ext>png)" directory="output_dir"/>
|
|
47 </collection>
|
|
48 </outputs>
|
|
49 <tests>
|
|
50 <test>
|
|
51 <param name="contigs" value="PS01519_contigs.fasta.gz" ftype="fasta.gz"/>
|
|
52 <param name="feature_hits">
|
|
53 <collection type="list">
|
|
54 <element name="amr_cds.bed" value="amr_cds.bed"/>
|
|
55 </collection>
|
|
56 </param>
|
|
57 <output_collection name="features_png" type="list" count="1">
|
|
58 <element name="contig_1" ftype="png">
|
|
59 <assert_contents>
|
|
60 <has_size value="25383" delta="100"/>
|
|
61 </assert_contents>
|
|
62 </element>
|
|
63 </output_collection>
|
|
64 </test>
|
|
65 </tests>
|
|
66 <help>
|
|
67 **What it does**
|
|
68
|
|
69 Accepts a FASTA file of assembled contigs and a collection of 2 BED files containing the feature hits and plots
|
|
70 the features.
|
|
71 </help>
|
|
72 <expand macro="citations"/>
|
|
73 </tool>
|
|
74
|