changeset 0:f955d9559654 default tip

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author edward-kirton
date Tue, 07 Jun 2011 17:21:54 -0400
parents
children
files abyss/abyss-pe.xml abyss/abyss-pe_wrapper.pl abyss/abyss.xml abyss/abyss_wrapper.sh abyss/suite_config.xml
diffstat 5 files changed, 198 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/abyss/abyss-pe.xml	Tue Jun 07 17:21:54 2011 -0400
@@ -0,0 +1,58 @@
+<tool id="abyss-pe" name="Abyss Paired-End" version="1.0.0">
+<description>Assemble short paired reads</description>
+<command interpreter='perl'>abyss-pe_wrapper.pl
+$k
+$n
+$outfile.extra_files_path
+$outfile
+$contigs_outfile
+$sam_outfile
+$coverage_histogram_outfile
+#for $i in $infiles
+${i.infile}
+#end for
+</command>
+
+<inputs>
+    <repeat name="infiles" title="Paired Reads Files">
+        <param name="infile" type="data" format="fasta,fastq,fastqsanger,fastqillumina" label="Paired read sequences"/>
+    </repeat>
+    <param name="k" type="integer" value="41" label="[-k] K-mer size" help="Try multiple sizes, starting around 2/3 read length" />
+    <param name="n" type="integer" value="10" label="[-n] Min. num. pairs for scaffolding" help="Requirement for joining contigs into a scaffold" />
+</inputs>
+
+<outputs>
+    <data name="outfile" format="txt" />
+    <data name="contigs_outfile" format="fasta" label="Contigs" />
+    <data name="sam_outfile" format="sam" label="Read aligments (Sam)" />
+    <data name="coverage_histogram_outfile" format="txt" label="Coverage histogram" />
+</outputs>
+
+<help>
+**What it does**
+
+ABySS is a de novo, paired-end sequence assembler that is designed for short reads. 
+
+**Input**
+
+The suffix of the read identifier for a pair of reads must be one of '1' and '2', or 'A' and 'B', or 'F' and 'R', or 'F3' and 'R3', or 'forward' and 'reverse'. The reads may be interleaved in the same file or found in different files; however, interleaved mates will use less memory.
+
+**Description**
+
+This tool performs the following commands:
+
+ABYSS - the single-end assembler
+AdjList - finds overlaps of length k-1 between contigs
+KAligner** - aligns reads to contigs
+ParseAligns** - finds pairs of reads in alignments
+DistanceEst** - estimates distances between contigs
+Overlap - find overlaps between blunt contigs
+SimpleGraph - finds paths between pairs of contigs
+MergePaths - merges consistent paths
+Consensus - for a colour-space assembly, convert the colour-space contigs to nucleotide contigs
+
+**Reference**
+
+http://www.bcgsc.ca/platform/bioinfo/software/abyss
+</help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/abyss/abyss-pe_wrapper.pl	Tue Jun 07 17:21:54 2011 -0400
@@ -0,0 +1,90 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use File::Copy;
+
+die("ERROR: Expected at least 8 arguments; got: @ARGV\n") unless @ARGV >= 8;
+
+# GET ARGS
+my $kmer_size=shift @ARGV;
+my $min_num_pairs=shift @ARGV;
+my $outdir=shift @ARGV;
+my $outfile=shift @ARGV;
+my $contigs_outfile=shift @ARGV;
+my $sam_outfile=shift @ARGV;
+my $hist_outfile=shift @ARGV;
+
+# ALL FILES GO IN THIS extra_files_path
+unless (-d $outdir) {
+    mkdir $outdir or die("Unable to make dir, $outdir\n");
+}
+chdir $outdir;
+
+# RUN COMMAND
+`abyss-pe k=$kmer_size n=$min_num_pairs in='@ARGV' name=abyss 2> $outdir/abyss.stderr > $outdir/abyss.stdout`;
+if ($? != 0) {
+    unless ( -s "$outdir/abyss-3.hist") { print STDERR "NO CONTIGS WERE PRODUCED!\n" }
+    open(IN, "<$outdir/abyss.stdout") or die($!);
+    while (<IN>) { print STDERR $_ }
+    close IN;
+    die("ABORTING\n");
+}
+
+# FILTER HISTOGRAM
+open (IN, "<$outdir/abyss.stderr") or die($!);
+open (OUT, ">$outfile") or die($!);
+while (my $line=<IN>) {
+    my @chars=split(//, $line);
+    my $filter=0;
+    foreach my $char (@chars) {
+        if (ord($char) >= 129) {
+            $filter=1;
+            last;
+        }
+    }
+    print OUT $line unless $filter;
+}
+close IN;
+close OUT;
+unlink("$outdir/abyss.stderr");
+
+# OUTPUT INFO LINE TEXT
+open(IN, "<$outdir/abyss.stdout") or die($!);
+while (<IN>) {
+    if (/^Assembled \d+ k\-mer in \d+ contigs/) {
+        print;
+        last;
+    }
+}
+close IN;
+
+# GALAXY DOESN'T WANT GZIPPED DATAFILES
+run("gunzip $outdir/abyss-3.sam.gz");
+
+# MOVE OUTFILES
+mv_outfile("$outdir/abyss-contigs.fa", $contigs_outfile);
+mv_outfile("$outdir/abyss-3.sam", $sam_outfile);
+mv_outfile("$outdir/coverage.hist", $hist_outfile);
+exit;
+
+sub run {
+    my $cmd=shift;
+    my $output=`$cmd 2>&1`;
+    if ($? != 0) {
+        print STDERR "ERROR RUNNING COMMAND: $cmd\n";
+        die($output);
+    }
+    return $output;
+}
+
+
+sub mv_outfile {
+    my ($src,$dest)=@_;
+    # if dest defined and src exist, then move outfiles to galaxy-specified location
+    if ( $dest ne 'None' and -f $src ) {
+        unlink($dest);
+        move($src,$dest);
+    }
+}
+__END__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/abyss/abyss.xml	Tue Jun 07 17:21:54 2011 -0400
@@ -0,0 +1,25 @@
+<tool id="abyss" name="Abyss" version="1.0.0">
+<description>Assemble short unpaired reads</description>
+<command interpreter='bash'>abyss_wrapper.sh $k $infile $outfile</command>
+
+<inputs>
+    <param name="infile" type="data" format="fasta|fastq" label="Unpaired read sequences" />
+    <param name="k" type="integer" value="41" label="K-mer size" help="Try multiple sizes, starting around 2/3 read length" />
+</inputs>
+
+<outputs>
+    <data name="outfile" format="fasta" />
+</outputs>
+
+<help>
+**What it does**
+
+ABySS is a de novo sequence assembler that is designed for short reads.
+
+.. image:: http://www.bcgsc.ca/platform/bioinfo/software/abyss/screenshot
+
+**Reference**
+
+http://www.bcgsc.ca/platform/bioinfo/software/abyss
+</help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/abyss/abyss_wrapper.sh	Tue Jun 07 17:21:54 2011 -0400
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+if [ $# -ne 3 ]
+then
+    echo "ERROR: Expected exactly 3 arguments; got: $*" 1>&2
+    exit 1
+fi
+
+CMD=`ABYSS -k$1 $2 -o $3 2>&1`
+if [ $? -ne 0 ]
+then
+{
+    echo "COMMAND FAILURE: $CMD" 1>&2
+    exit $?
+}
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/abyss/suite_config.xml	Tue Jun 07 17:21:54 2011 -0400
@@ -0,0 +1,9 @@
+<suite id='abyss_toolsuite' name='Suite of Abyss assembler tools' version="1.0.0">
+	<description>This suite contains Abyss and Abyss-PE config files and wrappers for Galaxy</description>
+	<tool id="abyss" name="Abyss" version="1.0.0">
+		<description>Abyss (single-end) assembler</description>
+	</tool>
+	<tool id="abyss-pe" name="Abyss Paired-End" version="1.0.0">
+		<description>Abyss-PE (paired-end) assembler</description>
+	</tool>
+</suite>