1 # -*-Perl-*- Test Harness script for Bioperl
6 # this script simply tests parsing ace* files
7 # - it cares nothing about the chromat_dir,phd_dir,edit_dir types of things
17 test_begin(-tests => 15);
19 use_ok('Bio::Tools::Alignment::Consed');
22 my $DEBUG = test_debug();
24 # scope some variables
25 my($o_consed,@singlets,@singletons,@pairs,@doublets,@multiplets,$invoker);
27 # instantiate a new object
28 my $passed_in_acefile = test_input_file('acefile.ace.1');
29 $o_consed = Bio::Tools::Alignment::Consed->new(-acefile => $passed_in_acefile);
30 ok defined $o_consed, 'new CSM::Consed object was created';
32 $o_consed->verbose($DEBUG);
34 isa_ok($o_consed,'Bio::Tools::Alignment::Consed');
36 isnt($o_consed->set_singlets(), 1, 'singlets can be successfully set');
38 @singlets = $o_consed->get_singlets();
39 is (scalar(@singlets), 65, 'singlets can be retrieved');
41 isnt ($o_consed->set_doublets(), 1, 'doublets can be set');
43 ok @doublets = $o_consed->get_doublets(), 'doublets can be retreived';
45 print(scalar(@doublets)." doublets were found\n") if ($DEBUG > 0);
46 is (scalar(@doublets), 45, 'doublets can be retrieved');
48 @pairs = $o_consed->get_pairs();
49 is (scalar(@pairs),1, 'pairs can be retrieved');
51 @multiplets = $o_consed->get_multiplets();
52 is (scalar(@multiplets), 4, 'multiplets can be retrieved');
54 @singletons = $o_consed->get_singletons();
55 is (scalar(@singletons), 3, 'singletons can be retrieved');
56 my($total_object_sequences, $total_grep_sequences);
57 is($total_grep_sequences = $o_consed->count_sequences_with_grep(), 179, 'how many sequences there are in the acefile _and_ in the singlets file');
59 is($total_object_sequences = $o_consed->sum_lets("total_only"),179, 'statistics from the Bio::Tools::Alignment::Consed object to compare the total number of sequences accounted for there to the number of sequences found via grep');
60 print("Match?\n") if($DEBUG > 0) ;
61 is ($total_object_sequences, $total_grep_sequences);
63 print("These are the statistics. Look right? ".$o_consed->sum_lets()."\n") if($DEBUG > 0);
64 is($o_consed->sum_lets(),'Singt/singn/doub/pair/mult/total : 65,3,45(90),1(2),4(19),179');
66 print("Dumping out the hash in a compact way...\n")if($DEBUG > 0) ;
67 $o_consed->dump_hash_compact() if($DEBUG > 0) ;
69 # print("Dumping out the hash in an ugly way...\n");
70 # $o_consed->dump_hash();
75 isa_ok $a, 'Bio::Variation::Allele';
77 is $a->accession_number(), 'X677667';
78 is $a->seq(), 'ACTGACTGACTG';
79 is $a->display_id(),'new-id' ;
80 is $a->desc, 'Sample Bio::Seq object';
81 is $a->moltype(), 'dna';
83 ok defined($trunc = $a->trunc(1,4));
84 is $trunc->seq(), 'ACTG', "Expecting ACTG. Got ". $trunc->seq();
86 ok defined($rev = $a->revcom());
87 is $rev->seq(), 'CAGTCAGTCAGT';
92 $a->repeat_unit('ACTG');
93 is $a->repeat_unit, 'ACTG';
96 is $a->repeat_count, 3;