Commit d4460962 authored by Liubov Chuprikova's avatar Liubov Chuprikova
Browse files

Autopkgtest: continue to improve tests by checking its output content

parent 6576aed1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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:
+1 −0
Original line number Diff line number Diff line
debian/tests/test-data/nc0225.aso.gz
debian/tests/test-data/dsRNA_viruses.ags.gz
debian/tests/test-data/dsRNA_viruses.gene_info.gz
+71 −26
Original line number Diff line number Diff line
@@ -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 ]
+27.4 KiB

File added.

No diff preview for this file type.

+1 −2
Original line number Diff line number Diff line

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