[med-svn] [Git][med-team/ncbi-tools6][master] Autopkgtest: continue to improve tests by checking its output content

Liubov Chuprikova gitlab at salsa.debian.org
Tue Apr 10 17:45:05 BST 2018


Liubov Chuprikova pushed to branch master at Debian Med / ncbi-tools6


Commits:
d4460962 by Liubov Chuprikova at 2018-04-10T16:44:16+00:00
Autopkgtest: continue to improve tests by checking its output content

- - - - -


5 changed files:

- debian/copyright
- debian/source/include-binaries
- debian/tests/run-unit-test
- + debian/tests/test-data/dsRNA_viruses.gene_info.gz
- debian/tests/test-data/trnascan-se_sample.output


Changes:

=====================================
debian/copyright
=====================================
--- a/debian/copyright
+++ b/debian/copyright
@@ -14,13 +14,14 @@ Copyright: 1998-1999 Stephane Bortzmeyer <bortzmeyer at pasteur.fr>
 License: public_domain
 
 Files: debian/tests/test-data/nc0225.aso.gz
-       debian/tests/test-data/dsRNA_viruses.ags.gz
+       debian/tests/test-data/dsRNA_viruses.*
 Copyright: 1996-2018 NCBI 
 License: public_domain
 Comment: 
  To dowload the files use:
     wget ftp://ftp.ncbi.nih.gov/ncbi-asn1/daily-nc/nc0225.aso.gz
     wget ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/ASN_BINARY/Viruses/dsRNA_viruses.ags.gz
+    wget ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/GENE_INFO/Viruses/dsRNA_viruses.gene_info.gz
 
 Files: debian/tests/test-data/trnascan-se_sample.output
 Comment:


=====================================
debian/source/include-binaries
=====================================
--- a/debian/source/include-binaries
+++ b/debian/source/include-binaries
@@ -1,2 +1,3 @@
 debian/tests/test-data/nc0225.aso.gz
 debian/tests/test-data/dsRNA_viruses.ags.gz
+debian/tests/test-data/dsRNA_viruses.gene_info.gz


=====================================
debian/tests/run-unit-test
=====================================
--- a/debian/tests/run-unit-test
+++ b/debian/tests/run-unit-test
@@ -58,16 +58,83 @@ echo '---asn2gb test---'
 gbk="$(grep -c "^LOCUS " nc0225.gbk)"
 [ $genes -eq $gbk ]
 
+##################################################################
+echo '---asn2xml test---'
+##################################################################
+/usr/bin/asn2xml -i nc0225.text -b F -o nc0225.xml
+[ -s nc0225.xml ]
+dna_xml="$(grep -c '<Seq-inst_mol value="dna"/>' nc0225.xml)"
+rna_xml="$(grep -c '<Seq-inst_mol value="rna"/>' nc0225.xml)"
+proteins_xml="$(grep -c '<Seq-inst_mol value="aa"/>' nc0225.xml)"
+[ $genes -eq $(expr $dna_xml + $rna_xml) ]
+[ $proteins -eq $proteins_xml ]
+
+##################################################################
+echo '---cleanasn test---'
+##################################################################
+/usr/bin/cleanasn -a t -D t -i nc0225.text -o nc0225_cleaned.text
+[ -s nc0225_cleaned.text ]
+titles="$(grep -c " title \"" nc0225.text)"
+titles_to_clean="$(grep -A 1 " descr {$" nc0225.text | grep -c " title \"")"
+titles_left="$(grep -c " title \"" nc0225_cleaned.text)"
+[ $(expr $titles - $titles_to_clean) -eq $titles_left ]
+
+##################################################################
+echo '---gene2xml test---'
+##################################################################
+/usr/bin/gene2xml -b -i dsRNA_viruses.ags -o dsRNA_viruses.xgs
+[ -s dsRNA_viruses.xgs ]
+# The content in dsRNA_viruses.gene_info mirrors the content in dsRNA_viruses.ags
+first_id="$(awk 'NR==2{print $1}' dsRNA_viruses.gene_info)"
+last_id="$(awk 'END{print $1}' dsRNA_viruses.gene_info)"
+# check the beginning of the output
+start_in="$(grep -c "^${first_id}" dsRNA_viruses.gene_info)"
+start_out="$(grep -c "<Object-id_id>${first_id}</Object-id_id>" dsRNA_viruses.xgs)"
+[ $start_in -eq $start_out ]
+#check the ending of the output
+end_in="$(grep -c "^${last_id}" dsRNA_viruses.gene_info)"
+end_out="$(grep -c "<Object-id_id>${last_id}</Object-id_id>" dsRNA_viruses.xgs)"
+[ $end_in -eq $end_out ]
+
+
+# _insdseqget_ and _idfetch_ testing requires internet connection.
+# Comment the lines below to skip the testing.
+grep 'GI:' nc0225.gbk | head | sed 's/.*GI://' > GIs.txt
+check_GI()
+{
+	while read GI; do
+		grep -q $GI $1
+	done < $2
+}
+##################################################################
+echo '---insdseqget test---'
+##################################################################
+/usr/bin/insdseqget -i GIs.txt > insdset.xml
+[ -s insdset.xml ]
+check_GI insdset.xml GIs.txt
+##################################################################
+echo '---idfetch test---'
+##################################################################
+/usr/bin/idfetch -G GIs.txt -o idfetch.text
+[ -s idfetch.text ]
+check_GI idfetch.text GIs.txt
+
+
+##################################################################
+echo '---vecscreen test---'
+##################################################################
+/usr/bin/vecscreen -f 3 < nc0225.fna > vecscreen.output
+[ -s vecscreen.output ]
+last_in="$(grep ">" nc0225.fna | tail -1 | sed 's/>//' | sed 's/ .*//')"
+last_out="$(grep ">" vecscreen.output | tail -1 | sed 's/>Vector //' | sed 's/ .*//')"
+[ $last_in==$last_out ]
+
 
 echo '---asn2idx test---'
 /usr/bin/asn2idx -p . -x .text < nc0225.text
 [ -s nc0225.idx ]
 [ -s master.idx ]
 
-echo '---asn2xml test---'
-/usr/bin/asn2xml -i nc0225.text -b F -o nc0225.xml
-[ -s nc0225.xml ]
-
 echo '---asndisc test---'
 /usr/bin/asndisc -i nc0225.text -a t -o nc0225.disc
 [ -s nc0225.disc ]
@@ -84,28 +151,10 @@ echo '---asntool test---'
 /usr/bin/asntool -m asnpub.all -v medline.ent -p asntool.output
 [ -s asntool.output ]
 
-echo '---cleanasn test---'
-/usr/bin/cleanasn -a t -D t -i nc0225.text -o nc0225_cleaned.text
-[ -s nc0225_cleaned.text ]
-
 echo '---debruijn test---'
 /usr/bin/debruijn -a ncbistdaa -n 4 > debruijn.output
 [ -s debruijn.output ]
 
-echo '---gene2xml test---'
-/usr/bin/gene2xml -b -i dsRNA_viruses.ags -o dsRNA_viruses.xgs
-[ -s dsRNA_viruses.xgs ]
-
-# _insdseqget_ and _idfetch_ testing requires internet connection.
-# Comment the lines below to skip the testing.
-grep 'GI:' nc0225.gbk | head | sed 's/.*GI://' > GIs.txt
-echo '---insdseqget test---'
-/usr/bin/insdseqget -n -i GIs.txt > insdset.xml
-[ -s insdset.xml ]
-echo '---idfetch test---'
-/usr/bin/idfetch -G GIs.txt -t 2 -o idfetch.aso
-[ -s idfetch.aso ]
-
 echo '---tbl2asn test---'
 /usr/bin/tbl2asn -t Sc_16.sbt -i Sc_16.fsa
 [ -s Sc_16.sqn ]
@@ -117,7 +166,3 @@ echo '---trna2tbl test---'
 /usr/bin/trna2tbl < trnascan-se_sample.output > trna2tbl.output
 [ -s trna2tbl.output ]
 
-echo '---vecscreen test---'
-/usr/bin/vecscreen -f 3 < nc0225.fna > vecscreen.output
-[ -s vecscreen.output ]
-


=====================================
debian/tests/test-data/dsRNA_viruses.gene_info.gz
=====================================
Binary files /dev/null and b/debian/tests/test-data/dsRNA_viruses.gene_info.gz differ


=====================================
debian/tests/test-data/trnascan-se_sample.output
=====================================
--- a/debian/tests/test-data/trnascan-se_sample.output
+++ b/debian/tests/test-data/trnascan-se_sample.output
@@ -1,4 +1,3 @@
-
 tRNAscan-SE v.2.0 (December 2017) - scan sequences for transfer RNAs
 Copyright (C) 2017 Patricia Chan and Todd Lowe
                    University of California Santa Cruz
@@ -7,7 +6,7 @@ Freely distributed under the GNU General Public License (GPLv3)
 ------------------------------------------------------------
 Sequence file(s) to search:        /usr/share/doc/trnascan-se/examples/Example1.fa
 Search Mode:                       Eukaryotic
-Results written to:                testrun.out
+Results written to:                trnascan-se_sample.output
 Output format:                     Tabular
 Searching with:                    Infernal First Pass->Infernal
 Isotype-specific model scan:       Yes



View it on GitLab: https://salsa.debian.org/med-team/ncbi-tools6/commit/d446096240ea9d4d7873deaea4b09cbb210bbf37

---
View it on GitLab: https://salsa.debian.org/med-team/ncbi-tools6/commit/d446096240ea9d4d7873deaea4b09cbb210bbf37
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debian-med-commit/attachments/20180410/ecef67df/attachment-0001.html>


More information about the debian-med-commit mailing list