[BUG] bug 2598
[bioperl-live.git] / t / sequencetrace.t
blob4320e46d5f4dcade4d7476eb25014df8dba9b55b
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {
7         use lib 't/lib';
8     use BioperlTest;
9     
10     test_begin(-tests => 5);
11         
12         use_ok('Bio::SeqIO');
15 my $debug = test_debug();
17 my $in_scf_v3 = Bio::SeqIO->new('-file' => test_input_file('version3.scf'),
18                     '-format' => 'scf');
20 my $trace = $in_scf_v3->next_seq();
22 my $start = $trace->length()-19;
23 my $end = $trace->length();
25 is ($trace->subseq($trace->length()-19,$trace->length()), "CCCCTTTCCCAACAGCACCG");
27 my $qualstring = join(' ',@{$trace->subqual($start,$end)});
28 is ($qualstring, "12 10 7 7 9 7 7 9 13 9 9 9 6 6 6 8 8 8 6 6");
30 my $ref = $trace->sub_peak_index($start,$end);
31 my @temp = @{$ref};
33 my $indices_at_end = join(' ',@{$trace->sub_peak_index($start,$end)});
34 is($indices_at_end, "13863 13874 13883 13898 13905 13922 13934 13952 13966 13975 13982 14003 14013 14026 14037 14056 14061 14084 14093 14099");
36 my $trace_end = $trace->trace_length();
37 my $trace_start = $trace_end - 19;
38 my $subtrace_a = join(' ',@{$trace->sub_trace('a',$trace_start,$trace_end)});
39 is $subtrace_a, "63 61 68 82 101 120 135 145 148 143 131 111 85 59 37 18 4 0 3 6";
42 # whew! now given a subset of bases, get their traces....
43 my $traces2 = $trace->sub_trace_object(1,5);
44 $traces2->verbose(-1);
46 $traces2->_synthesize_traces();
48 $traces2->set_accuracies();
50 if ($debug) {
51         print("This is an scf dump:\n");
52         $traces2->scf_dump();