[med-svn] [Git][med-team/cat-bat][master] 2 commits: Run CAT and BAT test in a single file

Israel Komolehin (@Komolehin) gitlab at salsa.debian.org
Thu Jan 11 08:05:45 GMT 2024



Israel Komolehin pushed to branch master at Debian Med / cat-bat


Commits:
8ce616af by Komolehin Israel Timilehin at 2024-01-11T08:04:13+00:00
Run CAT and BAT test in a single file

- - - - -
c9329b6b by Komolehin Israel Timilehin at 2024-01-11T08:04:47+00:00
Added examples

- - - - -


3 changed files:

- + debian/examples
- − debian/tests/run-bat-unit-test
- debian/tests/run-cat-unit-test → debian/tests/run-unit-test


Changes:

=====================================
debian/examples
=====================================
@@ -0,0 +1 @@
+tests/data
\ No newline at end of file


=====================================
debian/tests/run-bat-unit-test deleted
=====================================
@@ -1,44 +0,0 @@
-#!/bin/bash
-
-CUR_DIR=`pwd`
-
-if [ "$AUTOPKGTEST_TMP" = "" ]; then
-
-	AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXX`
-	trap "rm -rf $AUTOPKG_TMP" 0 INT QUIT ABRT PIPE TERM
-
-fi
-
-mkdir -p "$AUTOPKGTEST_TMP"/data
-
-# Copy tests data
-cp -a "${CUR_DIR}"/tests/data/* "$AUTOPKGTEST_TMP"/data
-
-# Change directory into data
-cd "$AUTOPKGTEST_TMP"/data/
-
-# Extract fasta
-gunzip prepare/small.fa.gz
-
-# Prepare CAT database
-CAT prepare \
-    --db_fasta ./prepare/small.fa \
-    --names ./prepare/names.dmp \
-    --nodes ./prepare/nodes.dmp \
-    --acc2tax ./prepare/prot2acc.txt \
-    --db_dir ./output_db
-
-# Run BAT on single MAG
-CAT bins -b prepare/small.fa \
-         -d output_db/db \
-         -t output_db/tax 
-
-# Check final classification files (output files)
-if [ -f "out.BAT.ORF2LCA.txt" ] && [ -f "out.BAT.bin2classification.txt" ]; then
-    echo "Final Classification Files Generated"
-    rm -rf *
-else
-    echo "One or both classification files not generated"
-    rm -rf *
-    exit 1
-fi
\ No newline at end of file


=====================================
debian/tests/run-cat-unit-test → debian/tests/run-unit-test
=====================================
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 CUR_DIR=`pwd`
+pkg=cat-bat
 
 if [ "$AUTOPKGTEST_TMP" = "" ]; then
 
@@ -12,11 +13,13 @@ fi
 mkdir -p "$AUTOPKGTEST_TMP"/data
 
 # Copy tests data
-cp -a "${CUR_DIR}"/tests/data/* "$AUTOPKGTEST_TMP"/data
+cp -a /usr/share/doc/"${pkg}"/examples/data/* "$AUTOPKGTEST_TMP"/data
+
 
 # Change directory into data
 cd "$AUTOPKGTEST_TMP"/data/
 
+
 # Extract fasta
 gunzip prepare/small.fa.gz
 
@@ -37,9 +40,24 @@ CAT contigs \
 # Check final classification files (output files)
 if [ -f "out.CAT.ORF2LCA.txt" ] && [ -f "out.CAT.contig2classification.txt" ]; then
     echo "Final Classification Files Generated"
-    rm -rf *
+    rm -rf out.*
+else
+    echo "One or both classification files not generated"
+    rm -rf out.*
+    exit 1
+fi
+
+# Run BAT on single MAG
+CAT bins -b prepare/small.fa \
+         -d output_db/db \
+         -t output_db/tax 
+
+# Check final classification files (output files)
+if [ -f "out.BAT.ORF2LCA.txt" ] && [ -f "out.BAT.bin2classification.txt" ]; then
+    echo "Final Classification Files Generated"
+    rm -rf out.*
 else
     echo "One or both classification files not generated"
-    rm -rf *
+    rm -rf out.*
     exit 1
 fi
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/med-team/cat-bat/-/compare/446fb2f7966393f2e3a6346921fcb95960ab8fe1...c9329b6bb448cd2f54e3448118aeb03581a18a54

-- 
View it on GitLab: https://salsa.debian.org/med-team/cat-bat/-/compare/446fb2f7966393f2e3a6346921fcb95960ab8fe1...c9329b6bb448cd2f54e3448118aeb03581a18a54
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240111/7cc1c4e3/attachment-0001.htm>


More information about the debian-med-commit mailing list