Skip to content

Commit

Permalink
adding kraken2 scripts to linux binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Oct 14, 2023
1 parent 7b814be commit 190ea03
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions benchmarking/linux-binaries/add_to_library.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Copyright 2013-2018, Derrick Wood <dwood@cs.jhu.edu>
#
# This file is part of the Kraken 2 taxonomic sequence classification system.

# Copy specified file into a Kraken library

set -u # Protect against uninitialized vars.
set -e # Stop on error

LIBRARY_DIR="$KRAKEN2_DB_NAME/library"

if [ ! -e "$1" ]
then
1>&2 echo "Can't add \"$1\": file does not exist"
exit 1
fi
if [ ! -f "$1" ]
then
1>&2 echo "Can't add \"$1\": not a regular file"
exit 1
fi

add_dir="$LIBRARY_DIR/added"
mkdir -p "$add_dir"
prelim_map=$(cp_into_tempfile.pl -t "prelim_map_XXXXXXXXXX" -d "$add_dir" -s txt /dev/null)
scan_fasta_file.pl "$1" > "$prelim_map"

filename=$(cp_into_tempfile.pl -t "XXXXXXXXXX" -d "$add_dir" -s fna "$1")

if [ -n "$KRAKEN2_MASK_LC" ]; then
1>&2 echo -n "Masking low-complexity regions of new file..."
mask_low_complexity.sh $filename
1>&2 echo " done."
fi

1>&2 echo "Added \"$1\" to library ($KRAKEN2_DB_NAME)"

0 comments on commit 190ea03

Please sign in to comment.