1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 26,
11 -requires_modules => [qw(IO::String
13 -requires_networking => 1);
15 use_ok('Bio::PrimarySeq');
16 use_ok('Bio::Tools::Analysis::Protein::Domcut');
19 my $verbose = test_debug();
21 ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);
24 ######## test using PrimarySeq object ##############
25 my $seq = Bio::PrimarySeq->new(-seq => 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQPPPPPPPPPPPPPDQRS',
26 -display_id => 'test2');
28 ok $tool = Bio::Tools::Analysis::Protein::Domcut->new( -seq=>$seq);
30 if ($tool->status eq 'TERMINATED_BY_ERROR') {
31 skip('Problem with DomCut run, check status', 21);
34 ok my $raw = $tool->result('');
35 ok my $parsed = $tool->result('parsed');
36 is ($parsed->[23]{'score'}, '-0.209');
37 my @res = $tool->result('Bio::SeqFeatureI');
38 if (scalar @res > 0) {
41 skip('No network access - could not connect to Domcut server', 18);
43 ok my $meta = $tool->result('meta');
46 test_skip(-tests => 2, -requires_module => 'Bio::Seq::Meta::Array');
47 is($meta->named_submeta_text('Domcut', 1,2), "0.068 0.053");
48 is ($meta->seq, "MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQPPPPPPPPPPPPPDQRS");
51 ########## test using Bio::Seq object ##############
52 ok my $tool2 = Bio::WebAgent->new(-verbose =>$verbose);
54 ok my $seq2 = Bio::Seq->new(-seq => 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS',
55 -display_id => 'test2');
57 ok $tool2 = Bio::Tools::Analysis::Protein::Domcut->new( -seq=>$seq2->primary_seq);
60 @res = $tool2->result('Bio::SeqFeatureI');
62 if (scalar @res > 0) {
65 skip('No network access - could not connect to Domcut server', 10);
68 ok my $parsed2 = $tool2->result('parsed');
69 is ($parsed2->[23]{'score'}, '-0.209');
71 ok my $meta2 = $tool2->result('meta');
73 is($meta2->named_submeta_text('Domcut', 1,2), "0.068 0.053");
74 is ($meta2->seq, "MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS");
76 ok my $seq4 = Bio::Seq->new();
77 ok $seq2->primary_seq($meta2);
78 ok $seq2->add_SeqFeature(@res);
79 ok $seq2->primary_seq->named_submeta_text('Domcut', 1,2);