File: Domcut.t

package info (click to toggle)
bioperl 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 40,768 kB
  • ctags: 12,005
  • sloc: perl: 174,299; xml: 13,923; sh: 1,941; lisp: 1,803; asm: 109; makefile: 53
file content (80 lines) | stat: -rw-r--r-- 2,350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -*-Perl-*- Test Harness script for Bioperl
# $Id: Domcut.t 15112 2008-12-08 18:12:38Z sendu $

use strict;

BEGIN {
	use lib '.';
	use Bio::Root::Test;
	
	test_begin(-tests => 26,
			   -requires_modules => [qw(IO::String
									    LWP::UserAgent)],
			   -requires_networking => 1);
	
	use_ok('Bio::PrimarySeq');
	use_ok('Bio::Tools::Analysis::Protein::Domcut');
}

my $verbose = test_debug();

ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);

SKIP: {
	######## test using PrimarySeq object ##############
	my $seq = Bio::PrimarySeq->new(-seq        => 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQPPPPPPPPPPPPPDQRS',
								   -display_id => 'test2');
	
	ok $tool = Bio::Tools::Analysis::Protein::Domcut->new( -seq=>$seq);
	ok $tool->run ();
	if ($tool->status eq 'TERMINATED_BY_ERROR') {
		skip('Problem with DomCut run, check status', 21);
	}
	
	ok my $raw    = $tool->result('');
	ok my $parsed = $tool->result('parsed');
	is ($parsed->[23]{'score'}, '-0.209');
	my @res       = $tool->result('Bio::SeqFeatureI');
	if (scalar @res > 0) {
		ok 1;
	} else {
		skip('No network access - could not connect to Domcut server', 18);
	}
	ok my $meta = $tool->result('meta');
	
	SKIP: {
		test_skip(-tests => 2, -requires_module => 'Bio::Seq::Meta::Array');
		is($meta->named_submeta_text('Domcut', 1,2), "0.068 0.053");
		is ($meta->seq, "MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQPPPPPPPPPPPPPDQRS");
	}
	
	########## test using Bio::Seq object ##############
	ok my $tool2 = Bio::WebAgent->new(-verbose =>$verbose);
	
	ok my $seq2  = Bio::Seq->new(-seq => 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS',
				 -display_id => 'test2');
	
	ok $tool2 = Bio::Tools::Analysis::Protein::Domcut->new( -seq=>$seq2->primary_seq);
	ok $tool2->run ();
	
	@res = $tool2->result('Bio::SeqFeatureI');
	
	if (scalar @res > 0) {
		ok 1;
	} else {
		skip('No network access - could not connect to Domcut server', 10);
	}
	
	ok my $parsed2 = $tool2->result('parsed');
	is ($parsed2->[23]{'score'}, '-0.209');
	
	ok my $meta2 = $tool2->result('meta');
	
	is($meta2->named_submeta_text('Domcut', 1,2), "0.068 0.053");
	is ($meta2->seq, "MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS");
	
	ok my $seq4 = Bio::Seq->new();
	ok $seq2->primary_seq($meta2);
	ok $seq2->add_SeqFeature(@res);
	ok $seq2->primary_seq->named_submeta_text('Domcut', 1,2);
}