-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding kraken2 scripts to linux binaries
- Loading branch information
Ubuntu
committed
Oct 14, 2023
1 parent
7b814be
commit 190ea03
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)" |