Mercurial > repos > iuc > cooc_mutbamscan
diff cooc_mutbamscan.xml @ 0:373c1735d31f draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cojac commit 38ed91999d4bbe3bedc294197926ea332eb6cd5e
author | iuc |
---|---|
date | Thu, 11 Aug 2022 13:50:37 +0000 |
parents | |
children | 9f1660129403 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cooc_mutbamscan.xml Thu Aug 11 13:50:37 2022 +0000 @@ -0,0 +1,155 @@ +<tool id="cooc_mutbamscan" name="Cojac: mutbamscan" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" + profile="@PROFILE@"> + <description> + scan an alignment file for mutation co-occurrences + </description> + <macros> + <import>macros.xml</import> + </macros> + <expand macro="biotools"/> + <expand macro="requirements"/> + <expand macro="version"/> + <command detect_errors="exit_code"><![CDATA[ +ln -s '$bed_file' 'bed_file' && +@VOCDIR_COMMAND@ +#import re +#set identifier = re.sub('[^\s\w\-\\.]', '_', str($bam_file.element_identifier)) +ln -s '$bam_file' ${identifier}.bam && +ln -s '${bam_file.metadata.bam_index}' ${identifier}.bai && +cooc-mutbamscan + -a '${identifier}.bam' + -b 'bed_file' + -m '$vocdir' + -y cooc.yaml + -j cooc.json + #if $amplicons_file.choice == 'build' + -A amplicons.yaml + #else + -Q '$amplicons_file.in_amp' + #end if + -t cooc.tsv + --cooc $cooc + ]]></command> + <inputs> + <expand macro="vocdir_input"/> + <param name="bed_file" type="data" format="bed" + label="BED file defining the amplicons"/> + <param name="bam_file" type="data" format="bam,cram,sam" + label="Alignment BAM/CRAM/SAM file"/> + <param argument="--cooc" type="integer" min="1" value="2" + label="Minimum number of cooccurence mutations on the same amplicon"/> + <conditional name="amplicons_file"> + <param name="choice" type="select" label="Source of amplicons YAML file"> + <option value="build">Build from BED + set of YAMLs for variants of concern</option> + <option value="custom">From history</option> + </param> + <when value="build"/> + <when value="custom"> + <param name="in_amp" type="data" format="yaml" + label="YAML file to query amplicons"/> + </when> + </conditional> + <param name="output_files" type="select" display="checkboxes" + multiple="true" label="Output files"> + <option value="yaml" selected="true">YAML</option> + <option value="json">JSON</option> + <option value="tabular">tabular</option> + </param> + </inputs> + <outputs> + <data name="cooc_yaml" format="yaml" + label="${tool.name} on ${on_string}: Mutation cooccurrence (yaml)" + from_work_dir="cooc.yaml"> + <filter>'yaml' in output_files</filter> + </data> + <data name="cooc_json" format="json" + label="${tool.name} on ${on_string}: Mutation cooccurrence (json)" + from_work_dir="cooc.json"> + <filter>'json' in output_files</filter> + </data> + <data name="cooc_tsv" format="tabular" + label="${tool.name} on ${on_string}: Mutation cooccurrence (tabular)" + from_work_dir="cooc.tsv"> + <filter>'tabular' in output_files</filter> + </data> + <data name="amplicons" format="yaml" + label="${tool.name} on ${on_string}: Amplicons (yaml)" + from_work_dir="amplicons.yaml"> + <filter>amplicons_file['choice'] == 'build'</filter> + </data> + </outputs> + <tests> + <!-- Test 1: build yaml for amplicons from bed and voc/ --> + <test expect_num_outputs="4"> + <conditional name="vocdir_option"> + <param name="choice" value="custom"/> + <param name="voc_file" value="omicron_ba1_mutations.yaml"/> + </conditional> + <param name="bam_file" value="tbam11.bam"/> + <param name="bed_file" value="nCoV-2019.insert.V3.bed"/> + <conditional name="amplicons_file"> + <param name="choice" value="build"/> + </conditional> + <param name="output_files" value="yaml,json,tabular"/> + <output name="cooc_yaml" ftype="yaml"> + <assert_contents> + <has_text text="76_om1"/> + <has_text text="81_om1"/> + </assert_contents> + </output> + <output name="cooc_json" ftype="json"> + <assert_contents> + <has_text text="76_om1"/> + <has_text text="81_om1"/> + </assert_contents> + </output> + <output name="cooc_tsv" ftype="tabular"> + <assert_contents> + <has_text text="76_om1"/> + <has_text text="81_om1"/> + </assert_contents> + </output> + <output name="amplicons" ftype="yaml"> + <assert_contents> + <has_text text="76_om1"/> + <has_text text="81_om1"/> + </assert_contents> + </output> + </test> + <!-- Test 2: supply yaml for amplicons and voc/ from cache --> + <test expect_num_outputs="2"> + <conditional name="vocdir_option"> + <param name="choice" value="cache"/> + </conditional> + <param name="bam_file" value="tbam11.bam"/> + <param name="bed_file" value="nCoV-2019.insert.V3.bed"/> + <conditional name="amplicons_file"> + <param name="choice" value="custom"/> + <param name="in_amp" value="amplicons111.yaml"/> + </conditional> + <param name="output_files" value="yaml,tabular"/> + <output name="cooc_yaml" ftype="yaml"> + <assert_contents> + <has_text text="76_om1"/> + <has_text text="81_om1"/> + </assert_contents> + </output> + <output name="cooc_tsv" ftype="tabular"> + <assert_contents> + <has_text text="76_om1"/> + <has_text text="81_om1"/> + </assert_contents> + </output> + </test> + </tests> + <help><![CDATA[ +@HELP_HEADER@ + +Information about **cooc-mutbamscan** method +============================================ + +The method scans an alignment BAM/CRAM/SAM file for mutation co-occurrences and output a JSON or YAML file. + + ]]></help> + <expand macro="citations"/> +</tool>