2 # ## Bioperl Test Harness Script for Modules
8 test_begin(-tests => 99,
9 -requires_modules => [qw(IPC::Run)]);
11 use_ok('Bio::Tools::Run::Genemark');
12 use_ok('Bio::Root::IO');
16 my $verbose = test_debug();
17 my $model_dir = $ENV{'GENEMARK_MODELS'} if $ENV{'GENEMARK_MODELS'};
20 my $fasta_file = test_input_file('H_pylori_J99.fasta');
21 test_skip(-tests => 96,
22 -requires_env => 'GENEMARK_MODELS');
25 for my $mod (qw(Helicobacter_pylori_26695.mod Helicobacter_pylori.mod)) {
26 my $modpath = Bio::Root::IO->catfile($model_dir, 'Helicobacter_pylori_26695.mod');
28 $model_file = $modpath;
33 ok($model_file, "Found model file: $model_file");
35 skip('Test model file not found', 95) if !$model_file;
37 my $factory = Bio::Tools::Run::Genemark->new( -m => $model_file,
38 -program => 'gmhmmp');
39 test_skip(-tests => 95,
40 -requires_executable => $factory);
42 isa_ok $factory, 'Bio::Tools::Run::Genemark';
44 my $seqstream = Bio::SeqIO->new(-file => $fasta_file, -format => 'fasta');
45 my $seq = $seqstream->next_seq();
47 my $gmhmmp = $factory->run($seq);
48 isa_ok $gmhmmp,'Bio::Tools::Genemark';
50 my $first_gene = $gmhmmp->next_prediction();
51 isa_ok $first_gene, 'Bio::Tools::Prediction::Gene';
52 is $first_gene->seq_id(), 'gi|15611071|ref|NC_000921.1|';
55 # may fluctuate based on the model, stop after 91 checks
56 while (my $gene = $gmhmmp->next_prediction()) {
57 isa_ok $gene, 'Bio::Tools::Prediction::Gene';