File: qual.t

package info (click to toggle)
bioperl 1.7.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 35,788 kB
  • sloc: perl: 94,019; xml: 14,811; makefile: 20
file content (59 lines) | stat: -rw-r--r-- 1,399 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*-Perl-*- Test Harness script for Bioperl
# $Id$

use strict;

BEGIN {
    use Bio::Root::Test;
    
    test_begin(-tests => 18);
	
	use_ok('Bio::SeqIO');
	use_ok('Bio::Seq::PrimaryQual');
}

my $DEBUG = test_debug();

my $in_qual  = Bio::SeqIO->new('-file' => test_input_file('qualfile.qual'),
			       '-format' => 'qual');
ok($in_qual);

my @quals;

my $first = 1;
while ( my $qual = $in_qual->next_seq() ) {
		# ::dumpValue($qual);
	isa_ok($qual, 'Bio::Seq::PrimaryQual');
    @quals = @{$qual->qual()};
    if( $DEBUG ) {
	warn($qual->id()."\n");
	
	warn("(".scalar(@quals).") quality values.\n");
    }
    if( $first ) { 
		is(@quals, 484);
    }
    $first = 0;
}

# in October 2004, Carlos Mauricio La Rota posted a problem with descriptions
# this routine is to test that

@quals = 10..20;
# this one has a forced header
my $seq = Bio::Seq::PrimaryQual->new(
                    -qual =>   \@quals,
                    -header   =>   "Hank is a good cat. I gave him a bath yesterday.");
my $out = Bio::SeqIO->new(-file  =>   ">".test_output_file(),
                         -format   =>   'qual');
# yes, that works
is $seq->header, 'Hank is a good cat. I gave him a bath yesterday.';
@quals = @{$seq->qual()};
is scalar(@quals), 11;
ok $out->write_seq($seq);
$seq->header('');
is $seq->header, '';
$seq->id('Hank1');
is $seq->id, 'Hank1';
# yes, that works
ok $out->write_seq($seq);