Previous changeset 0:e93c1a0678cd (2016-08-09) Next changeset 2:05c394313b1c (2018-11-06) |
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/metaspades commit 9401451df4a985ef5686864eaadafa077ffc0877 |
modified:
metaspades.xml |
added:
README.md |
removed:
CHANGE spades.pl tool_dependencies.xml |
b |
diff -r e93c1a0678cd -r 01a241476407 CHANGE --- a/CHANGE Tue Aug 09 10:46:28 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,4 +0,0 @@ -1.0 -=== - - Supports SPades 3.9 - - CHANGE: Improved memory consumption in metagenomic pipeline. |
b |
diff -r e93c1a0678cd -r 01a241476407 README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Thu Mar 02 16:04:56 2017 -0500 |
b |
@@ -0,0 +1,17 @@ +**License** + +SPAdes is developed by and copyrighted to Saint-Petersburg Academic University, and is released under GPLv2. + +This wrapper is copyrighted by Philip Mabon and is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. + +** Acknowledgments ** + +Original wrapper developed by Lionel Guy. + +Anton Korobeynikov greatlty helped understanding how SPAdes work, and integrated handy features into SPAdes. + +Nicola Soranzo fixed various bugs. |
b |
diff -r e93c1a0678cd -r 01a241476407 metaspades.xml --- a/metaspades.xml Tue Aug 09 10:46:28 2016 -0400 +++ b/metaspades.xml Thu Mar 02 16:04:56 2017 -0500 |
[ |
b'@@ -1,139 +1,97 @@\n-<tool id="metaspades" name="metaspades" version="1.0">\n- <description>genome assembler for metagenomics datasets</description>\n- <requirements>\n- <requirement type="package" version="3.9.0">spades</requirement>\n- </requirements>\n- <command interpreter="perl">spades.pl \n- $out_contigs \n- $out_contig_stats \n- $out_scaffolds \n- $out_scaffold_stats \n- $out_log\n-\n- ## if the first fileset is a paired-collection, use the key as the name\n- #if $files[0].file_type.type == "paired-collection":\n- $files[0].file_type.fastq_collection.name\n- #else:\n- NODE\n- #end if\n+<tool id="metaspades" name="metaSPAdes" version="3.9.0">\n+ <description>assembler for metagenomics datasets</description>\n+ <requirements>\n+ <requirement type="package" version="3.9.0">spades</requirement>\n+ </requirements>\n+ <stdio>\n+ <exit_code range="1:" />\n+ </stdio>\n+ <command>\n+ <![CDATA[\n ## A real command looks like: spades.py -k 21,33,55,77,99,127 --careful -1 Y.fastq.gz -2 X.fastq.gz -t 24 -o output\n- spades.py\n- ## Forces unzipped output, faster\n- --disable-gzip-output\n- --meta\n- $onlyassembler\n-\n- -t \\${GALAXY_SLOTS:-16}\n-\n+ spades.py -o . --disable-gzip-output --meta $onlyassembler -t \\${GALAXY_SLOTS:-16}\n #if not $kmer_choice.auto_kmer_choice:\n- -k "$kmer_choice.kmers" \n+ -k "$kmer_choice.kmers"\n #end if\n-\n ## Sequence files\n- #set num=1\n- #if str( $lib_type ) == "paired_end":\n+ #set num=1\n+ #if str( $lib_type ) == "paired_end":\n #set prefix = \'pe\'\n- #end if\n- --$prefix$num-$orientation \n- #for $file in $files\n-\t#if $file.file_type.type == "separate"\n- --$prefix$num-1 fastq:$file.file_type.fwd_reads\n- --$prefix$num-2 fastq:$file.file_type.rev_reads\n+ #end if\n+ --$prefix$num-$orientation\n+ #for $file in $files\n+ #if $file.file_type.type == "separate"\n+ --$prefix$num-1 fastq:$file.file_type.fwd_reads\n+ --$prefix$num-2 fastq:$file.file_type.rev_reads\n #elif $file.file_type.type == "interleaved"\n- --$prefix$num-12 fastq:$file.file_type.interleaved_reads\n+ --$prefix$num-12 fastq:$file.file_type.interleaved_reads\n #elif $file.file_type.type == "paired-collection"\n- --$prefix$num-1 fastq:$file.file_type.fastq_collection.forward\n- --$prefix$num-2 fastq:$file.file_type.fastq_collection.reverse\n+ --$prefix$num-1 fastq:$file.file_type.fastq_collection.forward\n+ --$prefix$num-2 fastq:$file.file_type.fastq_collection.reverse\n #end if\n- #end for\n-\n-\n- </command>\n- <inputs>\n- <param name="onlyassembler" type="boolean" truevalue="--only-assembler" falsevalue="" checked="False" label="Run only assembly? (without read error correction)" />\n- <conditional name="kmer_choice">\n- <param name="auto_kmer_choice" type="boolean" checked="False" truevalue="true" falsevalue="false" label="Automatically choose k-mer values" help="k-mer choices can be chosen by SPAdes instead of being entered manually" />\n- <when value="false">\n- <param name="kmers" type="text" label="K-mers to use, separated by commas" value="21,33,55" help="Comma-separated list of k-mer sizes to be used (all values must be odd, less than 128, listed in ascending order, and smaller than the read length). The default value is 21,33,55." />\n- </when>\n- <when value="true"> </when>\n- </conditional> \n-\n- <!-- Reads -->\n-\n- <param name="lib_type" type="select" label="Library type">\n-\t<option value="paired_end">Paired-end</option>\n- </param>\n- <param name="orientation" type="select" label="Orientation">\n-\t<option value="fr" selected="true">-> <- (fr)</option>\n-\t<option value="rf"><- -> (rf)</option>\n-\t<option value="ff">-> -> (ff)</option>\n- </param>\n- <repeat name="files" title="Files" min="1">\n-\t<conditional name="file_type">'..b'ed-end</option>\n+ </param>\n+ <param label="Orientation" name="orientation" type="select">\n+ <option selected="true" value="fr"><![CDATA[-> <- (fr)]]></option>\n+ <option value="rf"><![CDATA[<- -> (rf)]]></option>\n+ <option value="ff"><![CDATA[-> -> (ff)]]></option>\n+ </param>\n+ <repeat name="files" title="Files" min="1">\n+ <conditional name="file_type">\n+ <param name="type" type="select" label="Select file format">\n+ <option value="separate">Separate input files</option>\n+ <option value="interleaved">Interleaved files</option>\n+ <option value="paired-collection">Paired List Collection</option>\n+ </param>\n+ <when value="separate">\n+ <param name="fwd_reads" type="data" format="fastq" label="Forward reads" help="FASTQ format" />\n+ <param name="rev_reads" type="data" format="fastq" label="Reverse reads" help="FASTQ format" />\n+ </when>\n+ <when value="interleaved">\n+ <param name="interleaved_reads" type="data" format="fastq" label="Interleaved paired reads" help="FASTQ format" />\n+ </when>\n+ <when value="paired-collection">\n+ <param name="fastq_collection" type="data_collection" label="Paired-end reads collection" format="fastq" collection_type="paired" help="FASTQ format" />\n+ </when>\n+ </conditional>\n+ </repeat>\n+ </inputs>\n+ <outputs>\n+ <data name="out_contigs" format="fasta" from_work_dir="contigs.fasta" label="SPAdes contigs (fasta)" />\n+ <data name="out_scaffolds" format="fasta" from_work_dir="scaffolds.fasta" label="SPAdes scaffolds (fasta)" />\n+ <data name="out_log" format="txt" from_work_dir="spades.log" label="SPAdes log" />\n+ </outputs>\n+ <tests>\n+ <test>\n+ <param name="sc" value="false" />\n+ <param name="careful" value="false" />\n+ <param name="kmers" value="33,55" />\n+ <param name="lib_type" value="paired_end" />\n+ <param name="fwd_reads" value="ecoli_1K_1.fq" ftype="fastq" />\n+ <param name="rev_reads" value="ecoli_1K_2.fq" ftype="fastq" />\n+ <output name="out_contigs" file="reference_1K.fa" ftype="fasta" compare="re_match" lines_diff="1" />\n+ </test>\n+ </tests>\n+ <help>\n+<![CDATA[\n **What it does**\n \n SPAdes \xe2\x80\x93 St. Petersburg genome assembler \xe2\x80\x93 is intended for both standard isolates and single-cell MDA bacteria assemblies. See http://bioinf.spbau.ru/en/spades for more details on SPAdes.\n-\n-This wrapper runs SPAdes 3.9, collects the output, and throws away all the temporary files. It also produces a tab file with contig names, length and coverage. \n-\n-**License**\n-\n-SPAdes is developed by and copyrighted to Saint-Petersburg Academic University, and is released under GPLv2.\n-\n-This wrapper is copyrighted by Philip Mabon and is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n-\n-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n-\n-You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.\n-\n-** Acknowledgments **\n-\n-Original wrapper developed by Lionel Guy.\n-\n-Anton Korobeynikov greatlty helped understanding how SPAdes work, and integrated handy features into SPAdes.\n-\n-Nicola Soranzo fixed various bugs.\n- </help>\n+]]>\n+ </help>\n <citations>\n <citation type="doi">10.1089/cmb.2012.0021</citation>\n </citations>\n' |
b |
diff -r e93c1a0678cd -r 01a241476407 spades.pl --- a/spades.pl Tue Aug 09 10:46:28 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,124 +0,0 @@ -#!/usr/bin/env perl -## A wrapper script to call spades.py and collect its output -use strict; -use warnings; -use File::Temp qw/ tempfile tempdir /; -use File::Copy; -use Getopt::Long; - -# Parse arguments -my ($out_contigs_file, - $out_contigs_stats, - $out_scaffolds_file, - $out_scaffolds_stats, - $out_log_file, - $new_name, - @sysargs) = @ARGV; - - -my $output_dir = 'output_dir'; - -# Create log handle -open my $log, '>', $out_log_file or die "Cannot write to $out_log_file: $?\n"; - -# Run program -runSpades(@sysargs); -collectOutput($new_name); -extractCoverageLength($out_contigs_file, $out_contigs_stats); -extractCoverageLength($out_scaffolds_file, $out_scaffolds_stats); -print $log "Done\n"; -close $log; -exit 0; - -# Run spades -sub runSpades { - my $cmd = join(" ", @_) . " -o $output_dir"; - my $return_code = system($cmd); - if ($return_code) { - print $log "Failed with code $return_code\nCommand $cmd\nMessage: $?\n"; - die "Failed with code $return_code\nCommand $cmd\nMessage: $?\n"; - } - return 0; -} - -# Collect output -sub collectOutput{ - my ($new_name) = @_; - - # To do: check that the files are there - # Collects output - if ( not -e "$output_dir/contigs.fasta") { - die "Could not find contigs.fasta file\n"; - } - if ( not -e "$output_dir/scaffolds.fasta") { - die "Could not find scaffolds.fasta file\n"; - } - - #if a new name is given for the contigs and scaffolds, change them before moving them - if ( $new_name ne 'NODE') { - renameContigs($new_name); - } - else { - move "$output_dir/contigs.fasta", $out_contigs_file; - move "$output_dir/scaffolds.fasta", $out_scaffolds_file; - } - - - - open LOG, '<', "$output_dir/spades.log" - or die "Cannot open log file $output_dir/spades.log: $?"; - print $log $_ while (<LOG>); - return 0; -} - -#Change name in contig and scaffolds file -sub renameContigs{ - my ($name) = @_; - - open my $in, '<',"$output_dir/contigs.fasta" or die $!; - open my $out,'>', $out_contigs_file; - - while ( my $line = <$in>) { - #remove the NODE_ so we can rebuilt the display_id with our contig name with the contig number. - #also move the remainder of the length - if ( $line =~ />NODE_(\d+)_(.+)/) { - $line = ">$name" . "_$1 $2\n"; - } - print $out $line; - } - close $in; - close $out; - - - open $in, '<',"$output_dir/scaffolds.fasta" or die $!; - open $out,'>', $out_scaffolds_file; - - while ( my $line = <$in>) { - #remove the NODE_ so we can rebuilt the display_id with our contig name with the contig number. - #also move the remainder of the length - if ( $line =~ />NODE_(\d+)_(.+)/) { - $line = ">$name" . "_$1 $2\n"; - } - print $out $line; - } - close $in; - close $out; - -} - - -# Extract -sub extractCoverageLength{ - my ($in, $out) = @_; - open FASTA, '<', $in or die $!; - open TAB, '>', $out or die $!; - print TAB "#name\tlength\tcoverage\n"; - while (<FASTA>){ - next unless /^>/; - chomp; - die "Not all elements found in $_\n" if (! m/^>(NODE|\S+)_(\d+)(?:_|\s)length_(\d+)_cov_(\d+\.*\d*)/); - my ($name,$n, $l, $cov) = ($1,$2, $3, $4); - print TAB "$name" . "_$n\t$l\t$cov\n"; - } - close TAB; -} |
b |
diff -r e93c1a0678cd -r 01a241476407 tool_dependencies.xml --- a/tool_dependencies.xml Tue Aug 09 10:46:28 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,6 +0,0 @@ -<?xml version="1.0"?> -<tool_dependency> - <package name="spades" version="3.9.0"> - <repository changeset_revision="d8c8c3dc8f9a" name="package_spades_3_9_0" owner="nml" toolshed="https://toolshed.g2.bx.psu.edu" /> - </package> -</tool_dependency> |