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