9.5. Quality Assurance Tests

QA tests for seqret are defined in the file:

.../emboss/emboss/test/qatest.dat

The test data for the application is given under the /test directory and consists of input files, application parameters and the corresponding output files.

You'll see from inspecting the file that many tests are defined for the application, testing it under all sorts of input conditions in order to be as robust as possible. These are performed frequently to ensure the applications work as advertised and are not broken by (e.g.) recent changes to the library code.

Quality assurance testing, including how to write entries in qatest.dat, is covered in detail elsewhere (Chapter 7, Quality Assurance).

Test 1. This test extracts an entry from a database and write it to a file:

ID seqret-ex1
UC Extract an entry from a database and write it to a file: 
AP seqret
IN tembl:x65923
IN
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI x65923.fasta
FP /X65923/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_1.dat seqret-ex1
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 2. This test reads all entries in the database tembl that start with ab and write them to a file. In this example the specification is all done on the command line. To stop Unix getting confused by the * character, it has a backslash (\) before it:

ID seqret-ex2
UC Display the contents of the sequence on the screen:
AP seqret
IN tembl:x65923
IN stdout
FI stdout
FP /X65923/
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_2.dat seqret-ex2
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 3. seqret does not read in features by default as this results in slightly faster performance. If, however, you wish to read in features with your sequence and also write them out then using -feature will change the default behaviour. Note EMBL format is used for the output file. The default FASTA format would report the features in GFF format (file seqname.gff):

ID seqret-ex3
UC Write the result in GCG format by using the qualifier '-osformat'.
AP seqret
CL -osf gcg
IN tembl:x65923
IN
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI x65923.gcg
FP /X65923/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_3.dat seqret-ex3
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 4. Display the contents of the sequence on the screen:

ID seqret-ex4
UC Write the result in GCG format by specifying the format
UC in the output USA on the command line.
AP seqret
CL -outseq gcg::x65923.gcg
IN tembl:x65923
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI x65923.gcg
FP /X65923/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_4.dat seqret-ex4
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 5. Write the result in GCG format by using the qualifier -osformat:

ID seqret-ex5
UC Write the result in GCG format by specifying the format
UC in the output USA at the prompt.
AP seqret
IN tembl:x65923
IN gcg::x65923.gcg
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI x65923.gcg
FP /X65923/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_5.dat seqret-ex5
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 6. Write the result in GCG format by specifying the format in the output USA on the command line.

ID seqret-ex6
UC Write the reverse-complement of a sequence:
AP seqret
CL -srev
IN tembl:x65923
IN
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI x65923.fasta
FP /X65923/

The command line session is below:

% qatest.pl -simple -testfile=seqret_6.dat seqret-ex6
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 7. Write the result in GCG format by specifying the format in the output USA at the prompt.

ID seqret-ex7
UC Extract the bases between the positions starting at 5 and ending at 25:
AP seqret
CL -sbegin 5 -send 25
IN tembl:x65923
IN 
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI x65923.fasta
FP /X65923/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_7.dat seqret-ex7
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 8. Write the reverse complement of a sequence:

ID seqret-ex8
UC Extract the bases between the positions starting at 5
UC and ending at 5 bases before the end of the sequence:
AP seqret
CL -sbegin 5 -send -5
IN tembl:x65923
IN 
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI x65923.fasta
FP /X65923/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_8.dat seqret-ex8
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 9. Extract the bases between the positions starting at 5 and ending at 25:

ID seqret-ex9
UC Read all entries in the database 'tembl' that start with 'h'
UC and write them to a file:
AP seqret
IN tembl:h*
IN hall.seq
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI hall.seq
FP /H45989/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_9.dat seqret-ex9
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 10. Extract the bases between the positions starting at 5 and ending at 5 bases before the end of the sequence:

ID seqret-ex10
UC Read all entries in the database 'tembl' that start with 'ab'
UC and write them to a file.
UC In this example the specification is all done in the command line
UC and to stop Unix getting confused by the '*' character,
UC it has to have a backslash ('\') before it:
AP seqret
CL 'tembl:ab*'  aball.seq
FI stderr
FC = 1
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI aball.seq
FP /^>AB000095/
FP 4 /^>/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_10.dat seqret-ex10
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds

Test 11. Read all entries in the database tembl that start with h and write them to a file:

ID seqret-ex11
UC seqret does not read in features by default because this results in
UC slightly faster performance.  If however you wish to read in features
UC with your sequence and write them out on output, using '-feature' will
UC change the default behaviour to use any features present in the sequence. 
UC N.B. use embl format for the output file as the default format 'fasta'
UC reports the features in gff (file "<seqname>.gff")
AP seqret
CL -feature
IN tembl:x65923
IN embl::x65923.embl
FI stderr
FC = 2
FP 0 /Warning: /
FP 0 /Error: /
FP 0 /Died: /
FI x65923.embl
FP /X65923/
//

The command line session is below:

% qatest.pl -simple -testfile=seqret_11.dat seqret-ex11
Tests total: 1 pass: 1 fail: 0
Time: 0 seconds