6 test_begin(-tests => 24,
7 -requires_modules => [qw(Config::Any)]);
9 use_ok('Bio::Location::Atomic');
12 # setup input files etc
13 my $alignfilename = test_input_file('gumby', 'hmrd.mfa');
14 ok (-e $alignfilename, 'Found input alignment file');
17 test_skip(-requires_module => 'Bio::FeatureIO',
19 use_ok('Bio::Tools::Run::MCS');
20 use_ok('Bio::SeqFeature::Annotated');
21 my $factory = Bio::Tools::Run::MCS->new(-verbose => -1,
23 isa_ok($factory, 'Bio::Tools::Run::MCS');
24 ok $factory->can('neutral'), 'has a created method not in args supplied to new';
25 is $factory->quiet, 1, 'quiet was set';
27 # test default factory values
28 is ($factory->program_dir, $ENV{'MCSDIR'}, 'program_dir returned correct default');
29 is ($factory->program_name(), 'align2binomial.pl', 'Correct exe default name');
31 # test the program itself
33 test_skip(-requires_executable => $factory,
36 my $alignio = Bio::AlignIO->new(-file => $alignfilename);
37 my $align = $alignio->next_aln;
40 foreach my $data ([47367820, 47367830], [47367850, 47367860], [47367870, 47367880]) {
41 my $cds_feat = Bio::SeqFeature::Annotated->new(
42 -seq_id => 'Homo_sapiens',
50 push(@cds_feats, $cds_feat);
52 my $location = Bio::Location::Atomic->new(-start => 47367748, -end => 47427851, -strand => 1, -seq_id => 'chr1');
55 my @feats = $factory->run($align, $location, \@cds_feats);
57 # spot-test the results
58 my @spot_results = ($feats[0], $feats[1], $feats[2]);
59 foreach my $expected ([47373765, 47373846, 1000],
60 [47373848, 47373883, 1000],
61 [47377883, 47377908, 1000]) {
62 my $feat = shift(@spot_results);
63 isa_ok $feat, 'Bio::SeqFeature::Annotated';
64 is $feat->source->value, 'MCS', 'correct source';
65 is $feat->start, shift(@{$expected}), 'feature start correct';
66 is $feat->end, shift(@{$expected}), 'feature end correct';
67 is $feat->score, shift(@{$expected}), 'feature score correct';