# HG changeset patch # User simon-gladman # Date 1465517742 14400 # Node ID 15f5a3074012b774ae1e07c2821501053bc96714 # Parent ff31f16f5dfd9ed564ccb70d68e6bf3b22b252c8 Added snippy core and static binaries for linux and mac. diff -r ff31f16f5dfd -r 15f5a3074012 macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Thu Jun 09 20:15:42 2016 -0400 @@ -0,0 +1,23 @@ + + + + snippy + + + + + + + + + + + @UNPUBLISHED{Seemann2013, + author = "Seemann T", + title = "snippy: fast bacterial variant calling from NGS reads", + year = "2015", + note = "https://github.com/tseemann/snippy"} + + + + diff -r ff31f16f5dfd -r 15f5a3074012 snippy-core.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/snippy-core.xml Thu Jun 09 20:15:42 2016 -0400 @@ -0,0 +1,67 @@ + + + + snippy + + + + + + + + + + + + + + + + + + + + + + + + @UNPUBLISHED{Seemann2013, + author = "Seemann T", + title = "snippy: fast bacterial variant calling from NGS reads", + year = "2015", + note = "https://github.com/tseemann/snippy"} + + + diff -r ff31f16f5dfd -r 15f5a3074012 snippy.xml --- a/snippy.xml Tue Jun 07 03:41:47 2016 -0400 +++ b/snippy.xml Thu Jun 09 20:15:42 2016 -0400 @@ -1,16 +1,10 @@ - + snippy - samtools - freebayes - bwa - vcftools - snpeff - vcflib - - - - + + + + @@ -125,6 +123,7 @@ cleanup is False + @@ -195,14 +194,13 @@ --bwaopt [X] Extra BWA MEM options, eg. -x pacbio (default '') ]]> + + @UNPUBLISHED{Seemann2013, + author = "Seemann T", + title = "snippy: fast bacterial variant calling from NGS reads", + year = "2015", + note = "https://github.com/tseemann/snippy"} + - - @UNPUBLISHED{Seemann2013, - author = "Seemann T", - title = "snippy: fast bacterial variant calling from NGS reads", - year = "2015", - note = "https://github.com/tseemann/snippy"} - - diff -r ff31f16f5dfd -r 15f5a3074012 snippy_core_wrapper.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/snippy_core_wrapper.pl Thu Jun 09 20:15:42 2016 -0400 @@ -0,0 +1,80 @@ +#!/usr/bin/env perl + +#-------------------------------------- +# +# snippy_core_wrapper.pl +# +# This is an intermediary script between snippy-core.xml and snippy-core +# It: +# - Copys the supplied zipped snippy output files to the working dir +# - Untars them to their datafile name +# - Builds the snippy-core command and captures the stdout and stderr to files +# - Runs the snippy-core command +# +#-------------------------------------- + +use warnings; +use strict; +use File::Copy; +use File::Basename; + +my(@Options, $indirs, $mincov, $noref); +setOptions(); + +my @list_of_dirs = split /\s+/, $indirs; + +#The list of final directories to be passed to snippy-core will be stored here. +my @snippy_outs; + +foreach my $d (@list_of_dirs){ + #print STDERR "$d\n"; + my $bn = basename($d); + my ($name, $dir, $ext) = fileparse($d, '\..*'); + copy($d, $bn); + #print STDERR "$d, $bn, $name, $dir, $ext\n"; + `tar -xf $bn`; + move("./out", "./$name"); + unlink($bn); + push @snippy_outs, $name; +} + +my $commandline = "snippy-core "; + +$commandline .= "--noref " if $noref; +$commandline .= "--mincov $mincov " if $mincov; +$commandline .= join(" ", @snippy_outs); +print STDERR "snippy-core commandline: $commandline\n"; + +my $ok = system($commandline); + +#---------------------------------------------------------------------- +# Option setting routines + +sub setOptions { + use Getopt::Long; + + @Options = ( + {OPT=>"help", VAR=>\&usage, DESC=>"This help"}, + {OPT=>"mincov=i", VAR=>\$mincov, DEFAULT=>'10.0', DESC=>"The minimum coverage to consider."}, + {OPT=>"noref!", VAR=>\$noref, DEFAULT=>0, DESC=>"Don't include the reference in the alignment."}, + {OPT=>"indirs=s", VAR=>\$indirs, DEFAULT=>"", DESC=>"A whitespace delimited list of the snippy output zipped dirs."}, + ); + + &GetOptions(map {$_->{OPT}, $_->{VAR}} @Options) || usage(); + + # Now setup default values. + foreach (@Options) { + if (defined($_->{DEFAULT}) && !defined(${$_->{VAR}})) { + ${$_->{VAR}} = $_->{DEFAULT}; + } + } +} + +sub usage { + print "Usage: $0 [options] -i inputfile > ... \n"; + foreach (@Options) { + printf " --%-13s %s%s.\n",$_->{OPT},$_->{DESC}, + defined($_->{DEFAULT}) ? " (default '$_->{DEFAULT}')" : ""; + } + exit(1); +} diff -r ff31f16f5dfd -r 15f5a3074012 tool_dependencies.xml --- a/tool_dependencies.xml Tue Jun 07 03:41:47 2016 -0400 +++ b/tool_dependencies.xml Thu Jun 09 20:15:42 2016 -0400 @@ -1,24 +1,6 @@ - - - - - - - - - - - - - - - - - - - +