Skip to content

Commit

Permalink
Merge pull request #48 from eseiler/misc/util_fix
Browse files Browse the repository at this point in the history
[MISC] Adjust util scripts
  • Loading branch information
eseiler authored Aug 10, 2021
2 parents 5f1588a + 0f3044d commit 02312c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions util/src/bash_scripts/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ for i in $(seq -f "$BIN_DIR/$BIN_NUMBER/bins/bin_%0${#BIN_NUMBER}g.fasta" 0 1 $(
do
cp $i $working_directory/bins/
done
seq -f "$working_directory/bins/bin_%0${#BIN_NUMBER}g.fasta" 0 1 $((BIN_NUMBER-1)) > $working_directory/bins.list

cp $BIN_DIR/$BIN_NUMBER/reads_e$ERRORS\_$READ_LENGTH/all.fastq $working_directory/reads/

do_task () {
Expand All @@ -33,7 +35,7 @@ do_task () {
--size $SIZE \
--threads $THREADS \
--hash $HASH \
$(seq -f "$working_directory/bins/bin_%0${#BIN_NUMBER}g.fasta" 0 1 $((BIN_NUMBER-1)))
$working_directory/bins.list

query_log=$working_directory/$w\_$k\_$SIZE\_query.log # Does not contain HASH
query_out=$working_directory/$w\_$k\_$SIZE.out
Expand All @@ -43,8 +45,6 @@ do_task () {
--query $working_directory/reads/all.fastq \
--index $ibf_filename \
--output $query_out \
--kmer $k \
--window $w \
--threads $THREADS \
--error $ERRORS \
--pattern $READ_LENGTH \
Expand Down
9 changes: 7 additions & 2 deletions util/src/evaluation_scripts/eval_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ def process_output(path, bin_count, read_count, path_to_fp, path_to_fn):
try:
[x, y, thr, count] = line.strip().split('\t')
except ValueError:
fn += 1
continue
try:
[x, y] = line.strip().split('\t')
thr = -1
count = -1
except ValueError:
fn += 1
continue
[read_id, bins] = [int(x), [int(e) for e in y[:-1].split(',') if e != '']]
true_id = (read_id % read_count) // (read_count // bin_count)
if true_id in bins:
Expand Down

0 comments on commit 02312c4

Please sign in to comment.