diff options
author | Liubov Chuprikova <chuprikovalv@gmail.com> | 2018-04-10 16:41:12 +0000 |
---|---|---|
committer | Liubov Chuprikova <chuprikovalv@gmail.com> | 2018-04-10 16:44:16 +0000 |
commit | d446096240ea9d4d7873deaea4b09cbb210bbf37 (patch) | |
tree | e7fab4e1f88fa209090ea14d6f074dc8178276d5 | |
parent | 6576aed1e8963efbf350b53b881fa5f6413887d3 (diff) |
Autopkgtest: continue to improve tests by checking its output content
-rw-r--r-- | debian/copyright | 3 | ||||
-rw-r--r-- | debian/source/include-binaries | 1 | ||||
-rw-r--r-- | debian/tests/run-unit-test | 97 | ||||
-rw-r--r-- | debian/tests/test-data/dsRNA_viruses.gene_info.gz | bin | 0 -> 28072 bytes | |||
-rw-r--r-- | debian/tests/test-data/trnascan-se_sample.output | 3 |
5 files changed, 75 insertions, 29 deletions
diff --git a/debian/copyright b/debian/copyright index 965d32cc..62bef252 100644 --- a/debian/copyright +++ b/debian/copyright @@ -14,13 +14,14 @@ Copyright: 1998-1999 Stephane Bortzmeyer <bortzmeyer@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: diff --git a/debian/source/include-binaries b/debian/source/include-binaries index b9c78645..c1b701fa 100644 --- 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 diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test index e16056c9..bac8eac4 100644 --- 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 ] - diff --git a/debian/tests/test-data/dsRNA_viruses.gene_info.gz b/debian/tests/test-data/dsRNA_viruses.gene_info.gz Binary files differnew file mode 100644 index 00000000..649cad09 --- /dev/null +++ b/debian/tests/test-data/dsRNA_viruses.gene_info.gz diff --git a/debian/tests/test-data/trnascan-se_sample.output b/debian/tests/test-data/trnascan-se_sample.output index fb2ff4e7..d4aa35c0 100644 --- 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 |