0
|
1 <tool id="pima_report" name="PIMA: summary report" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
|
|
2 <description></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 #set analysis_name = re.sub('[^\s\w\-]', '_', str($illumina_fastq_file.element_identifier))
|
|
11 #set assembly_name = re.sub('[^\s\w\-]', '_', str($assembly_fasta_file.element_identifier))
|
2
|
12
|
|
13 #if str($blastn_file) not in ['None', '']:
|
|
14 #set blastn_version = re.sub('[^\s\w\-]', '_', str($blastn_file.element_identifier))
|
|
15 #end if
|
|
16 #set dnadiff_version = re.sub('[^\s\w\-]', '_', str($dnadiff_snps_file.element_identifier))
|
|
17 #set dnadiff_version = $dnadiff_version.rstrip('(snps)')
|
1
|
18 #if str($flye_assembly_info_file) not in ['None', '']:
|
|
19 #set flye_version = re.sub('[^\s\w\-]', '_', str($flye_assembly_info_file.element_identifier))
|
|
20 #set flye_version = $flye_version.rstrip('(assembly info)')
|
|
21 #end if
|
2
|
22 #if str($kraken2_report_file) not in ['None', '']:
|
|
23 #set kraken2_version = re.sub('[^\s\w\-]', '_', str($kraken2_report_file.element_identifier))
|
|
24 #set kraken2_version = $kraken2_version.rstrip('(report)')
|
|
25 #end if
|
0
|
26
|
1
|
27 mkdir amr_matrix_png_dir &&
|
0
|
28 mkdir feature_bed_dir &&
|
|
29 mkdir feature_png_dir &&
|
|
30 mkdir mutation_regions_dir &&
|
|
31 touch 'pima_report.pdf' &&
|
|
32
|
1
|
33 #for $i in $amr_matrices_png:
|
|
34 #set file_name = $i.file_name
|
|
35 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
36 ln -s $i 'amr_matrix_png_dir/$identifier' &&
|
|
37 #end for
|
0
|
38 #for $i in $features_bed:
|
|
39 #set file_name = $i.file_name
|
|
40 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
41 ln -s $i 'feature_bed_dir/$identifier' &&
|
|
42 #end for
|
|
43 #for $i in $features_png:
|
|
44 #set file_name = $i.file_name
|
|
45 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
46 ln -s $i 'feature_png_dir/$identifier' &&
|
|
47 #end for
|
|
48 #for $i in $mutation_regions:
|
|
49 #set file_name = $i.file_name
|
|
50 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
|
|
51 ln -s $i 'mutation_regions_dir/$identifier' &&
|
|
52 #end for
|
|
53
|
|
54 python '${__tool_directory__}/pima_report.py'
|
1
|
55 --amr_matrix_png_dir 'amr_matrix_png_dir'
|
|
56 --amr_deletions_file '$amr_deletions_file'
|
0
|
57 --analysis_name '$analysis_name'
|
|
58 --assembly_fasta_file '$assembly_fasta_file'
|
|
59 --assembly_name '$assembly_name'
|
2
|
60 #if str($blastn_file) not in ['None', '']:
|
|
61 --blastn_version '$blastn_version'
|
|
62 #end if
|
1
|
63 --compute_sequence_length_file '$compute_sequence_length_file'
|
0
|
64 --contig_coverage_file '$contig_coverage_file'
|
|
65 --dbkey '$aligned_sample.metadata.dbkey'
|
1
|
66 --dnadiff_snps_file '$dnadiff_snps_file'
|
2
|
67 --dnadiff_version '$dnadiff_version'
|
0
|
68 --feature_bed_dir 'feature_bed_dir'
|
|
69 --feature_png_dir 'feature_png_dir'
|
1
|
70 #if str($flye_assembly_info_file) not in ['None', '']:
|
|
71 --flye_assembly_info_file '$flye_assembly_info_file'
|
|
72 --flye_version '$flye_version'
|
|
73 #end if
|
|
74 --genome_insertions_file '$genome_insertions_file'
|
0
|
75 #if $illumina_fastq_file.ext.endswith(".gz"):
|
|
76 --gzipped
|
|
77 #end if
|
|
78 --illumina_fastq_file '$illumina_fastq_file'
|
2
|
79 #if str($kraken2_report_file) not in ['None', '']:
|
|
80 --kraken2_report_file '$kraken2_report_file'
|
|
81 --kraken2_version '$kraken2_version'
|
|
82 #end if
|
0
|
83 --mutation_regions_dir 'mutation_regions_dir'
|
|
84 --mutation_regions_bed_file '$mutation_regions_bed_file'
|
|
85 --pima_css '${__tool_directory__}/pima.css'
|
1
|
86 --plasmids_file '$plasmids_file'
|
|
87 --reference_insertions_file '$reference_insertions_file'
|
0
|
88 && mv 'pima_report.pdf' '$output'
|
|
89 ]]></command>
|
|
90 <inputs>
|
1
|
91 <param name="amr_matrices_png" format="png" type="data_collection" collection_type="list" label="Collection of AMR matrix PNG files"/>
|
0
|
92 <param name="aligned_sample" type="data" format="bam" label="Aligned sample BAM file"/>
|
1
|
93 <param name="amr_deletions_file" type="data" format="bed" label="AMR deletions BED file"/>
|
0
|
94 <param name="assembly_fasta_file" type="data" format="fasta" label="Assembly FASTA file"/>
|
2
|
95 <param name="blastn_file" type="data" format="bam" label="Blastn BAM file"/>
|
1
|
96 <param name="compute_sequence_length_file" type="data" format="tabular,tsv" label="Compute sequence length tabular file"/>
|
|
97 <param name="contig_coverage_file" type="data" format="tabular,tsv" label="Contig coverage tabular file"/>
|
|
98 <param name="dnadiff_snps_file" type="data" format="tabular" label="DNAdiff snps tabular file"/>
|
0
|
99 <param name="features_bed" format="bed" type="data_collection" collection_type="list" label="Collection of best feature hits BED files"/>
|
|
100 <param name="features_png" format="png" type="data_collection" collection_type="list" label="Collection of best feature hits PNG files"/>
|
1
|
101 <param name="flye_assembly_info_file" type="data" format="tabular,tsv" optional="true" label="Flye assembly info tabular file" help="Optional, ignored if not selected"/>
|
|
102 <param name="genome_insertions_file" type="data" format="bed" label="Genome insertions BED file"/>
|
2
|
103 <param name="kraken2_report_file" type="data" format="tabular,tsv" optional="true" label="Kraken2 report tabular file" help="Optional, ignored if not selected"/>
|
0
|
104 <param name="illumina_fastq_file" type="data" format="fastqsanger,fastqsanger.gz" label="Fastq sample file"/>
|
|
105 <param name="mutation_regions" format="tabular,tsv" type="data_collection" collection_type="list" label="Collection of mutation regions tabular files"/>
|
|
106 <param name="mutation_regions_bed_file" type="data" format="mutations_regions,bed" label="Mutation regions BED file"/>
|
1
|
107 <param name="reference_insertions_file" type="data" format="bed" label="Reference insertions BED file"/>
|
|
108 <param name="plasmids_file" type="data" format="tsv" label="pChunks plasmids TSV file"/>
|
0
|
109 </inputs>
|
|
110 <outputs>
|
|
111 <data name="output" format="pdf"/>
|
|
112 </outputs>
|
|
113 <tests>
|
|
114 <test>
|
|
115 <param name="aligned_sample" value="aligned_sample.bam" ftype="bam"/>
|
|
116 <param name="assembly_fasta_file" value="assembly_fasta.fasta" ftype="fasta"/>
|
|
117 <param name="contig_coverage_file" value="contig_coverage.tabular" ftype="tabular"/>
|
|
118 <param name="illumina_fastq_file" value="illumina_fastq.fastq" ftype="fastq"/>
|
|
119 <output name="output" value="output.pdf" ftype="pdf"/>
|
|
120 </test>
|
|
121 </tests>
|
|
122 <help>
|
|
123 **What it does**
|
|
124
|
|
125 Generates the PIMA analysis summary report.
|
|
126 </help>
|
|
127 <expand macro="citations"/>
|
|
128 </tool>
|
|
129
|