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
21
+ − 10 #set analysis_name = re.sub('[^\s\w\-]', '_', str($fastq_file.element_identifier))
0
+ − 11 #set assembly_name = re.sub('[^\s\w\-]', '_', str($assembly_fasta_file.element_identifier))
2
+ − 12
12
+ − 13 #if str($bedtools_complementbed_file) not in ['None', '']:
+ − 14 #set bedtools_version = re.sub('[^\s\w\-]', '_', str($bedtools_complementbed_file.element_identifier))
+ − 15 #end if
+ − 16 #if str($blastn_features) not in ['None', '']:
+ − 17 #set blastn_version = re.sub('[^\s\w\-]', '_', str($blastn_features.element_identifier))
+ − 18 #end if
+ − 19 #if str($dnadiff_snps_file) not in ['None', '']:
+ − 20 #set dnadiff_version = re.sub('[^\s\w\-]', '_', str($dnadiff_snps_file.element_identifier))
+ − 21 #end if
21
+ − 22 #if str($assembler_version_file) not in ['None', '']:
+ − 23 #set assembler_version = re.sub('[^\s\w\-]', '_', str($assembler_version_file.element_identifier))
1
+ − 24 #end if
2
+ − 25 #if str($kraken2_report_file) not in ['None', '']:
+ − 26 #set kraken2_version = re.sub('[^\s\w\-]', '_', str($kraken2_report_file.element_identifier))
12
+ − 27 #end if
+ − 28 #if str($minimap2_bam_file) not in ['None', '']:
+ − 29 #set minimap2_version = re.sub('[^\s\w\-]', '_', str($minimap2_bam_file.element_identifier))
+ − 30 #end if
+ − 31 #if str($samtools_pileup_file) not in ['None', '']:
+ − 32 #set samtools_version = re.sub('[^\s\w\-]', '_', str($samtools_pileup_file.element_identifier))
+ − 33 #end if
+ − 34 #if str($varscan_vcf_file) not in ['None', '']:
+ − 35 #set varscan_version = re.sub('[^\s\w\-]', '_', str($varscan_vcf_file.element_identifier))
2
+ − 36 #end if
0
+ − 37
1
+ − 38 mkdir amr_matrix_png_dir &&
13
+ − 39 mkdir circos_png_dir &&
0
+ − 40 mkdir feature_bed_dir &&
+ − 41 mkdir feature_png_dir &&
+ − 42 mkdir mutation_regions_dir &&
+ − 43 touch 'pima_report.pdf' &&
+ − 44
1
+ − 45 #for $i in $amr_matrices_png:
+ − 46 #set file_name = $i.file_name
+ − 47 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
+ − 48 ln -s $i 'amr_matrix_png_dir/$identifier' &&
+ − 49 #end for
13
+ − 50 #for $i in $circos_png:
+ − 51 #set file_name = $i.file_name
+ − 52 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
+ − 53 ln -s $i 'circos_png_dir/$identifier' &&
+ − 54 #end for
0
+ − 55 #for $i in $features_bed:
+ − 56 #set file_name = $i.file_name
+ − 57 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
+ − 58 ln -s $i 'feature_bed_dir/$identifier' &&
+ − 59 #end for
+ − 60 #for $i in $features_png:
+ − 61 #set file_name = $i.file_name
+ − 62 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
+ − 63 ln -s $i 'feature_png_dir/$identifier' &&
+ − 64 #end for
+ − 65 #for $i in $mutation_regions:
+ − 66 #set file_name = $i.file_name
+ − 67 #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier))
+ − 68 ln -s $i 'mutation_regions_dir/$identifier' &&
+ − 69 #end for
+ − 70
+ − 71 python '${__tool_directory__}/pima_report.py'
1
+ − 72 --amr_matrix_png_dir 'amr_matrix_png_dir'
+ − 73 --amr_deletions_file '$amr_deletions_file'
0
+ − 74 --analysis_name '$analysis_name'
+ − 75 --assembly_fasta_file '$assembly_fasta_file'
+ − 76 --assembly_name '$assembly_name'
12
+ − 77 #if str($bedtools_complementbed_file) not in ['None', '']:
+ − 78 --bedtools_version '$bedtools_version'
+ − 79 #end if
+ − 80 #if str($blastn_features) not in ['None', '']:
+ − 81 --blastn_version '$blastn_version'
+ − 82 #end if
13
+ − 83 --circos_png_dir 'circos_png_dir'
1
+ − 84 --compute_sequence_length_file '$compute_sequence_length_file'
0
+ − 85 --contig_coverage_file '$contig_coverage_file'
+ − 86 --dbkey '$aligned_sample.metadata.dbkey'
1
+ − 87 --dnadiff_snps_file '$dnadiff_snps_file'
12
+ − 88 #if str($dnadiff_snps_file) not in ['None', '']:
+ − 89 --dnadiff_version '$dnadiff_version'
+ − 90 #end if
18
+ − 91 --errors_file '$errors_file'
0
+ − 92 --feature_bed_dir 'feature_bed_dir'
+ − 93 --feature_png_dir 'feature_png_dir'
21
+ − 94 #if str($assembler_version_file) not in ['None', '']:
+ − 95 --assembler_version '$assembler_version'
+ − 96 #if str($read_type) == 'ont':
+ − 97 ## Need to pass the tabular flye assembly file.
+ − 98 --flye_assembly_info_file '$assembler_version_file'
+ − 99 #end if
1
+ − 100 #end if
+ − 101 --genome_insertions_file '$genome_insertions_file'
21
+ − 102 #if $fastq_file.ext.endswith(".gz"):
0
+ − 103 --gzipped
+ − 104 #end if
21
+ − 105 --fastq_file '$fastq_file'
2
+ − 106 #if str($kraken2_report_file) not in ['None', '']:
+ − 107 --kraken2_report_file '$kraken2_report_file'
+ − 108 --kraken2_version '$kraken2_version'
+ − 109 #end if
12
+ − 110 #if str($minimap2_bam_file) not in ['None', '']:
+ − 111 --minimap2_version '$minimap2_version'
+ − 112 #end if
0
+ − 113 --mutation_regions_dir 'mutation_regions_dir'
+ − 114 --mutation_regions_bed_file '$mutation_regions_bed_file'
+ − 115 --pima_css '${__tool_directory__}/pima.css'
1
+ − 116 --plasmids_file '$plasmids_file'
13
+ − 117 --quast_report_file '$quast_report_file'
18
+ − 118 --read_type '$read_type'
1
+ − 119 --reference_insertions_file '$reference_insertions_file'
12
+ − 120 #if str($samtools_pileup_file) not in ['None', '']:
+ − 121 --samtools_version '$samtools_version'
+ − 122 #end if
+ − 123 #if str($varscan_vcf_file) not in ['None', '']:
+ − 124 --varscan_version '$varscan_version'
+ − 125 #end if
0
+ − 126 && mv 'pima_report.pdf' '$output'
+ − 127 ]]></command>
+ − 128 <inputs>
1
+ − 129 <param name="amr_matrices_png" format="png" type="data_collection" collection_type="list" label="Collection of AMR matrix PNG files"/>
0
+ − 130 <param name="aligned_sample" type="data" format="bam" label="Aligned sample BAM file"/>
1
+ − 131 <param name="amr_deletions_file" type="data" format="bed" label="AMR deletions BED file"/>
0
+ − 132 <param name="assembly_fasta_file" type="data" format="fasta" label="Assembly FASTA file"/>
12
+ − 133 <param name="bedtools_complementbed_file" type="data" format="bed" label="Bedtools ComplementBed BED file"/>
4
+ − 134 <param name="blastn_features" format="tabular" type="data_collection" collection_type="list" label="Collection of blastn tabular files"/>
13
+ − 135 <param name="circos_png" format="png" type="data_collection" collection_type="list" label="Collection of circos PNG files"/>
1
+ − 136 <param name="compute_sequence_length_file" type="data" format="tabular,tsv" label="Compute sequence length tabular file"/>
+ − 137 <param name="contig_coverage_file" type="data" format="tabular,tsv" label="Contig coverage tabular file"/>
+ − 138 <param name="dnadiff_snps_file" type="data" format="tabular" label="DNAdiff snps tabular file"/>
18
+ − 139 <param name="errors_file" type="data" format="txt" label="AMR mutation regions error txt file"/>
21
+ − 140 <param name="fastq_file" type="data" format="fastqsanger,fastqsanger.gz" label="Fastq sample file"/>
0
+ − 141 <param name="features_bed" format="bed" type="data_collection" collection_type="list" label="Collection of best feature hits BED files"/>
+ − 142 <param name="features_png" format="png" type="data_collection" collection_type="list" label="Collection of best feature hits PNG files"/>
21
+ − 143 <param name="assembler_version_file" type="data" format="fasta,tabular,tsv" optional="true" label="Assembly version file" help="Optional, ignored if not selected"/>
1
+ − 144 <param name="genome_insertions_file" type="data" format="bed" label="Genome insertions BED file"/>
2
+ − 145 <param name="kraken2_report_file" type="data" format="tabular,tsv" optional="true" label="Kraken2 report tabular file" help="Optional, ignored if not selected"/>
12
+ − 146 <param name="minimap2_bam_file" type="data" format="bam" label="Minimap2 BAM file"/>
0
+ − 147 <param name="mutation_regions" format="tabular,tsv" type="data_collection" collection_type="list" label="Collection of mutation regions tabular files"/>
+ − 148 <param name="mutation_regions_bed_file" type="data" format="mutations_regions,bed" label="Mutation regions BED file"/>
13
+ − 149 <param name="quast_report_file" type="data" format="tabular" label="Quast report tabular file"/>
18
+ − 150 <param argument="--read_type" type="select" label="Specify the read type">
+ − 151 <option value="ont" selected="true">Long reads - Oxford Nanopore Technologies (ONT)</option>
+ − 152 <option value="illumina">Short reads - Illumina</option>
+ − 153 </param>
1
+ − 154 <param name="reference_insertions_file" type="data" format="bed" label="Reference insertions BED file"/>
23
+ − 155 <param name="plasmids_file" type="data" format="tsv" optional="true" label="pChunks plasmids TSV file" help="Optional, ignored if not selected"/>
12
+ − 156 <param name="samtools_pileup_file" type="data" format="pileup" label="Samtools pileup file"/>
+ − 157 <param name="varscan_vcf_file" type="data" format="vcf" label="Varscan VCF file"/>
0
+ − 158 </inputs>
+ − 159 <outputs>
+ − 160 <data name="output" format="pdf"/>
+ − 161 </outputs>
+ − 162 <tests>
+ − 163 <test>
+ − 164 <param name="aligned_sample" value="aligned_sample.bam" ftype="bam"/>
+ − 165 <param name="assembly_fasta_file" value="assembly_fasta.fasta" ftype="fasta"/>
+ − 166 <param name="contig_coverage_file" value="contig_coverage.tabular" ftype="tabular"/>
21
+ − 167 <param name="fastq_file" value="ont_fastq.fastq" ftype="fastq"/>
0
+ − 168 <output name="output" value="output.pdf" ftype="pdf"/>
+ − 169 </test>
+ − 170 </tests>
+ − 171 <help>
+ − 172 **What it does**
+ − 173
+ − 174 Generates the PIMA analysis summary report.
+ − 175 </help>
+ − 176 <expand macro="citations"/>
+ − 177 </tool>
+ − 178