Skip to content

Commit

Permalink
add review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SantaMcCloud committed Dec 23, 2024
1 parent 6a9629b commit fecf9b3
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 32 deletions.
23 changes: 14 additions & 9 deletions tools/fairy/fairy_cov.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,28 @@
<command detect_errors="exit_code">
<![CDATA[
ln -s '$contig' '$contig.element_identifier' &&
ln -s '$bcsp_file' '$bcsp_file.element_identifier' &&
#import re
#set $file = re.sub('[^\s\w\-\\.]', '_', str($contig.element_identifier))
#set $bcsp = re.sub('[^\s\w\-\\.]', '_', str($bcsp_file.element_identifier))
ln -s '$contig' '$file' &&
ln -s '$bcsp_file' '$bcsp' &&
fairy coverage
'$contig.element_identifier'
'$bcsp_file.element_identifier'
-t \${GALAXY_SLOTS:-8}
'$file'
'$bcsp'
-t "\${GALAXY_SLOTS:-3}"
-m ${minimum_ani}
-M ${min_number_kmers}
-c ${c}
-k ${k.value}
-k ${k}
--min-spacing ${min_spacing}
${full_contig_name}
#if $output_type.value == 'semi':
#if $output_type == 'semi':
--aemb-format
#end if
#if $output_type.value == 'max':
#if $output_type == 'max':
--maxbin-format
#end if
-o '$output'
Expand All @@ -34,7 +39,7 @@
<param name="contig" type="data" format="fasta,fasta.gz" label="Input fasta contig file" help="Input the raw fasta contig file. It can be gzip!"/>
<param name="bcsp_file" type="data" format="bcsp" label="Input the pre-sketched file (.bcsp file)" help="This file will be generated with the fairy sketch tool."/>
<param argument="--minimum-ani" type="integer" optional="true" min="0" max="100" value="95" label="Set minimum ANI" help="Set the minimum adjusted ANI for the coverage calculation. CARE: only adjust it when you know what it does!"/>
<param argument="--min-number-kmers" type="integer" value="8" optional="true" label="Genome filter" help="Set the number for exclude genomes with less than this number of sampled k-mers."/>
<param argument="--min-number-kmers" type="integer" value="8" optional="true" label="Genome filter" help="Set a filter to filter out genomes with less then x k-mer sampled."/>
<param argument="-c" type="integer" value="50" optional="true" label="Set subsampling rate" help="This value does not interact with the .bcsp file which was used as input."/>
<param argument="-k" type="select" label="Select k-mer size" help="This value does not interact with the .bcsp file which was used as input.">
<option value="31">31</option>
Expand Down
73 changes: 50 additions & 23 deletions tools/fairy/fairy_sketch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,43 @@
<expand macro="requirements"/>
<command detect_errors="exit_code">
<![CDATA[
#import re
mkdir -p res &&
mkdir -p res &&
#if $input.is_select == "single":
#set $filename = $reads.element_identifier + '.bcsp'
ln -s '$reads' '$reads.element_identifier' &&
#else
#set $filename = $first_pairs.element_identifier + '.paired.bcsp'
ln -s '$first_pairs' '$first_pairs.element_identifier' &&
ln -s '$second_pairs' '$second_pairs.element_identifier' &&
#end if
#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))
#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))
#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:-8}
-c ${c}
-k ${k.value}
-d 'res'
#if $input.is_select == "single":
-r '$reads.element_identifier'
#else
-1 '$first_pairs.element_identifier'
-2 '$second_pairs.element_identifier'
#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
cp './res/${filename}' $output
]]>
</command>
Expand All @@ -40,14 +51,18 @@
<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>
<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">
Expand All @@ -74,6 +89,18 @@
</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[
Expand Down
Binary file added tools/fairy/test-data/forward.paired.bcsp
Binary file not shown.

0 comments on commit fecf9b3

Please sign in to comment.