File: sim4.t

package info (click to toggle)
bioperl 1.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 50,136 kB
  • sloc: perl: 172,618; xml: 22,869; lisp: 2,034; sh: 1,984; makefile: 19
file content (182 lines) | stat: -rw-r--r-- 4,575 bytes parent folder | download | duplicates (5)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# -*-Perl-*- Test Harness script for Bioperl
# $Id: Sim4.t 11525 2007-06-27 10:16:38Z sendu $

use strict;
BEGIN {     
    use lib '.';
    use Bio::Root::Test;
    
    test_begin(-tests => 102);
	
	use_ok('Bio::SearchIO');
}

# parse align format 0
my $parser = Bio::SearchIO->new(-format => 'sim4',
			       -file   => test_input_file('crypto.sim4-0')
			       );
my $r = $parser->next_result;
is ($r->query_name, 'cn416');
is ($r->query_length, 630);

my $hit = $r->next_hit;
is ($hit->name, 'Contig147');
is ($hit->description, 'Contig147.fa');
is ($hit->length, 1086);

my $hsp = $hit->next_hsp;
is ($hsp->query->start, 36);
is ($hsp->query->end, 132);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 191);
is ($hsp->hit->end, 286);
is ($hsp->hit->strand, 1);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 133);
is ($hsp->query->end, 191);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 343);
is ($hsp->hit->end, 401);
is ($hsp->hit->strand, 1);

# parse align format 3
$parser = Bio::SearchIO->new(-format => 'sim4',
			    -file   => test_input_file('crypto.sim4-3')
			    );
$r = $parser->next_result;
is ($r->query_name, 'cn416');
is ($r->query_length, 630);
$hit = $r->next_hit;
is ($hit->name, 'Contig147');
is ($hit->description, 'Contig147.fa');
is ($hit->length, 1086);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 36);
is ($hsp->query->end, 132);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 191);
is ($hsp->hit->end, 286);
is ($hsp->hit->strand, 1);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 133);
is ($hsp->query->end, 191);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 343);
is ($hsp->hit->end, 401);
is ($hsp->hit->strand, 1);

# parse align format 4
$parser = Bio::SearchIO->new(-format => 'sim4',
			    -file   => test_input_file('crypto.sim4-4')
			    );
$r = $parser->next_result;
is ($r->query_name, 'cn416');
is ($r->query_length, 630);

$hit = $r->next_hit;
is ($hit->name, 'Contig147');
is ($hit->length, 1086);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 36);
is ($hsp->query->end, 132);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 191);
is ($hsp->hit->end, 286);
is ($hsp->hit->strand, 1);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 133);
is ($hsp->query->end, 191);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 343);
is ($hsp->hit->end, 401);
is ($hsp->hit->strand, 1);


# do the other sim4 files
$parser = Bio::SearchIO->new(-format => 'sim4',
			    -file   => test_input_file('sim4.rev')
			    );
$r = $parser->next_result;
is ($r->query_name, '/nfs/disk21/birney/prog/wise2/example/human.rev');
is ($r->query_length, 5368);
$hit = $r->next_hit;
is ($hit->name, 'HSHNCPA1');
is ($hit->description, 'temp.cdna');
is ($hit->length, 1198);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 486);
is ($hsp->query->end, 503);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 10);
is ($hsp->hit->end, 27);
is ($hsp->hit->strand, -1);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 1048);
is ($hsp->query->end, 1117);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 194);
is ($hsp->hit->end, 265);
is ($hsp->hit->strand, -1);

# do the other sim4 files fwd
$parser = Bio::SearchIO->new(-format => 'sim4',
			    -file   => test_input_file('sim4.for.for')
			    );
$r = $parser->next_result;
is ($r->query_name, 'human.genomic');
is ($r->query_length, 5368);
$hit = $r->next_hit;
is ($hit->name, 'hs_est');
is ($hit->description, 'est.for');
is ($hit->length, 479);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 695);
is ($hsp->query->end, 813);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 1);
is ($hsp->hit->end, 119);
is ($hsp->hit->strand, 1);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 1377);
is ($hsp->query->end, 1500);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 120);
is ($hsp->hit->end, 243);
is ($hsp->hit->strand, 1);

# do the other sim4 files fwd rev
$parser = Bio::SearchIO->new(-format => 'sim4',
			    -file   => test_input_file('sim4.for.rev')
			    );
$r = $parser->next_result;
is ($r->query_name, 'human.genomic');
is ($r->query_length, 5368);
$hit = $r->next_hit;
is ($hit->name, 'REVCOMP');
is ($hit->description, 'hn_est.rev');
is ($hit->length, 479);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 695);
is ($hsp->query->end, 813);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 1);
is ($hsp->hit->end, 119);
is ($hsp->hit->strand, -1);

$hsp = $hit->next_hsp;
is ($hsp->query->start, 1377);
is ($hsp->query->end, 1500);
is ($hsp->query->strand, 1);
is ($hsp->hit->start, 120);
is ($hsp->hit->end, 243);
is ($hsp->hit->strand, -1);