Skip to content

Commit

Permalink
Added test files
Browse files Browse the repository at this point in the history
  • Loading branch information
fbreitwieser committed Nov 15, 2017
1 parent 7a9ee08 commit f447dc5
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/get-timings.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env perl

use strict;
use warnings;

my $time = "wall clock";
my $mem = "Maximum resident set size";
my $sep = ";";

sub uutime {
my $wt_h = `grep '$time' $_[0] | sed 's/.* //'`; chomp $wt_h;
return $wt_h;
}

my $K="kraken";

print join($sep,qw/sample mbpm1 mbpm2 time1 time2 time3 mem1 mem2/),"\n";
for my $hll_t (@ARGV) {
my $bn = `basename $hll_t .krakenhll.timing.log`; chomp $bn;
die "$hll_t should be an hll timing log" if $bn == $hll_t;
print "$bn$sep";
(my $hll = $hll_t) =~ s/.timing//;
(my $k = $hll) =~ s/krakenhll/$K/;
(my $k_t = $hll_t) =~ s/krakenhll/$K/;
(my $kr_t = $hll_t) =~ s/krakenhll/$K-report/;

my $hm = `grep -o '[0-9\.]* Mbp/m' $hll | sed 's/ .*//'`; chomp $hm;
print $hm,$sep;
my $km = `grep -o '[0-9\.]* Mbp/m' $k | sed 's/ .*//'`; chomp $km;
print $km,$sep;

print uutime($hll_t),$sep;
print uutime($k_t),$sep;
print uutime($kr_t),$sep;

my $mem_h = `grep '$mem' $hll_t | sed 's/.* //'`; chomp $mem_h;
print $mem_h,$sep;
my $mem_k = `grep '$mem' $k_t | sed 's/.* //'`; chomp $mem_k;
print $mem_k,"\n";
}
27 changes: 27 additions & 0 deletions tests/run-fq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash


TIME="/usr/bin/time -v"
FILES=/ccb/salz4-1/fbreitwieser/microbiome-pipeline/staging/CP_PT{[0-9],10}-*.fastq.gz

for J in 1 2; do
for THREADS in 10 5 2 1; do

krakenhll --preload --db ../dbs/refseq-oct2017-k31 --report-file /dev/null --fasta <(printf ">A\nA")
for B in $*; do
echo $B
BN=`basename $B .fastq.gz` && echo $BN && BN="$BN.t$THREADS.j$J"
$TIME -o log/$BN.krakenhll.timing.log krakenhll --db ../dbs/refseq-oct2017-k31 --fastq --gzip --report-file report/$BN.krakenhll.report --threads $THREADS $B > kraken/$BN.krakenhll.kraken 2> log/$BN.krakenhll.log;
done

kraken --preload --db ../dbs/refseq-oct2017-k31 --fasta <(printf ">A\nA")
for B in $*; do
echo $B
BN=`basename $B .fastq.gz` && echo $BN && BN="$BN.t$THREADS.j$J"
$TIME -o log/$BN.kraken.timing.log kraken --db ../dbs/refseq-oct2017-k31 --fastq --gzip --threads $THREADS $B > kraken/$BN.kraken 2> log/$BN.kraken.log
$TIME -o log/$BN.kraken-report.timing.log kraken-report --db ../dbs/refseq-oct2017-k31 kraken/$BN.kraken > report/$BN.kraken.report;
done

done
done

0 comments on commit f447dc5

Please sign in to comment.