Mercurial > repos > iuc > fairy_sketch
changeset 0:008b08870cc0 draft
planemo upload for repository https://github.com/bluenote-1577/fairy commit 54ed1c9745f1b74e1d0a0a8353fc47f9818708e8
author | iuc |
---|---|
date | Sun, 12 Jan 2025 21:22:15 +0000 |
parents | |
children | 17d174efa4be |
files | fairy_sketch.xml macros.xml test-data/forward.paired.bcsp test-data/normal_test.tsv test-data/single_test.fasta.gz test-data/single_test.fasta.gz.bcsp test-data/test_2.tsv test-data/test_3.tsv test-data/test_paired_1.fq.gz test-data/test_paired_1.fq.gz.paired.bcsp test-data/test_paired_2.fq.gz |
diffstat | 11 files changed, 140 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fairy_sketch.xml Sun Jan 12 21:22:15 2025 +0000 @@ -0,0 +1,118 @@ +<tool id="fairy_sketch" name="Fairy sketch" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> + <description>sketching of k-mers for coverage into a hashtable</description> + <macros> + <import>macros.xml</import> + </macros> + <expand macro="requirements"/> + <command detect_errors="exit_code"> + <![CDATA[ + + #import re + + mkdir -p res && + + #if $input.is_select == "single": + #set $file = re.sub('[^\s\w\-\\.]', '_', str($reads.element_identifier)) + #set $filename = $file + '.bcsp' + ln -s '$reads' '$file' && + #else if $input.is_select == 'pair': + #set $file_1 = re.sub('[^\s\w\-\\.]', '_', str($first_pairs.element_identifier)) + #set $file_2 = re.sub('[^\s\w\-\\.]', '_', str($second_pairs.element_identifier)) + ## Since the tool used the first inputed file to name the output file this has to be used there to cp the right file + #set $filename = $file_1 + '.paired.bcsp' + ln -s '$first_pairs' '$file_1' && + ln -s '$second_pairs' '$file_2' && + #else + #set $file_1 = re.sub('[^\s\w\-\\.]', '_', str($paired_collection.forward.element_identifier)) + #set $file_2 = re.sub('[^\s\w\-\\.]', '_', str($paired_collection.reverse.element_identifier)) + ## Since the tool used the first inputed file to name the output file this has to be used there to cp the right file + #set $filename = $file_1 + '.paired.bcsp' + ln -s '$paired_collection.forward' '$file_1' && + ln -s '$paired_collection.reverse' '$file_2' && + #end if + + fairy sketch + -t "\${GALAXY_SLOTS:-3}" + -c ${c} + -k ${k} + -d 'res' + #if $input.is_select == "single": + -r '$file' + #else + -1 '$file_1' + -2 '$file_2' + #end if + && + + cp './res/${filename}' '$output' + + ]]> + </command> + <inputs> + <conditional name="input"> + <param name="is_select" type="select" label="Single or paired-end reads"> + <option value="single">Single</option> + <option value="pair">Paired</option> + <option value="paired_collection">Paired collection</option> + </param> + <when value="single"> + <param argument="--reads" type="data" format="fastqsanger,fasta,fastq,fasta.gz,fastq.gz" label="Input single-end reads"/> + </when> + <when value="pair"> + <param argument="--first_pairs" type="data" format="fastqsanger,fasta,fastq,fasta.gz,fastq.gz" label="Input first paired-end reads"/> + <param argument="--second_pairs" type="data" format="fastqsanger,fasta,fastq,fasta.gz,fastq.gz" label="Input second paired-end reads"/> + </when> + <when value="paired_collection"> + <param name="paired_collection" format="fastqsanger,fasta,fastq,fasta.gz,fastq.gz" type="data_collection" collection_type="paired" label="Input paired collection reads"/> + </when> + </conditional> + <param argument="-c" type="integer" value="50" optional="true" label="Set the subsampling rate"/> + <param argument="-k" type="select" label="Select k-mer size"> + <option value="31">31</option> + <option value="21">21</option> + </param> + </inputs> + <outputs> + <data name="output" format="bcsp" label="${tool.name} on ${on_string}"/> + </outputs> + <tests> + <test> + <conditional name="input"> + <param name="is_select" value="single"/> + <param name="reads" value="single_test.fasta.gz" ftype="fasta.gz"/> + </conditional> + <output name="output" file="single_test.fasta.gz.bcsp"/> + </test> + <test> + <conditional name="input"> + <param name="is_select" value="pair"/> + <param name="first_pairs" value="test_paired_1.fq.gz" ftype="fastq.gz"/> + <param name="second_pairs" value="test_paired_2.fq.gz" ftype="fastq.gz"/> + </conditional> + <output name="output" file="test_paired_1.fq.gz.paired.bcsp"/> + </test> + <test> + <conditional name="input"> + <param name="is_select" value="paired_collection"/> + <param name="paired_collection"> + <collection type="paired"> + <element name="forward" value="test_paired_1.fq.gz" ftype="fastq.gz" /> + <element name="reverse" value="test_paired_2.fq.gz" ftype="fastq.gz" /> + </collection> + </param> + </conditional> + <output name="output" file="forward.paired.bcsp"/> + </test> + </tests> + <help> + <![CDATA[ + + This tool sketch the k-mer into a hashtable which will be needed for the fairy coverage tool to create the coverage file. + + .. class:: infomark + + This tool can either use single-end or paired-end reads as input in multiple file formats. + ]]> + </help> + <expand macro="citations"/> +</tool> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Sun Jan 12 21:22:15 2025 +0000 @@ -0,0 +1,17 @@ +<macros> + <xml name="requirements"> + <requirements> + <requirement type="package" version="@TOOL_VERSION@">fairy</requirement> + <yield/> + </requirements> + </xml> + <token name="@TOOL_VERSION@">0.5.7</token> + <token name="@VERSION_SUFFIX@">0</token> + <token name="@PROFILE@">24.1</token> + <xml name="citations"> + <citations> + <citation type="doi">10.1101/2024.04.23.590803</citation> + <yield/> + </citations> + </xml> +</macros> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/normal_test.tsv Sun Jan 12 21:22:15 2025 +0000 @@ -0,0 +1,2 @@ +contigName contigLen totalAvgDepth single_test.fasta.gz single_test.fasta.gz-var +NZ_CP017438.1 3123040 0.05509718146076748 0.05509718146076748 0.014618167653679848
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/test_2.tsv Sun Jan 12 21:22:15 2025 +0000 @@ -0,0 +1,1 @@ +NZ_CP017438.1 0.05509718146076748