line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# BioPerl module for Bio::Map::Physical |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Please direct questions and support issues to |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Cared for by Sendu Bala |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright AGCoL |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# You may distribute this module under the same terms as perl itself |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# POD documentation - main docs before the code |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Bio::Map::Physical - A class for handling a Physical Map (such as FPC) |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Bio::MapIO; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# accquire a Bio::Map::Physical using Bio::MapIO::fpc |
23
|
|
|
|
|
|
|
my $mapio = Bio::MapIO->new(-format => "fpc",-file => "rice.fpc", |
24
|
|
|
|
|
|
|
-readcor => 0); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $physical = $mapio->next_map(); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# get all the markers ids |
29
|
|
|
|
|
|
|
foreach my $marker ( $physical->each_markerid() ) { |
30
|
|
|
|
|
|
|
print "Marker $marker\n"; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# acquire the marker object using Bio::Map::FPCMarker |
33
|
|
|
|
|
|
|
my $markerobj = $physical->get_markerobj($marker); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# get all the clones hit by this marker |
36
|
|
|
|
|
|
|
foreach my $clone ($markerobj->each_cloneid() ) { |
37
|
|
|
|
|
|
|
print " +++$clone\n"; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This class is basically a continer class for a collection of Contig maps and |
44
|
|
|
|
|
|
|
other physical map information. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Bio::Map::Physical has been tailored to work for FPC physical maps, but |
47
|
|
|
|
|
|
|
could probably be used for others as well (with the appropriate MapIO |
48
|
|
|
|
|
|
|
module). |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This class also has some methods with specific functionalities: |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
print_gffstyle() : Generates GFF; either Contigwise[Default] or |
53
|
|
|
|
|
|
|
Groupwise |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
print_contiglist() : Prints the list of Contigs, markers that hit the |
56
|
|
|
|
|
|
|
contig, the global position and whether the marker |
57
|
|
|
|
|
|
|
is a placement ( ) or a Framework () marker. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
print_markerlist() : Prints the markers list; contig and corresponding |
60
|
|
|
|
|
|
|
number of clones. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
matching_bands() : Given two clones [and tolerence], this method |
63
|
|
|
|
|
|
|
calculates how many matching bands do they have. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
coincidence_score() : Given two clones [,tolerence and gellen], this |
66
|
|
|
|
|
|
|
method calculates the Sulston Coincidence score. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
For faster access and better optimization, the data is stored internally in |
69
|
|
|
|
|
|
|
hashes. The corresponding objects are created on request. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 FEEDBACK |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 Mailing Lists |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
User feedback is an integral part of the evolution of this and other |
76
|
|
|
|
|
|
|
Bioperl modules. Send your comments and suggestions preferably to |
77
|
|
|
|
|
|
|
the Bioperl mailing list. Your participation is much appreciated. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
80
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 Support |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
I |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
rather than to the module maintainer directly. Many experienced and |
89
|
|
|
|
|
|
|
reponsive experts will be able look at the problem and quickly |
90
|
|
|
|
|
|
|
address it. Please include a thorough description of the problem |
91
|
|
|
|
|
|
|
with code and data examples if at all possible. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 Reporting Bugs |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Report bugs to the Bioperl bug tracking system to help us keep track |
96
|
|
|
|
|
|
|
of the bugs and their resolution. Bug reports can be submitted via the |
97
|
|
|
|
|
|
|
web: |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 AUTHOR - Gaurav Gupta |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Email gaurav@genome.arizona.edu |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 CONTRIBUTORS |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Sendu Bala bix@sendu.me.uk |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 PROJECT LEADERS |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Jamie Hatfield jamie@genome.arizona.edu |
112
|
|
|
|
|
|
|
Dr. Cari Soderlund cari@genome.arizona.edu |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 PROJECT DESCRIPTION |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
The project was done in Arizona Genomics Computational Laboratory (AGCoL) |
117
|
|
|
|
|
|
|
at University of Arizona. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This work was funded by USDA-IFAFS grant #11180 titled "Web Resources for |
120
|
|
|
|
|
|
|
the Computation and Display of Physical Mapping Data". |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
For more information on this project, please refer: |
123
|
|
|
|
|
|
|
http://www.genome.arizona.edu |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 APPENDIX |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
The rest of the documentation details each of the object methods. |
128
|
|
|
|
|
|
|
Internal methods are usually preceded with a _ |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=cut |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
# Let the code begin... |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
package Bio::Map::Physical; |
135
|
2
|
|
|
2
|
|
532
|
use vars qw($MAPCOUNT); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
88
|
|
136
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
30
|
|
137
|
2
|
|
|
2
|
|
410
|
use POSIX; |
|
2
|
|
|
|
|
4350
|
|
|
2
|
|
|
|
|
8
|
|
138
|
|
|
|
|
|
|
|
139
|
2
|
|
|
2
|
|
3632
|
use Bio::Map::Clone; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
53
|
|
140
|
2
|
|
|
2
|
|
601
|
use Bio::Map::Contig; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
50
|
|
141
|
2
|
|
|
2
|
|
608
|
use Bio::Map::FPCMarker; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
66
|
|
142
|
|
|
|
|
|
|
|
143
|
2
|
|
|
2
|
|
9
|
use base qw(Bio::Map::SimpleMap); |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
132
|
|
144
|
2
|
|
|
2
|
|
8388
|
BEGIN { $MAPCOUNT = 1; } |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 Access Methods |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
These methods let you get and set the member variables |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head2 version |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Title : version |
153
|
|
|
|
|
|
|
Usage : my $version = $map->version(); |
154
|
|
|
|
|
|
|
Function: Get/set the version of the program used to |
155
|
|
|
|
|
|
|
generate this map |
156
|
|
|
|
|
|
|
Returns : scalar representing the version |
157
|
|
|
|
|
|
|
Args : none to get, OR string to set |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=cut |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
sub version { |
162
|
9
|
|
|
9
|
1
|
12
|
my ($self,$value) = @_; |
163
|
9
|
100
|
|
|
|
19
|
if (defined($value)) { |
164
|
3
|
|
|
|
|
10
|
$self->{'_version'} = $value; |
165
|
|
|
|
|
|
|
} |
166
|
9
|
|
|
|
|
38
|
return $self->{'_version'}; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head2 modification_user |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Title : modification_user |
172
|
|
|
|
|
|
|
Usage : my $modification_user = $map->modification_user(); |
173
|
|
|
|
|
|
|
Function: Get/set the name of the user who last modified this map |
174
|
|
|
|
|
|
|
Returns : scalar representing the username |
175
|
|
|
|
|
|
|
Args : none to get, OR string to set |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=cut |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
sub modification_user { |
180
|
5
|
|
|
5
|
1
|
9
|
my ($self,$value) = @_; |
181
|
5
|
100
|
|
|
|
15
|
if (defined($value)) { |
182
|
3
|
|
|
|
|
6
|
$self->{'_modification_user'} = $value; |
183
|
|
|
|
|
|
|
} |
184
|
5
|
|
|
|
|
22
|
return $self->{'_modification_user'}; |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head2 group_type |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
Title : group_type |
190
|
|
|
|
|
|
|
Usage : $map->group_type($grptype); |
191
|
|
|
|
|
|
|
my $grptype = $map->group_type(); |
192
|
|
|
|
|
|
|
Function: Get/set the group type of this map |
193
|
|
|
|
|
|
|
Returns : scalar representing the group type |
194
|
|
|
|
|
|
|
Args : none to get, OR string to set |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=cut |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub group_type { |
199
|
55
|
|
|
55
|
1
|
53
|
my ($self,$value) = @_; |
200
|
55
|
100
|
|
|
|
74
|
if (defined($value)) { |
201
|
3
|
|
|
|
|
8
|
$self->{'_grouptype'} = $value; |
202
|
|
|
|
|
|
|
} |
203
|
55
|
|
|
|
|
86
|
return $self->{'_grouptype'}; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head2 group_abbr |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Title : group_abbr |
209
|
|
|
|
|
|
|
Usage : $map->group_abbr($grpabbr); |
210
|
|
|
|
|
|
|
my $grpabbr = $map->group_abbr(); |
211
|
|
|
|
|
|
|
Function: get/set the group abbrev of this map |
212
|
|
|
|
|
|
|
Returns : string representing the group abbrev |
213
|
|
|
|
|
|
|
Args : none to get, OR string to set |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=cut |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub group_abbr { |
218
|
10
|
|
|
10
|
1
|
16
|
my ($self,$value) = @_; |
219
|
10
|
100
|
|
|
|
22
|
if (defined($value)) { |
220
|
3
|
|
|
|
|
5
|
$self->{'_groupabbr'} = $value; |
221
|
|
|
|
|
|
|
} |
222
|
10
|
|
|
|
|
32
|
return $self->{'_groupabbr'}; |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=head2 core_exists |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
Title : core_exists |
228
|
|
|
|
|
|
|
Usage : my $core_exists = $map->core_exists(); |
229
|
|
|
|
|
|
|
Function: Get/set if the FPC file is accompanied by COR file |
230
|
|
|
|
|
|
|
Returns : boolean |
231
|
|
|
|
|
|
|
Args : none to get, OR 1|0 to set |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=cut |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
sub core_exists { |
236
|
983
|
|
|
983
|
1
|
818
|
my ($self,$value) = @_; |
237
|
983
|
100
|
|
|
|
1229
|
if (defined($value)) { |
238
|
4
|
100
|
|
|
|
10
|
$self->{'_corexists'} = $value ? 1 : 0; |
239
|
|
|
|
|
|
|
} |
240
|
983
|
|
|
|
|
1637
|
return $self->{'_corexists'}; |
241
|
|
|
|
|
|
|
} |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=head2 each_cloneid |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
Title : each_cloneid |
246
|
|
|
|
|
|
|
Usage : my @clones = $map->each_cloneid(); |
247
|
|
|
|
|
|
|
Function: returns an array of clone names |
248
|
|
|
|
|
|
|
Returns : list of clone names |
249
|
|
|
|
|
|
|
Args : none |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=cut |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub each_cloneid { |
254
|
2
|
|
|
2
|
1
|
387
|
my ($self) = @_; |
255
|
2
|
|
|
|
|
3
|
return keys %{$self->{'_clones'}}; |
|
2
|
|
|
|
|
115
|
|
256
|
|
|
|
|
|
|
} |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=head2 get_cloneobj |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
Title : get_cloneobj |
261
|
|
|
|
|
|
|
Usage : my $cloneobj = $map->get_cloneobj('CLONEA'); |
262
|
|
|
|
|
|
|
Function: returns an object of the clone given in the argument |
263
|
|
|
|
|
|
|
Returns : object of the clone |
264
|
|
|
|
|
|
|
Args : scalar representing the clone name |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=cut |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
sub get_cloneobj { |
269
|
355
|
|
|
355
|
1
|
1041
|
my ($self,$clone) = @_; |
270
|
|
|
|
|
|
|
|
271
|
355
|
50
|
|
|
|
482
|
return 0 if(!defined($clone)); |
272
|
355
|
50
|
|
|
|
460
|
return if($clone eq ""); |
273
|
355
|
50
|
|
|
|
506
|
return if(!exists($self->{'_clones'}{$clone})); |
274
|
|
|
|
|
|
|
|
275
|
355
|
|
|
|
|
245
|
my ($type,$contig,$bands,$gel,$group,$remark,$fp_number); |
276
|
0
|
|
|
|
|
0
|
my ($sequence_type,$sequence_status,$fpc_remark,@amatch,@pmatch,@ematch, |
277
|
|
|
|
|
|
|
$startrange,$endrange); |
278
|
355
|
|
|
|
|
241
|
my %clones = %{$self->{'_clones'}{$clone}}; |
|
355
|
|
|
|
|
1586
|
|
279
|
355
|
|
|
|
|
333
|
my @markers; |
280
|
|
|
|
|
|
|
|
281
|
355
|
50
|
|
|
|
517
|
if (ref($clones{'clone'}) eq 'Bio::Map::Clone') { |
282
|
0
|
|
|
|
|
0
|
return $clones{'clone'}; |
283
|
|
|
|
|
|
|
} |
284
|
|
|
|
|
|
|
|
285
|
355
|
50
|
|
|
|
509
|
$type = $clones{'type'} if (exists($clones{'type'})); |
286
|
355
|
100
|
|
|
|
414
|
@markers = (keys %{$clones{'markers'}}) if (exists($clones{'markers'})); |
|
42
|
|
|
|
|
91
|
|
287
|
355
|
50
|
|
|
|
483
|
$contig = $clones{'contig'} if (exists($clones{'contig'})); |
288
|
355
|
50
|
|
|
|
493
|
$bands = $clones{'bands'} if (exists($clones{'bands'})); |
289
|
355
|
50
|
|
|
|
454
|
$gel = $clones{'gel'} if (exists($clones{'gel'})); |
290
|
355
|
50
|
|
|
|
437
|
$group = $clones{'group'} if (exists($clones{'group'})); |
291
|
355
|
100
|
|
|
|
420
|
$remark = $clones{'remark'} if (exists($clones{'remark'})); |
292
|
|
|
|
|
|
|
|
293
|
355
|
50
|
|
|
|
424
|
$fp_number = $clones{'fp_number'} if (exists($clones{'fp_number'})); |
294
|
355
|
100
|
|
|
|
387
|
$fpc_remark = $clones{'fpc_remark'} if (exists($clones{'fpc_remark'})); |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
$sequence_type = $clones{'sequence_type'} |
297
|
355
|
100
|
|
|
|
421
|
if (exists($clones{'sequence_type'})); |
298
|
|
|
|
|
|
|
$sequence_status = $clones{'sequence_status'} |
299
|
355
|
100
|
|
|
|
402
|
if (exists($clones{'sequence_status'} )); |
300
|
|
|
|
|
|
|
|
301
|
355
|
100
|
|
|
|
414
|
@amatch = (keys %{$clones{'matcha'}}) if (exists($clones{'matcha'})); |
|
102
|
|
|
|
|
203
|
|
302
|
355
|
100
|
|
|
|
425
|
@ematch = (keys %{$clones{'matche'}}) if (exists($clones{'matche'})); |
|
74
|
|
|
|
|
168
|
|
303
|
355
|
50
|
|
|
|
434
|
@pmatch = (keys %{$clones{'matchp'}}) if (exists($clones{'matchp'})); |
|
0
|
|
|
|
|
0
|
|
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
$startrange = $clones{'range'}{'start'} |
306
|
355
|
50
|
|
|
|
561
|
if (exists($clones{'range'}{'start'})); |
307
|
|
|
|
|
|
|
$endrange = $clones{'range'}{'end'} |
308
|
355
|
50
|
|
|
|
491
|
if (exists($clones{'range'}{'end'})); |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
#*** why doesn't it call Bio::Map::Clone->new ? Seems dangerous... |
311
|
355
|
|
|
|
|
1074
|
my $cloneobj = bless( { |
312
|
|
|
|
|
|
|
_name => $clone, |
313
|
|
|
|
|
|
|
_markers => \@markers, |
314
|
|
|
|
|
|
|
_contig => $contig, |
315
|
|
|
|
|
|
|
_type => $type, |
316
|
|
|
|
|
|
|
_bands => $bands, |
317
|
|
|
|
|
|
|
_gel => $gel, |
318
|
|
|
|
|
|
|
_group => $group, |
319
|
|
|
|
|
|
|
_remark => $remark, |
320
|
|
|
|
|
|
|
_fpnumber => $fp_number, |
321
|
|
|
|
|
|
|
_sequencetype => $sequence_type, |
322
|
|
|
|
|
|
|
_sequencestatus => $sequence_status, |
323
|
|
|
|
|
|
|
_fpcremark => $fpc_remark, |
324
|
|
|
|
|
|
|
_matche => \@ematch, |
325
|
|
|
|
|
|
|
_matcha => \@amatch, |
326
|
|
|
|
|
|
|
_matchp => \@pmatch, |
327
|
|
|
|
|
|
|
_range => Bio::Range->new(-start => $startrange, |
328
|
|
|
|
|
|
|
-end => $endrange), |
329
|
|
|
|
|
|
|
}, 'Bio::Map::Clone'); |
330
|
|
|
|
|
|
|
|
331
|
355
|
|
|
|
|
587
|
$self->{'_clones'}{$clone}{'clone'} = $cloneobj; |
332
|
355
|
|
|
|
|
765
|
return $cloneobj; |
333
|
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
=head2 each_markerid |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
Title : each_markerid |
338
|
|
|
|
|
|
|
Usage : my @markers = $map->each_markerid(); |
339
|
|
|
|
|
|
|
Function: returns list of marker names |
340
|
|
|
|
|
|
|
Returns : list of marker names |
341
|
|
|
|
|
|
|
Args : none |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
=cut |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
sub each_markerid { |
346
|
4
|
|
|
4
|
1
|
6
|
my ($self) = @_; |
347
|
4
|
|
|
|
|
6
|
return keys (%{$self->{'_markers'}}); |
|
4
|
|
|
|
|
45
|
|
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=head2 get_markerobj |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
Title : get_markerobj |
353
|
|
|
|
|
|
|
Usage : my $markerobj = $map->get_markerobj('MARKERA'); |
354
|
|
|
|
|
|
|
Function: returns an object of the marker given in the argument |
355
|
|
|
|
|
|
|
Returns : object of the marker |
356
|
|
|
|
|
|
|
Args : scalar representing the marker name |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=cut |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
sub get_markerobj { |
361
|
15
|
|
|
15
|
1
|
50
|
my ($self,$marker) = @_; |
362
|
|
|
|
|
|
|
|
363
|
15
|
50
|
|
|
|
18
|
return 0 if(!defined($marker)); |
364
|
15
|
50
|
|
|
|
19
|
return if($marker eq ""); |
365
|
15
|
50
|
|
|
|
23
|
return if(!exists($self->{'_markers'}{$marker})); |
366
|
|
|
|
|
|
|
|
367
|
15
|
|
|
|
|
8
|
my ($global,$framework,$group,$anchor,$remark,$type,$linkage,$subgroup); |
368
|
15
|
|
|
|
|
12
|
my %mkr = %{$self->{'_markers'}{$marker}}; |
|
15
|
|
|
|
|
115
|
|
369
|
|
|
|
|
|
|
|
370
|
15
|
50
|
|
|
|
27
|
return $mkr{'marker'} if (ref($mkr{'marker'}) eq 'Bio::Map::FPCMarker'); |
371
|
|
|
|
|
|
|
|
372
|
15
|
50
|
|
|
|
24
|
$type = $mkr{'type'} if(exists($mkr{'type'})); |
373
|
15
|
50
|
|
|
|
20
|
$global = $mkr{'global'} if(exists($mkr{'global'} )); |
374
|
15
|
100
|
|
|
|
17
|
$framework = $mkr{'framework'} if(exists($mkr{'framework'})); |
375
|
15
|
50
|
|
|
|
21
|
$anchor = $mkr{'anchor'} if(exists($mkr{'anchor'})); |
376
|
15
|
50
|
|
|
|
20
|
$group = $mkr{'group'} if(exists($mkr{'group'})); |
377
|
15
|
100
|
|
|
|
17
|
$subgroup = $mkr{'subgroup'} if(exists($mkr{'subgroup'})); |
378
|
15
|
50
|
|
|
|
21
|
$remark = $mkr{'remark'} if(exists($mkr{'remark'})); |
379
|
|
|
|
|
|
|
|
380
|
15
|
|
|
|
|
9
|
my %clones = %{$mkr{'clones'}}; |
|
15
|
|
|
|
|
42
|
|
381
|
15
|
|
|
|
|
12
|
my %contigs = %{$mkr{'contigs'}}; |
|
15
|
|
|
|
|
28
|
|
382
|
|
|
|
|
|
|
|
383
|
15
|
50
|
|
|
|
20
|
my %markerpos = %{$mkr{'posincontig'}} if(exists($mkr{'posincontig'})); |
|
15
|
|
|
|
|
24
|
|
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
#*** why doesn't it call Bio::Map::FPCMarker->new ? Seems dangerous... |
386
|
15
|
|
|
|
|
107
|
my $markerobj = bless( { |
387
|
|
|
|
|
|
|
_name => $marker, |
388
|
|
|
|
|
|
|
_type => $type, |
389
|
|
|
|
|
|
|
_global => $global, |
390
|
|
|
|
|
|
|
_frame => $framework, |
391
|
|
|
|
|
|
|
_group => $group, |
392
|
|
|
|
|
|
|
_subgroup => $subgroup, |
393
|
|
|
|
|
|
|
_anchor => $anchor, |
394
|
|
|
|
|
|
|
_remark => $remark, |
395
|
|
|
|
|
|
|
_clones => \%clones, |
396
|
|
|
|
|
|
|
_contigs => \%contigs, |
397
|
|
|
|
|
|
|
_position => \%markerpos, |
398
|
|
|
|
|
|
|
}, 'Bio::Map::FPCMarker'); |
399
|
|
|
|
|
|
|
|
400
|
15
|
|
|
|
|
18
|
$self->{'_markers'}{$marker}{'marker'} = $markerobj; |
401
|
15
|
|
|
|
|
33
|
return $markerobj; |
402
|
|
|
|
|
|
|
} |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
=head2 each_contigid |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
Title : each_contigid |
407
|
|
|
|
|
|
|
Usage : my @contigs = $map->each_contigid(); |
408
|
|
|
|
|
|
|
Function: returns a list of contigs (numbers) |
409
|
|
|
|
|
|
|
Returns : list of contigs |
410
|
|
|
|
|
|
|
Args : none |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
=cut |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
sub each_contigid { |
415
|
19
|
|
|
19
|
1
|
646
|
my ($self) = @_; |
416
|
19
|
|
|
|
|
16
|
return keys (%{$self->{'_contigs'}}); |
|
19
|
|
|
|
|
56
|
|
417
|
|
|
|
|
|
|
} |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
=head2 get_contigobj |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
Title : get_contigobj |
422
|
|
|
|
|
|
|
Usage : my $contigobj = $map->get_contigobj('CONTIG1'); |
423
|
|
|
|
|
|
|
Function: returns an object of the contig given in the argument |
424
|
|
|
|
|
|
|
Returns : object of the contig |
425
|
|
|
|
|
|
|
Args : scalar representing the contig number |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
=cut |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
sub get_contigobj { |
430
|
11
|
|
|
11
|
1
|
33
|
my ($self,$contig) = @_; |
431
|
|
|
|
|
|
|
|
432
|
11
|
50
|
|
|
|
16
|
return 0 if(!defined($contig)); |
433
|
11
|
50
|
|
|
|
20
|
return if($contig eq ""); |
434
|
11
|
50
|
|
|
|
16
|
return if(!exists($self->{'_contigs'}{$contig})); |
435
|
|
|
|
|
|
|
|
436
|
11
|
|
|
|
|
9
|
my ($group,$anchor,$uremark,$tremark,$cremark,$startrange,$endrange, |
437
|
|
|
|
|
|
|
$linkage,$subgroup); |
438
|
11
|
|
|
|
|
9
|
my %ctg = %{$self->{'_contigs'}{$contig}}; |
|
11
|
|
|
|
|
53
|
|
439
|
11
|
|
|
|
|
11
|
my (%position, %pos); |
440
|
|
|
|
|
|
|
|
441
|
11
|
50
|
|
|
|
18
|
return $ctg{'contig'} if (ref($ctg{'contig'}) eq 'Bio::Map::Contig'); |
442
|
|
|
|
|
|
|
|
443
|
11
|
50
|
|
|
|
17
|
$group = $ctg{'group'} if (exists($ctg{'group'})); |
444
|
11
|
100
|
|
|
|
13
|
$subgroup = $ctg{'subgroup'} if (exists($ctg{'subgroup'})); |
445
|
11
|
50
|
|
|
|
17
|
$anchor = $ctg{'anchor'} if (exists($ctg{'anchor'})); |
446
|
11
|
100
|
|
|
|
15
|
$cremark = $ctg{'chr_remark'} if (exists($ctg{'chr_remark'})); |
447
|
11
|
100
|
|
|
|
14
|
$uremark = $ctg{'usr_remark'} if (exists($ctg{'usr_remark'})); |
448
|
11
|
100
|
|
|
|
13
|
$tremark = $ctg{'trace_remark'} if (exists($ctg{'trace_remark'})); |
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
$startrange = $ctg{'range'}{'start'} |
451
|
11
|
50
|
|
|
|
18
|
if (exists($ctg{'range'}{'start'})); |
452
|
|
|
|
|
|
|
$endrange = $ctg{'range'}{'end'} |
453
|
11
|
50
|
|
|
|
20
|
if (exists($ctg{'range'}{'end'})); |
454
|
|
|
|
|
|
|
|
455
|
11
|
50
|
|
|
|
13
|
my %clones = %{$ctg{'clones'}} if (exists($ctg{'clones'})); |
|
11
|
|
|
|
|
202
|
|
456
|
11
|
100
|
|
|
|
27
|
my %markers = %{$ctg{'markers'}} if (exists($ctg{'markers'})); |
|
8
|
|
|
|
|
23
|
|
457
|
|
|
|
|
|
|
|
458
|
11
|
|
|
|
|
10
|
my $pos = $ctg{'position'}; |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
#*** why doesn't it call Bio::Map::Contig->new ? Seems dangerous... |
461
|
11
|
|
|
|
|
35
|
my $contigobj = bless( { |
462
|
|
|
|
|
|
|
_group => $group, |
463
|
|
|
|
|
|
|
_subgroup => $subgroup, |
464
|
|
|
|
|
|
|
_anchor => $anchor, |
465
|
|
|
|
|
|
|
_markers => \%markers, |
466
|
|
|
|
|
|
|
_clones => \%clones, |
467
|
|
|
|
|
|
|
_name => $contig, |
468
|
|
|
|
|
|
|
_cremark => $cremark, |
469
|
|
|
|
|
|
|
_uremark => $uremark, |
470
|
|
|
|
|
|
|
_tremark => $tremark, |
471
|
|
|
|
|
|
|
_position => $pos, |
472
|
|
|
|
|
|
|
_range => Bio::Range->new(-start => $startrange, |
473
|
|
|
|
|
|
|
-end => $endrange), |
474
|
|
|
|
|
|
|
}, 'Bio::Map::Contig'); |
475
|
|
|
|
|
|
|
|
476
|
11
|
|
|
|
|
19
|
$self->{'_contigs'}{$contig}{'contig'} = $contigobj; |
477
|
11
|
|
|
|
|
25
|
return $contigobj; |
478
|
|
|
|
|
|
|
} |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
=head2 matching_bands |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
Title : matching_bands |
483
|
|
|
|
|
|
|
Usage : $self->matching_bands('cloneA','cloneB',[$tol]); |
484
|
|
|
|
|
|
|
Function: given two clones [and tolerence], this method calculates how many |
485
|
|
|
|
|
|
|
matching bands do they have. |
486
|
|
|
|
|
|
|
(this method is ported directly from FPC) |
487
|
|
|
|
|
|
|
Returns : scalar representing the number of matching bands |
488
|
|
|
|
|
|
|
Args : names of the clones ('cloneA', 'cloneB') [Default tolerence=7] |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
=cut |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
sub matching_bands { |
493
|
0
|
|
|
0
|
1
|
0
|
my($self,$cloneA,$cloneB,$tol) = @_; |
494
|
0
|
|
|
|
|
0
|
my($lstart,$kband,$match,$diff,$i,$j); |
495
|
|
|
|
|
|
|
|
496
|
0
|
0
|
0
|
|
|
0
|
return 0 if(!defined($cloneA) || !defined($cloneB) || |
|
|
|
0
|
|
|
|
|
497
|
|
|
|
|
|
|
!($self->core_exists())); |
498
|
|
|
|
|
|
|
|
499
|
0
|
0
|
|
|
|
0
|
$tol = 7 if (!defined($tol)); |
500
|
|
|
|
|
|
|
|
501
|
0
|
|
|
|
|
0
|
my %_clones = %{$self->{'_clones'}}; |
|
0
|
|
|
|
|
0
|
|
502
|
|
|
|
|
|
|
|
503
|
0
|
|
|
|
|
0
|
my @bandsA = @{$_clones{$cloneA}{'bands'}}; |
|
0
|
|
|
|
|
0
|
|
504
|
0
|
|
|
|
|
0
|
my @bandsB = @{$_clones{$cloneB}{'bands'}}; |
|
0
|
|
|
|
|
0
|
|
505
|
|
|
|
|
|
|
|
506
|
0
|
|
|
|
|
0
|
$match = 0; |
507
|
0
|
|
|
|
|
0
|
$lstart = 0; |
508
|
|
|
|
|
|
|
|
509
|
0
|
|
|
|
|
0
|
for ($i=0; $i
|
510
|
0
|
|
|
|
|
0
|
$kband = $bandsA[$i]; |
511
|
0
|
|
|
|
|
0
|
for ($j = $lstart; $j
|
512
|
0
|
|
|
|
|
0
|
$diff = $kband - $bandsB[$j]; |
513
|
0
|
0
|
|
|
|
0
|
if (abs($diff) <= $tol ) { |
|
|
0
|
|
|
|
|
|
514
|
0
|
|
|
|
|
0
|
$match++; |
515
|
0
|
|
|
|
|
0
|
$lstart = $j+1; |
516
|
0
|
|
|
|
|
0
|
last; |
517
|
|
|
|
|
|
|
} |
518
|
|
|
|
|
|
|
elsif ($diff < 0) { |
519
|
0
|
|
|
|
|
0
|
$lstart = $j; |
520
|
0
|
|
|
|
|
0
|
last; |
521
|
|
|
|
|
|
|
} |
522
|
|
|
|
|
|
|
} |
523
|
|
|
|
|
|
|
} |
524
|
0
|
|
|
|
|
0
|
return $match; |
525
|
|
|
|
|
|
|
} |
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
=head2 coincidence_score |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
Title : coincidence_score |
530
|
|
|
|
|
|
|
Usage : $self->coincidence_score('cloneA','cloneB'[,$tol,$gellen]); |
531
|
|
|
|
|
|
|
Function: given two clones [,tolerence and gellen], this method calculates |
532
|
|
|
|
|
|
|
the Sulston Coincidence score. |
533
|
|
|
|
|
|
|
(this method is ported directly from FPC) |
534
|
|
|
|
|
|
|
Returns : scalar representing the Sulston coincidence score. |
535
|
|
|
|
|
|
|
Args : names of the clones ('cloneA', 'cloneB') |
536
|
|
|
|
|
|
|
[Default tol=7 gellen=3300.0] |
537
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
=cut |
539
|
|
|
|
|
|
|
|
540
|
|
|
|
|
|
|
sub coincidence_score { |
541
|
0
|
|
|
0
|
1
|
0
|
my($self,$cloneA,$cloneB,$tol,$gellen) = @_; |
542
|
|
|
|
|
|
|
|
543
|
0
|
0
|
0
|
|
|
0
|
return 0 if(!defined($cloneA) || !defined($cloneB) || |
|
|
|
0
|
|
|
|
|
544
|
|
|
|
|
|
|
!($self->core_exists())); |
545
|
|
|
|
|
|
|
|
546
|
0
|
|
|
|
|
0
|
my %_clones = %{$self->{'_clones'}}; |
|
0
|
|
|
|
|
0
|
|
547
|
|
|
|
|
|
|
|
548
|
0
|
|
|
|
|
0
|
my $numbandsA = scalar(@{$_clones{$cloneA}{'bands'}}); |
|
0
|
|
|
|
|
0
|
|
549
|
0
|
|
|
|
|
0
|
my $numbandsB = scalar(@{$_clones{$cloneB}{'bands'}}); |
|
0
|
|
|
|
|
0
|
|
550
|
|
|
|
|
|
|
|
551
|
0
|
|
|
|
|
0
|
my ($nL,$nH,$m,$i,$psmn,$pp,$pa,$pb,$t,$c,$a,$n); |
552
|
0
|
|
|
|
|
0
|
my @logfact; |
553
|
0
|
|
|
|
|
0
|
my $score; |
554
|
|
|
|
|
|
|
|
555
|
0
|
0
|
|
|
|
0
|
$gellen = 3300.0 if (!defined($gellen)); |
556
|
0
|
0
|
|
|
|
0
|
$tol = 7 if (!defined($tol)); |
557
|
|
|
|
|
|
|
|
558
|
0
|
0
|
|
|
|
0
|
if ($numbandsA > $numbandsB) { |
559
|
0
|
|
|
|
|
0
|
$nH = $numbandsA; |
560
|
0
|
|
|
|
|
0
|
$nL = $numbandsB; |
561
|
|
|
|
|
|
|
} |
562
|
|
|
|
|
|
|
else { |
563
|
0
|
|
|
|
|
0
|
$nH = $numbandsB; |
564
|
0
|
|
|
|
|
0
|
$nL = $numbandsA; |
565
|
|
|
|
|
|
|
} |
566
|
|
|
|
|
|
|
|
567
|
0
|
|
|
|
|
0
|
$m = $self->matching_bands($cloneA, $cloneB,$tol); |
568
|
|
|
|
|
|
|
|
569
|
0
|
|
|
|
|
0
|
$logfact[0] = 0.0; |
570
|
0
|
|
|
|
|
0
|
$logfact[1] = 0.0; |
571
|
0
|
|
|
|
|
0
|
for ($i=2; $i<=$nL; $i++) { |
572
|
0
|
|
|
|
|
0
|
$logfact[$i] = $logfact[$i - 1] + log($i); |
573
|
|
|
|
|
|
|
} |
574
|
|
|
|
|
|
|
|
575
|
0
|
|
|
|
|
0
|
$psmn = 1.0 - ((2*$tol)/$gellen); |
576
|
|
|
|
|
|
|
|
577
|
0
|
|
|
|
|
0
|
$pp = $psmn ** $nH; |
578
|
0
|
|
|
|
|
0
|
$pa = log($pp); |
579
|
0
|
|
|
|
|
0
|
$pb = log(1 - $pp); |
580
|
0
|
|
|
|
|
0
|
$t = 1e-37; |
581
|
|
|
|
|
|
|
|
582
|
0
|
|
|
|
|
0
|
for ($n = $m; $n <= $nL; $n++) { |
583
|
0
|
|
|
|
|
0
|
$c = $logfact[$nL] - $logfact[$nL - $n] - $logfact[$n]; |
584
|
0
|
|
|
|
|
0
|
$a = exp($c + ($n * $pb) + (($nL - $n) * $pa)); |
585
|
0
|
|
|
|
|
0
|
$t += $a; |
586
|
|
|
|
|
|
|
} |
587
|
|
|
|
|
|
|
|
588
|
0
|
|
|
|
|
0
|
$score = sprintf("%.e",$t); |
589
|
0
|
|
|
|
|
0
|
return $score; |
590
|
|
|
|
|
|
|
} |
591
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
=head2 print_contiglist |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
Title : print_contiglist |
595
|
|
|
|
|
|
|
Usage : $map->print_contiglist([showall]); #[Default 0] |
596
|
|
|
|
|
|
|
Function: prints the list of contigs, markers that hit the contig, the |
597
|
|
|
|
|
|
|
global position and whether the marker is a placement (P) or |
598
|
|
|
|
|
|
|
a Framework (F) marker. |
599
|
|
|
|
|
|
|
Returns : none |
600
|
|
|
|
|
|
|
Args : [showall] [Default 0], 1 includes all the discrepant markers |
601
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
=cut |
603
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
sub print_contiglist{ |
605
|
0
|
|
|
0
|
1
|
0
|
my ($self,$showall) = @_; |
606
|
0
|
|
|
|
|
0
|
my $pos; |
607
|
|
|
|
|
|
|
|
608
|
0
|
0
|
|
|
|
0
|
$showall = 0 if (!defined($showall)); |
609
|
0
|
|
|
|
|
0
|
my %_contigs = %{$self->{'_contigs'}}; |
|
0
|
|
|
|
|
0
|
|
610
|
0
|
|
|
|
|
0
|
my %_markers = %{$self->{'_markers'}}; |
|
0
|
|
|
|
|
0
|
|
611
|
0
|
|
|
|
|
0
|
my %_clones = %{$self->{'_clones'}}; |
|
0
|
|
|
|
|
0
|
|
612
|
|
|
|
|
|
|
|
613
|
0
|
|
|
|
|
0
|
my @contigs = $self->each_contigid(); |
614
|
0
|
|
|
|
|
0
|
my @sortedcontigs = sort {$a <=> $b } @contigs; |
|
0
|
|
|
|
|
0
|
|
615
|
|
|
|
|
|
|
|
616
|
0
|
|
|
|
|
0
|
print "\n\nContig List\n\n"; |
617
|
0
|
|
|
|
|
0
|
foreach my $contig (@sortedcontigs) { |
618
|
0
|
|
|
|
|
0
|
my %list; |
619
|
|
|
|
|
|
|
my %alist; |
620
|
|
|
|
|
|
|
|
621
|
0
|
|
|
|
|
0
|
my $ctgAnchor = $_contigs{$contig}{'anchor'}; |
622
|
0
|
|
|
|
|
0
|
my $ctgGroup = $_contigs{$contig}{'group'}; |
623
|
|
|
|
|
|
|
|
624
|
0
|
|
|
|
|
0
|
my @mkr = keys ( %{$_contigs{$contig}{'markers'}} ); |
|
0
|
|
|
|
|
0
|
|
625
|
|
|
|
|
|
|
|
626
|
0
|
|
|
|
|
0
|
foreach my $marker (@mkr) { |
627
|
0
|
|
|
|
|
0
|
my $mrkGroup = $_markers{$marker}{'group'}; |
628
|
0
|
|
|
|
|
0
|
my $mrkGlobal = $_markers{$marker}{'global'}; |
629
|
0
|
|
|
|
|
0
|
my $mrkFramework = $_markers{$marker}{'framework'}; |
630
|
0
|
|
|
|
|
0
|
my $mrkAnchor = $_markers{$marker}{'anchor'}; |
631
|
|
|
|
|
|
|
|
632
|
0
|
0
|
0
|
|
|
0
|
if($ctgGroup =~ /\d+|\w/ && $ctgGroup != 0) { |
|
|
0
|
0
|
|
|
|
|
633
|
0
|
0
|
|
|
|
0
|
if ($mrkGroup eq $ctgGroup) { |
|
|
0
|
|
|
|
|
|
634
|
0
|
0
|
|
|
|
0
|
if ($mrkFramework == 0) { |
635
|
0
|
|
|
|
|
0
|
$pos = $mrkGlobal."P"; |
636
|
|
|
|
|
|
|
} |
637
|
|
|
|
|
|
|
else { |
638
|
0
|
|
|
|
|
0
|
$pos = $mrkGlobal."F"; |
639
|
|
|
|
|
|
|
} |
640
|
0
|
|
|
|
|
0
|
$list{$marker} = $pos; |
641
|
|
|
|
|
|
|
} |
642
|
|
|
|
|
|
|
elsif ($showall == 1) { |
643
|
0
|
|
|
|
|
0
|
my $chr = $self->group_abbr().$mrkGroup; |
644
|
0
|
|
|
|
|
0
|
$alist{$marker} = $chr; |
645
|
|
|
|
|
|
|
} |
646
|
|
|
|
|
|
|
} |
647
|
|
|
|
|
|
|
elsif ($showall == 1 && $ctgGroup !~ /\d+/) { |
648
|
0
|
|
|
|
|
0
|
my $chr = $self->group_abbr().$mrkGroup; |
649
|
0
|
|
|
|
|
0
|
$alist{$marker} = $chr; |
650
|
|
|
|
|
|
|
} |
651
|
|
|
|
|
|
|
} |
652
|
|
|
|
|
|
|
|
653
|
0
|
|
|
|
|
0
|
my $chr = $ctgGroup; |
654
|
0
|
0
|
|
|
|
0
|
$chr = $self->group_abbr().$ctgGroup if ($ctgGroup =~ /\d+|\w/); |
655
|
|
|
|
|
|
|
|
656
|
0
|
0
|
0
|
|
|
0
|
if ($showall == 1 ) { |
|
|
0
|
|
|
|
|
|
657
|
|
|
|
|
|
|
|
658
|
|
|
|
|
|
|
print " ctg$contig ", $chr, " " |
659
|
0
|
0
|
|
|
|
0
|
if ($_contigs{$contig}{'group'} !~ /\d+|\w/); |
660
|
|
|
|
|
|
|
} |
661
|
|
|
|
|
|
|
elsif ($ctgGroup =~ /\d+|\w/ && $ctgGroup ne 0){ |
662
|
0
|
|
|
|
|
0
|
print " ctg",$contig, " ",$chr, " "; |
663
|
|
|
|
|
|
|
} |
664
|
|
|
|
|
|
|
|
665
|
0
|
|
|
|
|
0
|
while (my ($k,$v) = each %list) { |
666
|
0
|
|
|
|
|
0
|
print "$k/$v "; |
667
|
|
|
|
|
|
|
} |
668
|
|
|
|
|
|
|
|
669
|
0
|
0
|
0
|
|
|
0
|
print "\n" if ($showall == 0 && $ctgGroup =~ /\d+|\w/ && |
|
|
|
0
|
|
|
|
|
670
|
|
|
|
|
|
|
$ctgGroup ne 0 ); |
671
|
|
|
|
|
|
|
|
672
|
0
|
0
|
|
|
|
0
|
if ($showall == 1) { |
673
|
0
|
|
|
|
|
0
|
while (my ($k,$v) = each %alist) { |
674
|
0
|
|
|
|
|
0
|
print "$k/$v "; |
675
|
|
|
|
|
|
|
} |
676
|
0
|
|
|
|
|
0
|
print "\n"; |
677
|
|
|
|
|
|
|
} |
678
|
|
|
|
|
|
|
} |
679
|
|
|
|
|
|
|
} |
680
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
=head2 print_markerlist |
682
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
Title : print_markerlist |
684
|
|
|
|
|
|
|
Usage : $map->print_markerlist(); |
685
|
|
|
|
|
|
|
Function : prints the marker list; contig and corresponding number of |
686
|
|
|
|
|
|
|
clones for each marker. |
687
|
|
|
|
|
|
|
Returns : none |
688
|
|
|
|
|
|
|
Args : none |
689
|
|
|
|
|
|
|
|
690
|
|
|
|
|
|
|
=cut |
691
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
sub print_markerlist { |
693
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
694
|
|
|
|
|
|
|
|
695
|
0
|
|
|
|
|
0
|
my %_contigs = %{$self->{'_contigs'}}; |
|
0
|
|
|
|
|
0
|
|
696
|
0
|
|
|
|
|
0
|
my %_markers = %{$self->{'_markers'}}; |
|
0
|
|
|
|
|
0
|
|
697
|
0
|
|
|
|
|
0
|
my %_clones = %{$self->{'_clones'}}; |
|
0
|
|
|
|
|
0
|
|
698
|
|
|
|
|
|
|
|
699
|
0
|
|
|
|
|
0
|
print "Marker List\n\n"; |
700
|
|
|
|
|
|
|
|
701
|
0
|
|
|
|
|
0
|
foreach my $marker ($self->each_markerid()) { |
702
|
0
|
|
|
|
|
0
|
print " ",$marker, " "; |
703
|
|
|
|
|
|
|
|
704
|
0
|
|
|
|
|
0
|
my %list; |
705
|
0
|
|
|
|
|
0
|
my %mclones = %{$_markers{$marker}{'clones'}}; |
|
0
|
|
|
|
|
0
|
|
706
|
|
|
|
|
|
|
|
707
|
0
|
|
|
|
|
0
|
foreach my $clone (%mclones) { |
708
|
0
|
0
|
|
|
|
0
|
if (exists($_clones{$clone}{'contig'}) ) { |
709
|
0
|
|
|
|
|
0
|
my $ctg = $_clones{$clone}{'contig'}; |
710
|
|
|
|
|
|
|
|
711
|
0
|
0
|
|
|
|
0
|
if (exists($list{$ctg})) { |
712
|
0
|
|
|
|
|
0
|
my $clonehits = $list{$ctg}; |
713
|
0
|
|
|
|
|
0
|
$clonehits++; |
714
|
0
|
|
|
|
|
0
|
$list{$ctg} = $clonehits; |
715
|
|
|
|
|
|
|
} |
716
|
|
|
|
|
|
|
else { |
717
|
0
|
|
|
|
|
0
|
$list{$ctg} = 1; |
718
|
|
|
|
|
|
|
} |
719
|
|
|
|
|
|
|
} |
720
|
|
|
|
|
|
|
} |
721
|
0
|
|
|
|
|
0
|
while (my ($k,$v) = each %list) { |
722
|
0
|
|
|
|
|
0
|
print "$k/$v "; |
723
|
|
|
|
|
|
|
} |
724
|
0
|
|
|
|
|
0
|
print "\n"; |
725
|
|
|
|
|
|
|
} |
726
|
|
|
|
|
|
|
} |
727
|
|
|
|
|
|
|
|
728
|
|
|
|
|
|
|
=head2 print_gffstyle |
729
|
|
|
|
|
|
|
|
730
|
|
|
|
|
|
|
Title : print_gffstyle |
731
|
|
|
|
|
|
|
Usage : $map->print_gffstyle([style]); |
732
|
|
|
|
|
|
|
Function : prints GFF; either Contigwise (default) or Groupwise |
733
|
|
|
|
|
|
|
Returns : none |
734
|
|
|
|
|
|
|
Args : [style] default = 0 contigwise, else |
735
|
|
|
|
|
|
|
1 groupwise (chromosome-wise). |
736
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
=cut |
738
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
sub print_gffstyle { |
740
|
0
|
|
|
0
|
1
|
0
|
my ($self,$style) = @_; |
741
|
|
|
|
|
|
|
|
742
|
0
|
0
|
|
|
|
0
|
$style = 0 if(!defined($style)); |
743
|
|
|
|
|
|
|
|
744
|
0
|
|
|
|
|
0
|
my %_contigs = %{$self->{'_contigs'}}; |
|
0
|
|
|
|
|
0
|
|
745
|
0
|
|
|
|
|
0
|
my %_markers = %{$self->{'_markers'}}; |
|
0
|
|
|
|
|
0
|
|
746
|
0
|
|
|
|
|
0
|
my %_clones = %{$self->{'_clones'}}; |
|
0
|
|
|
|
|
0
|
|
747
|
|
|
|
|
|
|
|
748
|
0
|
|
|
|
|
0
|
my $i; |
749
|
0
|
|
|
|
|
0
|
my ($depth, $save_depth); |
750
|
0
|
|
|
|
|
0
|
my ($x, $y); |
751
|
0
|
|
|
|
|
0
|
my @stack; |
752
|
0
|
|
|
|
|
0
|
my ($k, $j, $s); |
753
|
0
|
|
|
|
|
0
|
my $pos; |
754
|
0
|
|
|
|
|
0
|
my $contig; |
755
|
|
|
|
|
|
|
|
756
|
|
|
|
|
|
|
# Calculate the position for the marker in the contig |
757
|
|
|
|
|
|
|
|
758
|
0
|
|
|
|
|
0
|
my @contigs = $self->each_contigid(); |
759
|
0
|
|
|
|
|
0
|
my @sortedcontigs = sort {$a <=> $b } @contigs; |
|
0
|
|
|
|
|
0
|
|
760
|
0
|
|
|
|
|
0
|
my $offset = 0; |
761
|
0
|
|
|
|
|
0
|
my %gffclones; |
762
|
|
|
|
|
|
|
my %gffcontigs; |
763
|
0
|
|
|
|
|
0
|
my %gffmarkers; |
764
|
0
|
|
|
|
|
0
|
my $basepair = 4096; |
765
|
|
|
|
|
|
|
|
766
|
0
|
|
|
|
|
0
|
foreach my $contig (@sortedcontigs) { |
767
|
0
|
0
|
|
|
|
0
|
if($_contigs{$contig}{'range'} ) { |
768
|
0
|
|
|
|
|
0
|
$offset = $_contigs{$contig}{'range'}{'start'}; |
769
|
|
|
|
|
|
|
|
770
|
0
|
0
|
|
|
|
0
|
if ($offset <= 0){ |
771
|
0
|
|
|
|
|
0
|
$offset = $offset * -1; |
772
|
0
|
|
|
|
|
0
|
$gffcontigs{$contig}{'start'} = 1; |
773
|
|
|
|
|
|
|
$gffcontigs{$contig}{'end'} = |
774
|
0
|
|
|
|
|
0
|
($_contigs{$contig}{'range'}{'end'} + |
775
|
|
|
|
|
|
|
$offset ) * $basepair + 1; |
776
|
|
|
|
|
|
|
} |
777
|
|
|
|
|
|
|
else { |
778
|
0
|
|
|
|
|
0
|
$offset = 0; |
779
|
|
|
|
|
|
|
$gffcontigs{$contig}{'start'} = |
780
|
0
|
|
|
|
|
0
|
$_contigs{$contig}{'range'}{'start'} * $basepair; |
781
|
|
|
|
|
|
|
$gffcontigs{$contig}{'end'} = |
782
|
0
|
|
|
|
|
0
|
$_contigs{$contig}{'range'}{'end'} * $basepair; |
783
|
|
|
|
|
|
|
} |
784
|
|
|
|
|
|
|
} |
785
|
|
|
|
|
|
|
else { |
786
|
0
|
|
|
|
|
0
|
$gffcontigs{$contig}{'start'} = 1; |
787
|
0
|
|
|
|
|
0
|
$gffcontigs{$contig}{'end'} = 1; |
788
|
|
|
|
|
|
|
} |
789
|
|
|
|
|
|
|
|
790
|
0
|
|
|
|
|
0
|
my @clones = keys %{$_contigs{$contig}{'clones'}}; |
|
0
|
|
|
|
|
0
|
|
791
|
0
|
|
|
|
|
0
|
foreach my $clone (@clones) { |
792
|
0
|
0
|
|
|
|
0
|
if(exists ($_clones{$clone}{'range'}) ) { |
793
|
0
|
|
|
|
|
0
|
my $gffclone = $clone; |
794
|
|
|
|
|
|
|
|
795
|
0
|
|
|
|
|
0
|
$gffclone =~ s/sd1$//; |
796
|
|
|
|
|
|
|
|
797
|
|
|
|
|
|
|
$gffclones{$gffclone}{'start'} = |
798
|
0
|
|
|
|
|
0
|
(($_clones{$clone}{'range'}{'start'} + $offset) * |
799
|
|
|
|
|
|
|
$basepair + 1); |
800
|
|
|
|
|
|
|
|
801
|
|
|
|
|
|
|
$gffclones{$gffclone}{'end'} = |
802
|
0
|
|
|
|
|
0
|
(($_clones{$clone}{'range'}{'end'} |
803
|
|
|
|
|
|
|
+ $offset) * $basepair + 1); |
804
|
|
|
|
|
|
|
} |
805
|
|
|
|
|
|
|
|
806
|
0
|
0
|
|
|
|
0
|
if(!$contig) { |
807
|
0
|
|
|
|
|
0
|
my %markers = %{$_clones{$clone}{'markers'}} |
808
|
0
|
0
|
|
|
|
0
|
if (exists($_clones{$clone}{'markers'})); |
809
|
|
|
|
|
|
|
|
810
|
0
|
|
|
|
|
0
|
while (my ($k,$v) = each %markers) { |
811
|
|
|
|
|
|
|
$gffmarkers{$contig}{$k} = |
812
|
|
|
|
|
|
|
( ( $_clones{$clone}{'range'}{'start'} + |
813
|
0
|
|
|
|
|
0
|
$_clones{$clone}{'range'}{'end'} ) / 2 ) * |
814
|
|
|
|
|
|
|
$basepair + 1 ; |
815
|
|
|
|
|
|
|
} |
816
|
|
|
|
|
|
|
} |
817
|
|
|
|
|
|
|
} |
818
|
|
|
|
|
|
|
|
819
|
0
|
0
|
|
|
|
0
|
if($contig) { |
820
|
0
|
|
|
|
|
0
|
my %markers = %{$_contigs{$contig}{'markers'}} |
821
|
0
|
0
|
|
|
|
0
|
if (exists($_contigs{$contig}{'markers'})); |
822
|
|
|
|
|
|
|
|
823
|
0
|
|
|
|
|
0
|
while (my ($k,$v) = each %markers) { |
824
|
0
|
|
|
|
|
0
|
$gffmarkers{$contig}{$k} = ($v + $offset) * $basepair + 1; |
825
|
|
|
|
|
|
|
} |
826
|
|
|
|
|
|
|
} |
827
|
|
|
|
|
|
|
} |
828
|
|
|
|
|
|
|
|
829
|
0
|
0
|
|
|
|
0
|
if (!$style) { |
830
|
0
|
|
|
|
|
0
|
foreach my $contig (@sortedcontigs) { |
831
|
|
|
|
|
|
|
|
832
|
0
|
0
|
|
|
|
0
|
if(exists ($_contigs{$contig}{'range'} ) ) { |
833
|
|
|
|
|
|
|
print join("\t","ctg$contig","assembly","contig", |
834
|
|
|
|
|
|
|
$gffcontigs{$contig}{'start'}, |
835
|
0
|
|
|
|
|
0
|
$gffcontigs{$contig}{'end'},".",".",".", |
836
|
|
|
|
|
|
|
"Sequence \"ctg$contig\"; Name \"ctg$contig\"\n" |
837
|
|
|
|
|
|
|
); |
838
|
|
|
|
|
|
|
} |
839
|
|
|
|
|
|
|
|
840
|
0
|
|
|
|
|
0
|
my @clones = (keys %{$_contigs{$contig}{'clones'}} ); |
|
0
|
|
|
|
|
0
|
|
841
|
|
|
|
|
|
|
|
842
|
0
|
|
|
|
|
0
|
foreach my $clone (@clones) { |
843
|
0
|
0
|
|
|
|
0
|
if(exists ($_clones{$clone}{'range'}) ) { |
844
|
0
|
|
|
|
|
0
|
print join("\t","ctg$contig","FPC"); |
845
|
|
|
|
|
|
|
|
846
|
0
|
|
|
|
|
0
|
my $type = $_clones{$clone}{'type'}; |
847
|
|
|
|
|
|
|
|
848
|
0
|
0
|
|
|
|
0
|
if($clone =~ /sd1$/) { |
849
|
0
|
|
|
|
|
0
|
$clone =~ s/sd1$//; |
850
|
0
|
|
|
|
|
0
|
$type = "sequenced"; |
851
|
|
|
|
|
|
|
} |
852
|
|
|
|
|
|
|
print join ("\t","\t$type",$gffclones{$clone}{'start'}, |
853
|
0
|
|
|
|
|
0
|
$gffclones{$clone}{'end'},".",".",".", |
854
|
|
|
|
|
|
|
"$type \"$clone\"; Name \"$clone\""); |
855
|
|
|
|
|
|
|
|
856
|
0
|
|
|
|
|
0
|
my @markers = keys %{$_clones{$clone}{'markers'}}; |
|
0
|
|
|
|
|
0
|
|
857
|
0
|
0
|
|
|
|
0
|
print "; Marker_hit" if (scalar(@markers)); |
858
|
|
|
|
|
|
|
|
859
|
0
|
|
|
|
|
0
|
foreach my $mkr(@markers) { |
860
|
0
|
0
|
|
|
|
0
|
if (exists($_markers{$mkr}{'framework'})) { |
861
|
|
|
|
|
|
|
print " \"$mkr ",$_markers{$mkr}{'group'}," ", |
862
|
0
|
|
|
|
|
0
|
$_markers{$mkr}{'global'},"\""; |
863
|
|
|
|
|
|
|
} |
864
|
|
|
|
|
|
|
else { |
865
|
0
|
|
|
|
|
0
|
print " \"$mkr 0 0\""; |
866
|
|
|
|
|
|
|
} |
867
|
|
|
|
|
|
|
} |
868
|
|
|
|
|
|
|
print "; Contig_hit \"",$_clones{$clone}{'contig'},"\" " |
869
|
0
|
0
|
|
|
|
0
|
if (defined($_clones{$clone}{'contig'})); |
870
|
|
|
|
|
|
|
} |
871
|
0
|
|
|
|
|
0
|
print "\n"; |
872
|
|
|
|
|
|
|
} |
873
|
|
|
|
|
|
|
|
874
|
0
|
0
|
|
|
|
0
|
if (exists ($_contigs{$contig}{'markers'}) ) { |
875
|
0
|
|
|
|
|
0
|
my %list = %{$_contigs{$contig}{'markers'}}; |
|
0
|
|
|
|
|
0
|
|
876
|
|
|
|
|
|
|
|
877
|
0
|
|
|
|
|
0
|
while (my ($k,$v) = each %list) { |
878
|
0
|
|
|
|
|
0
|
print "ctg", $contig, "\tFPC\t"; |
879
|
0
|
|
|
|
|
0
|
my $position = $gffmarkers{$contig}{$k}; |
880
|
|
|
|
|
|
|
|
881
|
0
|
|
|
|
|
0
|
my $type = "marker"; |
882
|
|
|
|
|
|
|
|
883
|
|
|
|
|
|
|
$type = "electronicmarker" |
884
|
0
|
0
|
|
|
|
0
|
if ($_markers{$k}{'type'} eq "eMRK"); |
885
|
|
|
|
|
|
|
|
886
|
0
|
0
|
|
|
|
0
|
if( exists($_markers{$k}{'framework'})) { |
887
|
|
|
|
|
|
|
$type = "frameworkmarker" |
888
|
0
|
0
|
|
|
|
0
|
if($_markers{$k}{'framework'} == 1); |
889
|
|
|
|
|
|
|
|
890
|
|
|
|
|
|
|
$type = "placementmarker" |
891
|
0
|
0
|
|
|
|
0
|
if($_markers{$k}{'framework'} == 0); |
892
|
|
|
|
|
|
|
} |
893
|
|
|
|
|
|
|
|
894
|
0
|
|
|
|
|
0
|
print join ("\t","$type",$position,$position,".",".", |
895
|
|
|
|
|
|
|
".","$type \"$k\"; Name \"$k\""); |
896
|
|
|
|
|
|
|
|
897
|
0
|
|
|
|
|
0
|
my @clonelist; |
898
|
0
|
|
|
|
|
0
|
my @clones = keys %{$_markers{$k}{'clones'}}; |
|
0
|
|
|
|
|
0
|
|
899
|
|
|
|
|
|
|
|
900
|
0
|
|
|
|
|
0
|
foreach my $cl (@clones) { |
901
|
|
|
|
|
|
|
push (@clonelist, $cl) |
902
|
0
|
0
|
|
|
|
0
|
if($_clones{$cl}{'contig'} == $contig); |
903
|
|
|
|
|
|
|
} |
904
|
|
|
|
|
|
|
|
905
|
0
|
|
|
|
|
0
|
$" = " "; |
906
|
0
|
|
|
|
|
0
|
print("; Contig_hit \"ctg$contig - ",scalar(@clonelist), |
907
|
|
|
|
|
|
|
"\" (@clonelist)\n"); |
908
|
|
|
|
|
|
|
} |
909
|
|
|
|
|
|
|
} |
910
|
|
|
|
|
|
|
} |
911
|
|
|
|
|
|
|
} |
912
|
|
|
|
|
|
|
else { |
913
|
0
|
|
|
|
|
0
|
my %_groups; |
914
|
0
|
|
|
|
|
0
|
my $margin = 2 * $basepair; |
915
|
0
|
|
|
|
|
0
|
my $displacement = 0; |
916
|
0
|
|
|
|
|
0
|
my @grouplist; |
917
|
|
|
|
|
|
|
|
918
|
0
|
|
|
|
|
0
|
foreach my $contig (@sortedcontigs) { |
919
|
0
|
|
|
|
|
0
|
my $recordchr; |
920
|
0
|
|
|
|
|
0
|
my $chr = $_contigs{$contig}{'group'}; |
921
|
0
|
0
|
|
|
|
0
|
$chr = 0 if ($chr !~ /\d+|\w+/); |
922
|
|
|
|
|
|
|
|
923
|
0
|
|
|
|
|
0
|
$recordchr->{group} = $chr; |
924
|
0
|
|
|
|
|
0
|
$recordchr->{contig} = $contig; |
925
|
0
|
|
|
|
|
0
|
$recordchr->{position} = $_contigs{$contig}{'position'}; |
926
|
|
|
|
|
|
|
|
927
|
0
|
|
|
|
|
0
|
push @grouplist, $recordchr; |
928
|
|
|
|
|
|
|
} |
929
|
|
|
|
|
|
|
|
930
|
0
|
|
|
|
|
0
|
my @chr = keys (%{$_groups{'group'}}); |
|
0
|
|
|
|
|
0
|
|
931
|
0
|
|
|
|
|
0
|
my @sortedchr; |
932
|
|
|
|
|
|
|
|
933
|
0
|
0
|
|
|
|
0
|
if ($self->group_type eq 'Chromosome') { |
934
|
0
|
|
|
|
|
0
|
@sortedchr = sort { $a->{'group'} <=> $b->{'group'} |
935
|
|
|
|
|
|
|
|| |
936
|
0
|
0
|
|
|
|
0
|
$a->{'contig'} <=> $b->{'contig'} |
937
|
|
|
|
|
|
|
} @grouplist; |
938
|
|
|
|
|
|
|
} |
939
|
|
|
|
|
|
|
else { |
940
|
0
|
|
|
|
|
0
|
@sortedchr = sort { $a->{'group'} cmp $b->{'group'} |
941
|
|
|
|
|
|
|
|| |
942
|
0
|
0
|
|
|
|
0
|
$a->{'contig'} cmp $b->{'contig'} |
943
|
|
|
|
|
|
|
} @grouplist; |
944
|
|
|
|
|
|
|
} |
945
|
0
|
|
|
|
|
0
|
my $lastchr = -1; |
946
|
0
|
|
|
|
|
0
|
my $chrend = 0; |
947
|
|
|
|
|
|
|
|
948
|
0
|
|
|
|
|
0
|
foreach my $chr (@sortedchr) { |
949
|
0
|
|
|
|
|
0
|
my $chrname = $self->group_abbr().$chr->{'group'}; |
950
|
|
|
|
|
|
|
|
951
|
0
|
0
|
0
|
|
|
0
|
if ($lastchr eq -1 || $chr->{'group'} ne $lastchr ) { |
952
|
0
|
0
|
|
|
|
0
|
$lastchr = $chr->{'group'} if ($lastchr eq -1); |
953
|
0
|
|
|
|
|
0
|
$displacement = 0; |
954
|
|
|
|
|
|
|
|
955
|
|
|
|
|
|
|
# caluclate the end position of the contig |
956
|
0
|
|
|
|
|
0
|
my $ctgcount = 0; |
957
|
0
|
|
|
|
|
0
|
my $prevchr = 0; |
958
|
0
|
|
|
|
|
0
|
$chrend = 0; |
959
|
|
|
|
|
|
|
|
960
|
0
|
0
|
|
|
|
0
|
if ($chr->{contig} != 0) { |
961
|
0
|
|
|
|
|
0
|
foreach my $ch (@sortedchr) { |
962
|
0
|
0
|
|
|
|
0
|
if ($ch->{'group'} eq $chr->{'group'}) { |
963
|
0
|
0
|
|
|
|
0
|
if($ch->{'contig'} != 0) { |
964
|
|
|
|
|
|
|
my $ctg = $ch->{'contig'} |
965
|
0
|
0
|
|
|
|
0
|
if($ch->{'contig'} != 0); |
966
|
|
|
|
|
|
|
|
967
|
0
|
|
|
|
|
0
|
$chrend += $gffcontigs{$ctg}->{'end'}; |
968
|
0
|
|
|
|
|
0
|
++$ctgcount; |
969
|
|
|
|
|
|
|
} |
970
|
|
|
|
|
|
|
} |
971
|
|
|
|
|
|
|
} |
972
|
0
|
|
|
|
|
0
|
$chrend += ($ctgcount-1) * $margin; |
973
|
|
|
|
|
|
|
} |
974
|
|
|
|
|
|
|
else { |
975
|
0
|
|
|
|
|
0
|
$chrend = $gffcontigs{'0'}->{'end'}; |
976
|
|
|
|
|
|
|
} |
977
|
|
|
|
|
|
|
|
978
|
|
|
|
|
|
|
$chrname = $self->group_abbr()."ctg0" |
979
|
0
|
0
|
|
|
|
0
|
if ($chr->{'contig'} == 0); |
980
|
|
|
|
|
|
|
|
981
|
0
|
|
|
|
|
0
|
print join ("\t", $chrname,"assembly","Chromosome",1, |
982
|
|
|
|
|
|
|
"$chrend",".",".",".", |
983
|
|
|
|
|
|
|
"Sequence \"$chrname\"; Name \"$chrname\"\n"); |
984
|
|
|
|
|
|
|
} |
985
|
|
|
|
|
|
|
|
986
|
|
|
|
|
|
|
print join ("\t", $chrname,"assembly","Chromosome",1, |
987
|
|
|
|
|
|
|
"$chrend",".",".",".", |
988
|
|
|
|
|
|
|
"Sequence \"$chrname\"; Name \"$chrname\"\n") |
989
|
0
|
0
|
0
|
|
|
0
|
if ($chr->{'group'} ne $lastchr && $chr->{'group'} eq 0 ); |
990
|
|
|
|
|
|
|
|
991
|
0
|
|
|
|
|
0
|
$lastchr = $chr->{'group'}; |
992
|
0
|
0
|
|
|
|
0
|
$lastchr = -1 if ($chr->{'contig'} == 0); |
993
|
|
|
|
|
|
|
|
994
|
0
|
|
|
|
|
0
|
my $contig = $chr->{'contig'}; |
995
|
|
|
|
|
|
|
|
996
|
0
|
0
|
|
|
|
0
|
if(exists ($_contigs{$contig}{'range'} ) ) { |
997
|
|
|
|
|
|
|
|
998
|
|
|
|
|
|
|
print join ("\t",$chrname, "FPC","contig", |
999
|
|
|
|
|
|
|
$gffcontigs{$contig}{'start'}+$displacement, |
1000
|
0
|
|
|
|
|
0
|
$gffcontigs{$contig}{'end'}+$displacement, |
1001
|
|
|
|
|
|
|
".",".",".", |
1002
|
|
|
|
|
|
|
"contig \"ctg$contig\"; Name \"ctg$contig\"\n"); |
1003
|
|
|
|
|
|
|
} |
1004
|
|
|
|
|
|
|
|
1005
|
0
|
|
|
|
|
0
|
my @clones = (keys %{$_contigs{$contig}{'clones'}} ); |
|
0
|
|
|
|
|
0
|
|
1006
|
0
|
|
|
|
|
0
|
foreach my $clone (@clones) { |
1007
|
0
|
0
|
|
|
|
0
|
if(exists ($_clones{$clone}{'range'}) ) { |
1008
|
0
|
|
|
|
|
0
|
print join ("\t",$chrname,"FPC"); |
1009
|
0
|
|
|
|
|
0
|
my $type = $_clones{$clone}{'type'}; |
1010
|
|
|
|
|
|
|
|
1011
|
0
|
0
|
|
|
|
0
|
if ($clone =~ /sd1$/) { |
1012
|
0
|
|
|
|
|
0
|
$clone =~ s/sd1$//; |
1013
|
0
|
|
|
|
|
0
|
$type = "sequenced"; |
1014
|
|
|
|
|
|
|
} |
1015
|
|
|
|
|
|
|
|
1016
|
|
|
|
|
|
|
print join ("\t","\t$type",$gffclones{$clone}{'start'} |
1017
|
0
|
|
|
|
|
0
|
+$displacement,$gffclones{$clone}{'end'} |
1018
|
|
|
|
|
|
|
+$displacement,".",".",".", |
1019
|
|
|
|
|
|
|
"$type \"$clone\"; Name \"$clone\""); |
1020
|
|
|
|
|
|
|
|
1021
|
0
|
|
|
|
|
0
|
my @markers = keys %{$_clones{$clone}{'markers'}}; |
|
0
|
|
|
|
|
0
|
|
1022
|
0
|
0
|
|
|
|
0
|
print "; Marker_hit" if (scalar(@markers)); |
1023
|
|
|
|
|
|
|
|
1024
|
0
|
|
|
|
|
0
|
foreach my $mkr(@markers) { |
1025
|
0
|
0
|
|
|
|
0
|
if (exists($_markers{$mkr}{'framework'})) { |
1026
|
|
|
|
|
|
|
print " \"$mkr ",$_markers{$mkr}{'group'}," ", |
1027
|
0
|
|
|
|
|
0
|
$_markers{$mkr}{'global'},"\""; |
1028
|
|
|
|
|
|
|
} |
1029
|
|
|
|
|
|
|
else { |
1030
|
0
|
|
|
|
|
0
|
print (" \"$mkr 0 0\""); |
1031
|
|
|
|
|
|
|
} |
1032
|
|
|
|
|
|
|
} |
1033
|
|
|
|
|
|
|
print "; Contig_hit \"",$_clones{$clone}{'contig'},"\" " |
1034
|
0
|
0
|
|
|
|
0
|
if (defined($_clones{$clone}{'contig'})); |
1035
|
|
|
|
|
|
|
} |
1036
|
0
|
|
|
|
|
0
|
print "\n"; |
1037
|
|
|
|
|
|
|
} |
1038
|
|
|
|
|
|
|
|
1039
|
0
|
0
|
|
|
|
0
|
if (exists ($_contigs{$contig}{'markers'}) ) { |
1040
|
0
|
|
|
|
|
0
|
my %list = %{$_contigs{$contig}{'markers'}}; |
|
0
|
|
|
|
|
0
|
|
1041
|
|
|
|
|
|
|
|
1042
|
0
|
|
|
|
|
0
|
while (my ($k,$v) = each %list) { |
1043
|
0
|
|
|
|
|
0
|
print join ("\t",$chrname,"FPC"); |
1044
|
0
|
|
|
|
|
0
|
my $type = "marker"; |
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
$type = "electronicmarker" |
1047
|
0
|
0
|
|
|
|
0
|
if ($_markers{$k}{'type'} eq "eMRK"); |
1048
|
|
|
|
|
|
|
|
1049
|
0
|
0
|
|
|
|
0
|
if( exists($_markers{$k}{'framework'})) { |
1050
|
|
|
|
|
|
|
$type = "frameworkmarker" |
1051
|
0
|
0
|
|
|
|
0
|
if($_markers{$k}{'framework'} == 1); |
1052
|
|
|
|
|
|
|
|
1053
|
|
|
|
|
|
|
$type = "placementmarker" |
1054
|
0
|
0
|
|
|
|
0
|
if($_markers{$k}{'framework'} == 0); |
1055
|
|
|
|
|
|
|
} |
1056
|
|
|
|
|
|
|
|
1057
|
|
|
|
|
|
|
print join ("\t","\t$type",$gffmarkers{$contig}{$k} |
1058
|
0
|
|
|
|
|
0
|
+ $displacement,$gffmarkers{$contig}{$k} |
1059
|
|
|
|
|
|
|
+ $displacement,".",".",".", |
1060
|
|
|
|
|
|
|
"$type \"$k\"; Name \"$k\""); |
1061
|
|
|
|
|
|
|
|
1062
|
0
|
|
|
|
|
0
|
my @clonelist; |
1063
|
0
|
|
|
|
|
0
|
my @clones = keys %{$_markers{$k}{'clones'}}; |
|
0
|
|
|
|
|
0
|
|
1064
|
|
|
|
|
|
|
|
1065
|
0
|
|
|
|
|
0
|
foreach my $cl (@clones) { |
1066
|
|
|
|
|
|
|
push (@clonelist, $cl) |
1067
|
0
|
0
|
|
|
|
0
|
if($_clones{$cl}{'contig'} == $contig); |
1068
|
|
|
|
|
|
|
} |
1069
|
|
|
|
|
|
|
|
1070
|
0
|
|
|
|
|
0
|
$" = " "; |
1071
|
0
|
|
|
|
|
0
|
print("; Contig_hit \"ctg$contig - ", |
1072
|
|
|
|
|
|
|
scalar(@clonelist),"\" (@clonelist)\n"); |
1073
|
|
|
|
|
|
|
} |
1074
|
|
|
|
|
|
|
} |
1075
|
0
|
|
|
|
|
0
|
$displacement += $margin + $gffcontigs{$contig}{'end'}; |
1076
|
|
|
|
|
|
|
} |
1077
|
|
|
|
|
|
|
} |
1078
|
|
|
|
|
|
|
} |
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
=head2 _calc_markerposition |
1081
|
|
|
|
|
|
|
|
1082
|
|
|
|
|
|
|
Title : _calc_markerposition |
1083
|
|
|
|
|
|
|
Usage : $map->_calc_markerposition(); |
1084
|
|
|
|
|
|
|
Function: Calculates the position of the marker in the contig |
1085
|
|
|
|
|
|
|
Returns : none |
1086
|
|
|
|
|
|
|
Args : none |
1087
|
|
|
|
|
|
|
|
1088
|
|
|
|
|
|
|
=cut |
1089
|
|
|
|
|
|
|
|
1090
|
|
|
|
|
|
|
sub _calc_markerposition { |
1091
|
2
|
|
|
2
|
|
4
|
my ($self) = @_; |
1092
|
2
|
|
|
|
|
2
|
my %_contigs = %{$self->{'_contigs'}}; |
|
2
|
|
|
|
|
9
|
|
1093
|
2
|
|
|
|
|
2
|
my %_markers = %{$self->{'_markers'}}; |
|
2
|
|
|
|
|
46
|
|
1094
|
2
|
|
|
|
|
7
|
my %_clones = %{$self->{'_clones'}}; |
|
2
|
|
|
|
|
281
|
|
1095
|
|
|
|
|
|
|
|
1096
|
2
|
|
|
|
|
25
|
my $i; |
1097
|
2
|
|
|
|
|
3
|
my ($depth, $save_depth); |
1098
|
0
|
|
|
|
|
0
|
my ($x, $y); |
1099
|
0
|
|
|
|
|
0
|
my @stack; |
1100
|
0
|
|
|
|
|
0
|
my ($k, $j, $s); |
1101
|
0
|
|
|
|
|
0
|
my $pos; |
1102
|
0
|
|
|
|
|
0
|
my $contig; |
1103
|
|
|
|
|
|
|
|
1104
|
|
|
|
|
|
|
# Calculate the position for the marker in the contig |
1105
|
|
|
|
|
|
|
|
1106
|
2
|
|
|
|
|
8
|
my @contigs = $self->each_contigid(); |
1107
|
2
|
|
|
|
|
15
|
my @sortedcontigs = sort {$a <=> $b } @contigs; |
|
28
|
|
|
|
|
26
|
|
1108
|
2
|
|
|
|
|
4
|
my $offset; |
1109
|
|
|
|
|
|
|
my %gffclones; |
1110
|
0
|
|
|
|
|
0
|
my %gffcontigs; |
1111
|
|
|
|
|
|
|
|
1112
|
2
|
|
|
|
|
10
|
foreach my $marker ($self->each_markerid()) { |
1113
|
165
|
|
|
|
|
111
|
my (@ctgmarker, @sortedctgmarker); |
1114
|
|
|
|
|
|
|
|
1115
|
165
|
|
|
|
|
538
|
my @clones = (keys %{$_markers{$marker}{'clones'}}) |
1116
|
165
|
50
|
|
|
|
255
|
if (exists ($_markers{$marker}{'clones'} )); |
1117
|
|
|
|
|
|
|
|
1118
|
165
|
|
|
|
|
166
|
foreach my $clone (@clones) { |
1119
|
1079
|
|
|
|
|
543
|
my $record; |
1120
|
1079
|
|
|
|
|
1323
|
$record->{contig} = $_clones{$clone}{'contig'}; |
1121
|
1079
|
|
|
|
|
1060
|
$record->{start} = $_clones{$clone}{'range'}{'start'}; |
1122
|
1079
|
|
|
|
|
881
|
$record->{end} = $_clones{$clone}{'range'}{'end'}; |
1123
|
1079
|
|
|
|
|
793
|
push @ctgmarker,$record; |
1124
|
|
|
|
|
|
|
} |
1125
|
|
|
|
|
|
|
|
1126
|
|
|
|
|
|
|
# sorting by contig and left position |
1127
|
165
|
|
|
|
|
216
|
@sortedctgmarker = sort { $a->{'contig'} <=> $b->{'contig'} |
1128
|
|
|
|
|
|
|
|| |
1129
|
|
|
|
|
|
|
$b->{'start'} <=> $a->{'start'} |
1130
|
|
|
|
|
|
|
|| |
1131
|
2902
|
50
|
100
|
|
|
6969
|
$b->{'end'} <=> $a->{'end'} |
1132
|
|
|
|
|
|
|
} @ctgmarker; |
1133
|
|
|
|
|
|
|
|
1134
|
165
|
|
|
|
|
119
|
my $ctg = -1; |
1135
|
|
|
|
|
|
|
|
1136
|
165
|
|
|
|
|
226
|
for ($i=0; $i < scalar(@sortedctgmarker); $i++) { |
1137
|
1079
|
100
|
|
|
|
1368
|
if ($ctg != $sortedctgmarker[$i]->{'contig'}) { |
|
|
100
|
|
|
|
|
|
1138
|
170
|
100
|
|
|
|
164
|
if ($ctg == -1) { |
1139
|
165
|
|
|
|
|
139
|
$ctg = $sortedctgmarker[$i]->{'contig'}; |
1140
|
|
|
|
|
|
|
} |
1141
|
|
|
|
|
|
|
else { |
1142
|
5
|
50
|
|
|
|
7
|
if ($depth > $save_depth){ |
1143
|
0
|
|
|
|
|
0
|
$pos = ($x + $y) >> 1; |
1144
|
0
|
|
|
|
|
0
|
$_contigs{$ctg}{'markers'}{$marker} = $pos; |
1145
|
0
|
|
|
|
|
0
|
$_markers{$marker}{'posincontig'}{$ctg} = $pos; |
1146
|
|
|
|
|
|
|
} |
1147
|
|
|
|
|
|
|
} |
1148
|
|
|
|
|
|
|
|
1149
|
170
|
|
|
|
|
99
|
$ctg = $sortedctgmarker[$i]->{'contig'}; |
1150
|
170
|
|
|
|
|
119
|
$x = $sortedctgmarker[$i]->{'start'}; |
1151
|
170
|
|
|
|
|
115
|
$y = $sortedctgmarker[$i]->{'end'}; |
1152
|
170
|
|
|
|
|
99
|
$stack[0] = $y; |
1153
|
|
|
|
|
|
|
|
1154
|
170
|
|
|
|
|
138
|
$pos = ($x + $y) >> 1; |
1155
|
170
|
|
|
|
|
163
|
$_contigs{$ctg}{'markers'}{$marker} = $pos; |
1156
|
170
|
|
|
|
|
209
|
$_markers{$marker}{'posincontig'}{$ctg} = $pos; |
1157
|
|
|
|
|
|
|
|
1158
|
170
|
|
|
|
|
131
|
$depth = $save_depth = 1; |
1159
|
|
|
|
|
|
|
} |
1160
|
|
|
|
|
|
|
elsif ($sortedctgmarker[$i]->{'end'} <= $y) { |
1161
|
701
|
|
|
|
|
497
|
$stack[$depth++] = $sortedctgmarker[$i]->{'end'}; |
1162
|
|
|
|
|
|
|
# MAX |
1163
|
701
|
50
|
|
|
|
1070
|
if ($x < $sortedctgmarker[$i]->{'start'} ) { |
1164
|
0
|
|
|
|
|
0
|
$x = $sortedctgmarker[$i]->{'start'}; |
1165
|
|
|
|
|
|
|
} |
1166
|
|
|
|
|
|
|
# MIN |
1167
|
701
|
100
|
|
|
|
743
|
if ($y > $sortedctgmarker[$i]->{'end'}) { |
1168
|
593
|
|
|
|
|
421
|
$y = $sortedctgmarker[$i]->{'end'}; |
1169
|
|
|
|
|
|
|
} |
1170
|
|
|
|
|
|
|
} |
1171
|
|
|
|
|
|
|
else { |
1172
|
208
|
100
|
|
|
|
246
|
if ($depth > $save_depth) { |
1173
|
87
|
|
|
|
|
61
|
$save_depth = $depth; |
1174
|
87
|
|
|
|
|
62
|
$pos = ($x + $y) >> 1; |
1175
|
87
|
|
|
|
|
61
|
$_contigs{$ctg}{'markers'}{$marker} = $pos; |
1176
|
87
|
|
|
|
|
66
|
$_markers{$marker}{'posincontig'}{$ctg} = $pos; |
1177
|
|
|
|
|
|
|
} |
1178
|
|
|
|
|
|
|
|
1179
|
208
|
|
|
|
|
152
|
$x = $sortedctgmarker[$i]->{'start'}; |
1180
|
208
|
|
|
|
|
133
|
$y = $sortedctgmarker[$i]->{'end'}; |
1181
|
208
|
|
|
|
|
131
|
$stack[$depth++] = $y; |
1182
|
|
|
|
|
|
|
|
1183
|
208
|
|
|
|
|
289
|
for($j=-1, $k=0, $s=0; $s<$depth; $s++) { |
1184
|
208
|
50
|
|
|
|
188
|
if ($stack[$s] <$x) { |
1185
|
0
|
|
|
|
|
0
|
$stack[$s] = -1; |
1186
|
0
|
0
|
|
|
|
0
|
$j = $s if ($j == -1); |
1187
|
|
|
|
|
|
|
} |
1188
|
|
|
|
|
|
|
else { |
1189
|
208
|
|
|
|
|
112
|
$k++; |
1190
|
|
|
|
|
|
|
# MIN |
1191
|
208
|
100
|
|
|
|
231
|
$y = $stack[$s] if ($y > $stack[$s]); |
1192
|
208
|
50
|
|
|
|
182
|
if ($stack[$j] == -1) { |
1193
|
0
|
|
|
|
|
0
|
$stack[$j] = $stack[$s]; |
1194
|
0
|
|
|
|
|
0
|
$stack[$s] = -1; |
1195
|
0
|
|
|
|
|
0
|
while ($stack[$j] != -1) {$j++;} |
|
0
|
|
|
|
|
0
|
|
1196
|
|
|
|
|
|
|
} |
1197
|
|
|
|
|
|
|
else { |
1198
|
208
|
|
|
|
|
142
|
$j = $s; |
1199
|
|
|
|
|
|
|
} |
1200
|
|
|
|
|
|
|
} |
1201
|
208
|
|
|
|
|
251
|
$depth = $k; |
1202
|
|
|
|
|
|
|
} |
1203
|
|
|
|
|
|
|
} |
1204
|
1079
|
100
|
|
|
|
2005
|
if ($depth > $save_depth) { |
1205
|
324
|
|
|
|
|
208
|
$pos = ($x + $y) >> 1; |
1206
|
324
|
|
|
|
|
230
|
$_contigs{$ctg}{'markers'}{$marker} = $pos; |
1207
|
324
|
|
|
|
|
568
|
$_markers{$marker}{'posincontig'}{$ctg} = $pos; |
1208
|
|
|
|
|
|
|
} |
1209
|
|
|
|
|
|
|
} |
1210
|
|
|
|
|
|
|
} |
1211
|
|
|
|
|
|
|
} |
1212
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
=head2 _calc_contigposition |
1214
|
|
|
|
|
|
|
|
1215
|
|
|
|
|
|
|
Title : _calc_contigposition |
1216
|
|
|
|
|
|
|
Usage : $map->_calc_contigposition(); |
1217
|
|
|
|
|
|
|
Function: calculates the position of the contig in the group |
1218
|
|
|
|
|
|
|
Returns : none |
1219
|
|
|
|
|
|
|
Args : none |
1220
|
|
|
|
|
|
|
|
1221
|
|
|
|
|
|
|
=cut |
1222
|
|
|
|
|
|
|
|
1223
|
|
|
|
|
|
|
sub _calc_contigposition{ |
1224
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1225
|
|
|
|
|
|
|
|
1226
|
0
|
|
|
|
|
0
|
my %_contigs = %{$self->{'_contigs'}}; |
|
0
|
|
|
|
|
0
|
|
1227
|
0
|
|
|
|
|
0
|
my %_markers = %{$self->{'_markers'}}; |
|
0
|
|
|
|
|
0
|
|
1228
|
0
|
|
|
|
|
0
|
my %_clones = %{$self->{'_clones'}}; |
|
0
|
|
|
|
|
0
|
|
1229
|
|
|
|
|
|
|
|
1230
|
0
|
|
|
|
|
0
|
my @contigs = $self->each_contigid(); |
1231
|
0
|
|
|
|
|
0
|
my @sortedcontigs = sort {$a <=> $b } @contigs; |
|
0
|
|
|
|
|
0
|
|
1232
|
|
|
|
|
|
|
|
1233
|
0
|
|
|
|
|
0
|
foreach my $contig (@sortedcontigs) { |
1234
|
0
|
|
|
|
|
0
|
my $position = 0; |
1235
|
0
|
|
|
|
|
0
|
my $group; |
1236
|
|
|
|
|
|
|
|
1237
|
0
|
0
|
|
|
|
0
|
if (exists($_contigs{$contig}{'group'}) ) { |
1238
|
|
|
|
|
|
|
|
1239
|
0
|
|
|
|
|
0
|
my %weightedmarkers; |
1240
|
0
|
|
|
|
|
0
|
my @mkrs = keys (%{$_contigs{$contig}{'markers'}}) |
1241
|
0
|
0
|
|
|
|
0
|
if (exists($_contigs{$contig}{'markers'})) ; |
1242
|
|
|
|
|
|
|
|
1243
|
0
|
|
|
|
|
0
|
my $chr = $_contigs{$contig}{'group'}; |
1244
|
0
|
0
|
|
|
|
0
|
$chr = 0 if ($_contigs{$contig}{'group'} =~ /\?/); |
1245
|
|
|
|
|
|
|
|
1246
|
0
|
|
|
|
|
0
|
foreach my $mkr (@mkrs) { |
1247
|
0
|
0
|
|
|
|
0
|
if (exists($_markers{$mkr}{'group'})) { |
1248
|
0
|
0
|
|
|
|
0
|
if ( $_markers{$mkr}{'group'} == $chr ) { |
1249
|
0
|
|
|
|
|
0
|
my @mkrclones = keys( %{$_markers{$mkr}{'clones'}}); |
|
0
|
|
|
|
|
0
|
|
1250
|
0
|
|
|
|
|
0
|
my $clonescount = 0; |
1251
|
0
|
|
|
|
|
0
|
foreach my $clone (@mkrclones) { |
1252
|
|
|
|
|
|
|
++$clonescount |
1253
|
0
|
0
|
|
|
|
0
|
if ($_clones{$clone}{'contig'} == $contig); |
1254
|
|
|
|
|
|
|
} |
1255
|
0
|
|
|
|
|
0
|
$weightedmarkers{$_markers{$mkr}{'global'}} = |
1256
|
|
|
|
|
|
|
$clonescount; |
1257
|
|
|
|
|
|
|
} |
1258
|
|
|
|
|
|
|
} |
1259
|
|
|
|
|
|
|
} |
1260
|
|
|
|
|
|
|
|
1261
|
0
|
|
|
|
|
0
|
my $weightedctgsum = 0; |
1262
|
0
|
|
|
|
|
0
|
my $totalhits = 0; |
1263
|
|
|
|
|
|
|
|
1264
|
0
|
|
|
|
|
0
|
while (my ($mpos,$hits) = each %weightedmarkers) { |
1265
|
0
|
|
|
|
|
0
|
$weightedctgsum += ($mpos * $hits); |
1266
|
0
|
|
|
|
|
0
|
$totalhits += $hits; |
1267
|
|
|
|
|
|
|
} |
1268
|
|
|
|
|
|
|
|
1269
|
0
|
0
|
|
|
|
0
|
$position = sprintf("%.2f",$weightedctgsum / $totalhits) |
1270
|
|
|
|
|
|
|
if ($totalhits != 0); |
1271
|
|
|
|
|
|
|
|
1272
|
0
|
|
|
|
|
0
|
$_contigs{$contig}{'position'} = $position; |
1273
|
|
|
|
|
|
|
} |
1274
|
|
|
|
|
|
|
} |
1275
|
|
|
|
|
|
|
} |
1276
|
|
|
|
|
|
|
|
1277
|
|
|
|
|
|
|
=head2 _calc_contiggroup |
1278
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
Title : _calc_contiggroup |
1280
|
|
|
|
|
|
|
Usage : $map->_calc_contiggroup(); |
1281
|
|
|
|
|
|
|
Function: calculates the group of the contig |
1282
|
|
|
|
|
|
|
Returns : none |
1283
|
|
|
|
|
|
|
Args : none |
1284
|
|
|
|
|
|
|
|
1285
|
|
|
|
|
|
|
=cut |
1286
|
|
|
|
|
|
|
|
1287
|
|
|
|
|
|
|
sub _calc_contiggroup { |
1288
|
0
|
|
|
0
|
|
0
|
my ($self) = @_; |
1289
|
0
|
|
|
|
|
0
|
my %_contig = %{$self->{'_contigs'}}; |
|
0
|
|
|
|
|
0
|
|
1290
|
0
|
|
|
|
|
0
|
my @contigs = $self->each_contigid(); |
1291
|
|
|
|
|
|
|
|
1292
|
0
|
|
|
|
|
0
|
foreach my $ctg (@contigs) { |
1293
|
0
|
|
|
|
|
0
|
my $chr = floor($ctg/1000); |
1294
|
0
|
|
|
|
|
0
|
$_contig{$ctg}{'group'} = $chr; |
1295
|
|
|
|
|
|
|
} |
1296
|
|
|
|
|
|
|
} |
1297
|
|
|
|
|
|
|
|
1298
|
|
|
|
|
|
|
=head2 _setITypeE>Ref |
1299
|
|
|
|
|
|
|
|
1300
|
|
|
|
|
|
|
Title : _setRef |
1301
|
|
|
|
|
|
|
Usage : These are used for initializing the reference of the hash in |
1302
|
|
|
|
|
|
|
Bio::MapIO (fpc.pm) to the corresponding hash in Bio::Map |
1303
|
|
|
|
|
|
|
(physical.pm). Should be used only from Bio::MapIO System. |
1304
|
|
|
|
|
|
|
$map->setCloneRef(\%_clones); |
1305
|
|
|
|
|
|
|
$map->setMarkerRef(\%_markers); |
1306
|
|
|
|
|
|
|
$map->setContigRef(\%_contigs); |
1307
|
|
|
|
|
|
|
Function: sets the hash references to the corresponding hashes |
1308
|
|
|
|
|
|
|
Returns : none |
1309
|
|
|
|
|
|
|
Args : reference of the hash. |
1310
|
|
|
|
|
|
|
|
1311
|
|
|
|
|
|
|
=cut |
1312
|
|
|
|
|
|
|
|
1313
|
|
|
|
|
|
|
sub _setCloneRef { |
1314
|
2
|
|
|
2
|
|
4
|
my ($self, $ref) = @_; |
1315
|
2
|
|
|
|
|
3
|
%{$self->{'_clones'}} = %{$ref}; |
|
2
|
|
|
|
|
282
|
|
|
2
|
|
|
|
|
169
|
|
1316
|
|
|
|
|
|
|
} |
1317
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
sub _setMarkerRef { |
1319
|
2
|
|
|
2
|
|
5
|
my ($self, $ref) = @_; |
1320
|
2
|
|
|
|
|
3
|
%{$self->{'_markers'}} = %{$ref}; |
|
2
|
|
|
|
|
50
|
|
|
2
|
|
|
|
|
22
|
|
1321
|
|
|
|
|
|
|
} |
1322
|
|
|
|
|
|
|
|
1323
|
|
|
|
|
|
|
sub _setContigRef { |
1324
|
2
|
|
|
2
|
|
3
|
my ($self, $ref) = @_; |
1325
|
2
|
|
|
|
|
3
|
%{$self->{'_contigs'}} = %{$ref}; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
9
|
|
1326
|
|
|
|
|
|
|
} |
1327
|
|
|
|
|
|
|
|
1328
|
|
|
|
|
|
|
1; |