Skip to content

Commit

Permalink
Fix and simplify nanoplot cheetah (#5943)
Browse files Browse the repository at this point in the history
The previous version has set `#set $f = $extension + ".gz"`, which then
generates invalid symlinks.
By having fewer if statements here there are less things that can go
wrong and we get test coverage with the existing tests.
  • Loading branch information
mvdbeek authored Apr 10, 2024
1 parent a9f99c5 commit af418b2
Showing 1 changed file with 11 additions and 38 deletions.
49 changes: 11 additions & 38 deletions tools/nanoplot/nanoplot.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="nanoplot" name="NanoPlot" version="@TOOL_VERSION@+galaxy0" profile="22.05">
<tool id="nanoplot" name="NanoPlot" version="@TOOL_VERSION@+galaxy1" profile="22.05">
<description>Plotting suite for Oxford Nanopore sequencing data and alignments</description>
<macros>
<token name="@TOOL_VERSION@">1.42.0</token>
Expand All @@ -16,47 +16,20 @@
</stdio-->
<version_command>NanoPlot --version</version_command>
<command detect_errors="exit_code"><![CDATA[
## set TMPDIR if not already set by admin
## otherwise kalleido fails with `Less than 64MB of free space in temporary directory for shared memory files: 0`
## export TMPDIR=\${TMPDIR:-\$_GALAXY_JOB_TMP_DIR};
#set $myfiles = $mode.reads.files
#set $myfiles = $mode.reads.files if $mode.choice == 'combined' else [$mode.reads.files]
#set reads_temp = []
#if $mode.choice == 'combined':
#for $i, $f in enumerate($myfiles)
#if $f.ext.startswith("fastq"):
#set $extension = 'fastq'
#else
#set $extension = $f.ext
#end if
#if $f.ext.endswith(".gz"):
#set $f = $extension + ".gz"
#else if $f.ext.endswith(".bz"):
#set $extension = $extension + "bz2"
#end if
ln -s '$f' './read_${i}.$extension' &&
#if "bam" in $extension
ln -s '$f.metadata.bam_index' './read_${i}.${extension}.bai' &&
#end if
$reads_temp.append("read_" + str($i) + "." + str($extension))
#end for
#else
#if $myfiles.ext.startswith("fastq"):
#set $extension = 'fastq'
#for $i, $f in enumerate($myfiles)
#if $f.ext.startswith("fastq"):
#set $extension = "fastq" if "." not in $f.ext else "fastq.%s" % $f.ext.split(".")[-1]
#else
#set $extension = $myfiles.ext
#end if
#if $myfiles.ext.endswith(".gz"):
#set $extension = $extension + ".gz"
#else if $myfiles.ext.endswith(".bz"):
#set $extension = $extension + "bz2"
#set $extension = $f.ext
#end if
ln -s '$myfiles' './read.$extension' &&
#if "bam" in $extension
ln -s '$myfiles.metadata.bam_index' './read.${extension}.bai' &&
ln -s '$f' './read_${i}.$extension' &&
#if $extension == "bam"
ln -s '$f.metadata.bam_index' './read_${i}.${extension}.bai' &&
#end if
$reads_temp.append("read." + str($extension))
#end if
$reads_temp.append("read_" + str($i) + "." + str($extension))
#end for
NanoPlot
--threads \${GALAXY_SLOTS:-4}
Expand Down

0 comments on commit af418b2

Please sign in to comment.