5 test_begin(-tests => 91,
6 -requires_modules => [qw(Bio::Tools::Run::Cap3)]);
12 ok($assembler = Bio::Tools::Run::Cap3->new());
13 isa_ok($assembler, 'Bio::Tools::Run::Cap3');
15 ok($assembler->program_name('aaa'));
16 is($assembler->program_name, 'aaa');
18 ok($assembler->program_dir('/dir'));
19 is($assembler->program_dir, '/dir');
21 my @params = @Bio::Tools::Run::Cap3::program_params;
22 for my $param (@params) {
23 ok($assembler->$param(321));
24 is($assembler->$param(), 321);
27 my @switches = @Bio::Tools::Run::Cap3::program_switches;
28 for my $switch (@switches) {
29 ok($assembler->$switch(1));
30 is($assembler->$switch(), 1);
33 # test the program itself
34 my $program_name = $Bio::Tools::Run::Cap3::program_name;
35 ok($assembler->program_name($program_name));
37 test_skip(-requires_executable => $assembler,
41 my $result_file = 'results.ace';
42 my $fasta_file = test_input_file('sample_dataset_1.fa');
43 my $qual_file = test_input_file('sample_dataset_1.qual');
44 my $io = Bio::SeqIO->new( -file => $fasta_file, -format => 'fasta' );
46 while (my $seq = $io->next_seq) {
49 $io = Bio::SeqIO->new( -file => $qual_file, -format => 'qual' );
51 while (my $qual = $io->next_seq) {
52 push @qual_arr, $qual;
56 ok($assembler = Bio::Tools::Run::Cap3->new());
58 # Try FASTA or sequence object input
59 ok($asm = $assembler->run($fasta_file));
60 isa_ok($asm, 'Bio::Assembly::ScaffoldI');
61 is($asm->get_nof_singlets, 0);
62 is($asm->get_nof_contigs, 3);
64 ok($asm = $assembler->run(\@seq_arr));
65 isa_ok($asm, 'Bio::Assembly::ScaffoldI');
66 is($asm->get_nof_singlets, 0);
67 is($asm->get_nof_contigs, 3);
69 # Try optional quality score input as a QUAL file or bioperl objects
70 ok($asm = $assembler->run($fasta_file, $qual_file));
71 isa_ok($asm, 'Bio::Assembly::ScaffoldI');
72 is($asm->get_nof_singlets, 0);
73 is($asm->get_nof_contigs, 3);
75 ok($asm = $assembler->run(\@seq_arr, \@qual_arr));
76 isa_ok($asm, 'Bio::Assembly::ScaffoldI');
77 is($asm->get_nof_singlets, 0);
78 is($asm->get_nof_contigs, 3);
80 # Try the different output types
81 ok($assembler->out_type($result_file));
82 ok($asm = $assembler->run(\@seq_arr));
83 ok($asm eq $result_file);
87 ok($assembler->out_type('Bio::Assembly::IO'));
88 ok($asm = $assembler->run(\@seq_arr));
89 isa_ok($asm, 'Bio::Assembly::IO');
90 ok($asm->next_assembly);
92 ok($assembler->out_type('Bio::Assembly::ScaffoldI'));
93 ok($asm = $assembler->run(\@seq_arr));
94 isa_ok($asm, 'Bio::Assembly::ScaffoldI');
95 is($asm->get_nof_singlets, 0);
96 is($asm->get_nof_contigs, 3);
98 # Try some Cap3 specific parameters
99 ok($assembler->overlap_length_cutoff(1000));
100 ok($asm = $assembler->run(\@seq_arr));
101 is($asm->get_nof_singlets, 0);
102 is($asm->get_nof_contigs, 0);
104 ok($assembler->overlap_length_cutoff(21));
105 ok($assembler->overlap_identity_cutoff(100));
106 ok($asm = $assembler->run(\@seq_arr));
107 is($asm->get_nof_singlets, 0);
108 is($asm->get_nof_contigs, 0);
111 ok($assembler->minimum_overlap_similarity(100));
112 ok($assembler->minimum_overlap_length(20));