diff --git a/bin/shovill b/bin/shovill index 9e6f212..89b5174 100755 --- a/bin/shovill +++ b/bin/shovill @@ -13,7 +13,7 @@ use POSIX qw(strftime); # Globals my $EXE = basename($PROGRAM_NAME); -my $VERSION = "1.0.7"; +my $VERSION = "1.0.8"; my $AUTHOR = "Torsten Seemann"; my $URL = "https://github.com/tseemann/shovill"; my $BAM = "$EXE.bam"; @@ -28,7 +28,7 @@ my $KMER_READ_FRAC = 0.75; # ensure max kmer below this prop of read length my $MIN_BQ = 3; # for trimming and stats and pilon my $MIN_MQ = 60; # for pilon my $MIN_FLASH_OVERLAP = 20; # for stitching -my $MIN_RAM_GB = 4; # for all tools +my $MIN_RAM_GB = 2; # for all tools my $TRIMOPT = "ILLUMINACLIP:$ADAPTERS:1:30:11 LEADING:$MIN_BQ TRAILING:$MIN_BQ MINLEN:30 TOPHRED33"; my @CMDLINE = ($0, @ARGV); # save this for printing to log later @@ -62,6 +62,10 @@ if ($ENV{TRAVIS} eq 'true') { delete $VERSION{'skesa'}; } +# Hardware stats +my $CORES = num_cpus(); +my $MEMORY = avail_ram_gb(); + # Options my(@Options, $version, $outdir, $force, $cpus, $tmpdir, $keepfiles, $namefmt, @@ -78,10 +82,6 @@ msg("Written by $AUTHOR"); msg("Homepage is $URL"); msg("Operating system is $OSNAME"); msg("Perl version is $PERL_VERSION"); - -# Hardware stats -my $CORES = num_cpus(); -my $MEMORY = avail_ram_gb(); msg("Machine has $CORES CPU cores and $MEMORY GB RAM"); # Check options @@ -689,8 +689,8 @@ sub setOptions { {OPT=>"keepfiles!", VAR=>\$keepfiles, DEFAULT=>0, DESC=>"Keep intermediate files"}, "RESOURCES", {OPT=>"tmpdir=s", VAR=>\$tmpdir, DEFAULT=>$ENV{TMPDIR} || '', DESC=>"Fast temporary directory"}, - {OPT=>"cpus=i", VAR=>\$cpus, DEFAULT=>$ENV{SHOVILL_CPUS} || 8, DESC=>"Number of CPUs to use (0=ALL)"}, - {OPT=>"ram=f", VAR=>\$ram, DEFAULT=>$ENV{SHOVILL_RAM} || 16, DESC=>"Try to keep RAM usage below this many GB"}, + {OPT=>"cpus=i", VAR=>\$cpus, DEFAULT=>$ENV{SHOVILL_CPUS} || $CORES, DESC=>"Number of CPUs to use (0=ALL)"}, + {OPT=>"ram=f", VAR=>\$ram, DEFAULT=>$ENV{SHOVILL_RAM} || min(16,$MEMORY), DESC=>"Try to keep RAM usage below this many GB"}, "ASSEMBLER", {OPT=>"assembler=s",VAR=>\$assembler, DEFAULT=>$ENV{SHOVILL_ASSEMBLER} || 'spades', DESC=>"Assembler: ".join(' ', keys %ASSEMBLER) }, {OPT=>"opts=s", VAR=>\$opts, DEFAULT=>'', DESC=>"Extra assembler options in quotes eg. spades: \"--untrusted-contigs locus.fna\" ..."}, diff --git a/test/test.sh b/test/test.sh index 6457221..7ec56ae 100755 --- a/test/test.sh +++ b/test/test.sh @@ -14,7 +14,7 @@ $SHOVILL --version $SHOVILL --check $SHOVILL --help ! $SHOVILL --doesnotexist -$SHOVILL --outdir "$OUTDIR" --R1 "$TESTDIR/R1.fq.gz" --R2 "$TESTDIR/R2.fq.gz" \ - --ram 3 --cpus 8 --depth 25 --force -grep '>' "$OUTDIR/contigs.fa" rm -frv "$OUTDIR" +$SHOVILL --outdir "$OUTDIR" --R1 "$TESTDIR/R1.fq.gz" --R2 "$TESTDIR/R2.fq.gz" \ + --depth 25 --force --trim +grep '>' "$OUTDIR/contigs.fa" | head