-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #36787, commits were: * fix quote * quiet down curl * update patch files for v2 * Update sra-human-scrubber to 2.0.0 * Update sra-human-scrubber to 1.1.0
- Loading branch information
1 parent
c5e7e4e
commit 5384883
Showing
5 changed files
with
58 additions
and
40 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
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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
diff --git a/init_db.sh b/init_db.sh | ||
index 54abf86..435351a 100755 | ||
index de67e29..03a69c5 100755 | ||
--- a/init_db.sh | ||
+++ b/init_db.sh | ||
@@ -1,5 +1,5 @@ | ||
@@ -1,7 +1,10 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
-curl -vf "https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter.db" -o ./data/human_filter.db | ||
+curl -vf "https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter.db" -o ${SCRUBBER_SHARE}/data/human_filter.db | ||
+SCRUBBER_SHARE=BIOCONDA_SED_REPLACE | ||
VERSION=$(curl "https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter/current/version.txt") | ||
-cd data && curl -vf "https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter/${VERSION}.human_filter.db" -o "${VERSION}.human_filter.db" | ||
-ln -s "${VERSION}".human_filter.db human_filter.db | ||
+cd ${SCRUBBER_SHARE}/data && \ | ||
+ curl -f "https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter/${VERSION}.human_filter.db" -o "${VERSION}.human_filter.db" && | ||
+ ln -s -f "${VERSION}".human_filter.db human_filter.db | ||
+ | ||
exit 0 | ||
|
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 |
---|---|---|
@@ -1,28 +1,48 @@ | ||
diff --git a/scripts/scrub.sh b/scripts/scrub.sh | ||
index fc2f35c..1fdfaab 100755 | ||
index f6b310c..6848a94 100755 | ||
--- a/scripts/scrub.sh | ||
+++ b/scripts/scrub.sh | ||
@@ -27,17 +27,17 @@ done | ||
shift $((OPTIND-1)) | ||
fastq="$1" | ||
@@ -27,7 +27,8 @@ RUNTEST=false | ||
THREADS= | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
-ROOT=$(dirname $DIR) | ||
ROOT=$(dirname $DIR) | ||
-DB=$ROOT/data/human_filter.db | ||
+ROOT=${SCRUBBER_ROOT} | ||
+SCRUBBER_SHARE=BIOCONDA_SED_REPLACE | ||
+DB=${SCRUBBER_SHARE}/data/human_filter.db | ||
|
||
-if [ "$1" == "test" ] && [ -e "$ROOT/test/scrubber_test.fastq" ]; | ||
+if [ "$1" == "test" ] && [ -e "${SCRUBBER_SHARE}/test/scrubber_test.fastq" ]; | ||
#Get input | ||
while getopts ":i:o:d:p:hxrt" opts; do | ||
@@ -65,10 +66,10 @@ if [ "$INFILE" == "test" ]; | ||
fi | ||
|
||
#TESTING create temp dir and set infile | ||
-if $RUNTEST && [ -e "$ROOT/test/scrubber_test.fastq" ]; | ||
+if $RUNTEST && [ -e "${SCRUBBER_SHARE}/test/scrubber_test.fastq" ]; | ||
then | ||
TMP_DIR=$(mktemp -d) | ||
- cp "$ROOT"/test/* "$TMP_DIR/" | ||
+ cp "${SCRUBBER_SHARE}"/test/* "$TMP_DIR/" | ||
fastq=$TMP_DIR/scrubber_test.fastq | ||
INFILE=$TMP_DIR/scrubber_test.fastq | ||
fi | ||
|
||
@@ -85,17 +86,17 @@ if [ ! -e "${INFILE}" ]; | ||
INFILE="$TMP_F_DIR/temp.fastq" | ||
fi | ||
-python "$ROOT/scripts/fastq_to_fasta.py" < "$fastq" > "$fastq.fasta" | ||
-${ROOT}/bin/aligns_to -db "$ROOT/data/human_filter.db" "$fastq.fasta" | "$ROOT/scripts/cut_spots_fastq.py" "$fastq" ${OPTS} > "$fastq.clean" | ||
+fastq_to_fasta.py < "$fastq" > "$fastq.fasta" | ||
+aligns_to -db "${DB}" "$fastq.fasta" | cut_spots_fastq.py "$fastq" ${OPTS} > "$fastq.clean" | ||
if [ "$1" == "test" ]; | ||
#Use infile or temp fastq and generate fasta | ||
-"$ROOT/scripts/fastq_to_fasta.py" < "${INFILE}" > "$TMP_F_DIR/temp.fasta" | ||
+fastq_to_fasta.py < "${INFILE}" > "$TMP_F_DIR/temp.fasta" | ||
if [ "$OUTFILE" ] && [ "$OUTFILE" != "-" ]; | ||
then | ||
if [ -e "$TMP_DIR/scrubber_test.fastq.clean" ] && | ||
- "${ROOT}"/bin/aligns_to -db "${DB}" $(if [[ "$THREADS" =~ ^[0-9]+$ ]]; then printf "%s" "-num_threads $THREADS"; fi) "$TMP_F_DIR/temp.fasta" | "$ROOT/scripts/cut_spots_fastq.py" "$INFILE" "$REPLACEN" "$SAVEIDSPOTS" > "$OUTFILE" | ||
+ aligns_to -db "${DB}" $(if [[ "$THREADS" =~ ^[0-9]+$ ]]; then printf "%s" "-num_threads $THREADS"; fi) "$TMP_F_DIR/temp.fasta" | cut_spots_fastq.py "$INFILE" "$REPLACEN" "$SAVEIDSPOTS" > "$OUTFILE" | ||
if [ "$SAVEIDSPOTS" ] && [ -e "$TMP_F_DIR/temp.fastq.removed_spots" ]; | ||
then | ||
cp "$TMP_F_DIR/temp.fastq.removed_spots" "$OUTFILE.removed_spots" | ||
fi | ||
else | ||
- "${ROOT}"/bin/aligns_to -db "${DB}" $(if [[ "$THREADS" =~ ^[0-9]+$ ]]; then printf "%s" "-num_threads $THREADS"; fi) "$TMP_F_DIR/temp.fasta" | "$ROOT/scripts/cut_spots_fastq.py" "$INFILE" "$REPLACEN" | ||
+ aligns_to -db "${DB}" $(if [[ "$THREADS" =~ ^[0-9]+$ ]]; then printf "%s" "-num_threads $THREADS"; fi) "$TMP_F_DIR/temp.fasta" | cut_spots_fastq.py "$INFILE" "$REPLACEN" | ||
fi | ||
|
||
#Check if TESTING was successful |
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
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