Mercurial > repos > greg > draw_amr_matrix
view draw_amr_matrix.xml @ 8:7fe8ea50a81d draft
Uploaded
author | greg |
---|---|
date | Wed, 15 Mar 2023 13:31:18 +0000 |
parents | 389c98d344ce |
children | 70073df30a06 |
line wrap: on
line source
<tool id="draw_amr_matrix" name="PIMA: draw AMR matrix" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> <description>of genes and drugs</description> <macros> <import>macros.xml</import> </macros> <expand macro="requirements"/> <command detect_errors="exit_code"><![CDATA[ #import re mkdir amr_feature_hits_dir && mkdir mutation_regions_dir && mkdir amr_matrix_png_dir && #if $reference_source.reference_source_selector == 'history': ln -f -s '$reference_source.ref_file' reference.fa && #else: ln -f -s '$reference_source.ref_file.fields.path' reference.fa && #end if #for $i in $amr_feature_hits: #set file_name = $i.file_name #set identifier = re.sub('[^\s\w\-\\.]', '_', str($i.element_identifier)) ln -s '$file_name' 'amr_feature_hits_dir/$identifier' && #end for python '$__tool_directory__/draw_amr_matrix.py' --amr_feature_hits_dir 'amr_feature_hits_dir' #if str($amr_deletions_file) != 'None': --amr_deletions_file '$amr_deletions_file' #end if #if str($varscan_vcf_file) != 'None': --varscan_vcf_file '$varscan_vcf_file' #end if #if str($amr_mutation_regions_bed_file) != 'None': --amr_mutation_regions_bed_file '$amr_mutation_regions_bed_file' --mutation_regions_dir 'mutation_regions_dir' #end if --amr_gene_drug_file '$amr_gene_drug_file' --reference_genome reference.fa --amr_matrix_png_dir 'amr_matrix_png_dir' #if str($output_process_log) == 'yes': && mv 'process_log' '$process_log' #end if ]]></command> <inputs> <conditional name="reference_source"> <param name="reference_source_selector" type="select" label="Select a reference genome from your history or use a cached genome index?"> <option value="cached">Use a cached genome index</option> <option value="history">Select a genome from the history and build the index</option> </param> <when value="cached"> <param name="ref_file" type="select" label="Using reference genome" help="Select reference genome"> <options from_data_table="all_fasta"> <filter type="sort_by" column="2"/> <validator type="no_options" message="No reference genomes are available"/> </options> </param> </when> <when value="history"> <param name="ref_file" type="data" format="fasta,fastq" label="Select the reference sequence" help="You can upload a FASTA file and use it as reference"/> </when> </conditional> <param argument="--amr_feature_hits" format="bed" type="data_collection" collection_type="list" label="Collection of feature hits BED files"/> <param argument="--amr_deletions_file" type="data" format="bed" optional="true" label="AMR deletions file" help="Optional, leave blank to ignore"/> <param argument="--varscan_vcf_file" type="data" format="vcf" optional="true" label="Varscan VCF file" help="Optional, leave blank to ignore"/> <param argument="--amr_mutation_regions_bed_file" type="data" format="bed" optional="true" label="AMR mutation regions BED file" help="Optional, leave blank to ignore"/> <param argument="--amr_gene_drug_file" type="data" format="tabular,tsv" label="AMR gene drugs file"/> <param name="output_process_log" type="select" display="radio" label="Output process log file?"> <option value="no" selected="true">No</option> <option value="yes">Yes</option> </param> </inputs> <outputs> <data name="process_log" format="txt" label="${tool.name} on ${on_string} (process log)"> <filter>output_process_log == 'yes'</filter> </data> <collection name="mutation_regions_tsv" type="list" format="tsv" label="${tool.name} on ${on_string} (mutation regions)"> <filter>amr_mutation_regions_bed_file not in [None, 'None']</filter> <discover_datasets pattern="(?P<designation>.+)\.(?P<ext>tsv)" directory="mutation_regions_dir"/> </collection> <collection name="amr_matrix_png" type="list" format="png"> <discover_datasets pattern="(?P<designation>.+)\.(?P<ext>png)" directory="amr_matrix_png_dir"/> </collection> </outputs> <tests> <test> <param name="reference_source_selector" value="history"/> <param name="ref_file" ftype="fasta" value="ref_genome.fasta"/> <param name="amr_feature_hits"> <collection type="list"> <element name="amr_pima_md.bed" value="amr_pima_md.bed"/> </collection> </param> <param name="amr_gene_drug_file" value="amr_gene_drug.tsv" ftype="tsv"/> <output_collection name="amr_matrix_png" type="list" count="1"> <element name="contig_1" ftype="png"> <assert_contents> <has_size value="25383" delta="100"/> </assert_contents> </element> </output_collection> </test> </tests> <help> **What it does** Accepts a collection of best AMR feature hits, an optional AMR deletions BED file, an optional AMR mutations TSV file and a AMR gene drug mappings file and draws an AMR matrix. </help> <expand macro="citations"/> </tool>