1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 26,
10 -requires_modules => [qw(IO::String
12 -requires_networking => 1);
14 use_ok('Bio::PrimarySeq');
15 use_ok('Bio::Tools::Analysis::Protein::Domcut');
18 my $verbose = test_debug();
20 ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);
23 ######## test using PrimarySeq object ##############
24 my $seq = Bio::PrimarySeq->new(-seq => 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQPPPPPPPPPPPPPDQRS',
25 -display_id => 'test2');
27 ok $tool = Bio::Tools::Analysis::Protein::Domcut->new( -seq=>$seq);
29 if ($tool->status eq 'TERMINATED_BY_ERROR') {
30 skip('Problem with DomCut run, check status', 21);
33 ok my $raw = $tool->result('');
34 ok my $parsed = $tool->result('parsed');
35 is ($parsed->[23]{'score'}, '-0.209');
36 my @res = $tool->result('Bio::SeqFeatureI');
37 if (scalar @res > 0) {
40 skip('No network access - could not connect to Domcut server', 18);
42 ok my $meta = $tool->result('meta');
45 test_skip(-tests => 2, -requires_module => 'Bio::Seq::Meta::Array');
46 is($meta->named_submeta_text('Domcut', 1,2), "0.068 0.053");
47 is ($meta->seq, "MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQPPPPPPPPPPPPPDQRS");
50 ########## test using Bio::Seq object ##############
51 ok my $tool2 = Bio::WebAgent->new(-verbose =>$verbose);
53 ok my $seq2 = Bio::Seq->new(-seq => 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS',
54 -display_id => 'test2');
56 ok $tool2 = Bio::Tools::Analysis::Protein::Domcut->new( -seq=>$seq2->primary_seq);
59 @res = $tool2->result('Bio::SeqFeatureI');
61 if (scalar @res > 0) {
64 skip('No network access - could not connect to Domcut server', 10);
67 ok my $parsed2 = $tool2->result('parsed');
68 is ($parsed2->[23]{'score'}, '-0.209');
70 ok my $meta2 = $tool2->result('meta');
72 is($meta2->named_submeta_text('Domcut', 1,2), "0.068 0.053");
73 is ($meta2->seq, "MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS");
75 ok my $seq4 = Bio::Seq->new();
76 ok $seq2->primary_seq($meta2);
78 ok $seq2->add_SeqFeature($_);
80 ok $seq2->primary_seq->named_submeta_text('Domcut', 1,2);