0
|
1 # $Id: ScaffoldI.pm,v 1.2 2002/11/11 18:16:30 lapp Exp $
|
|
2 #
|
|
3 # BioPerl module for Bio::Assembly::ScaffoldI
|
|
4 #
|
|
5 # Copyright by Robson F. de Souza
|
|
6 #
|
|
7 # You may distribute this module under the same terms as perl itself
|
|
8 #
|
|
9 # POD documentation - main docs before the code
|
|
10
|
|
11 =head1 NAME
|
|
12
|
|
13 Bio::Assembly::ScaffoldI - Abstract Inteface of Sequence Assemblies
|
|
14
|
|
15 =head1 SYNOPSYS
|
|
16
|
|
17 # get a Bio::Assembly::ScaffoldI object somehow
|
|
18
|
|
19 foreach my $contig ($assembly->all_contigs) {
|
|
20 # do something (see Bio::Assembly::Contig)
|
|
21 }
|
|
22
|
|
23 =head1 DESCRIPTION
|
|
24
|
|
25 This interface defines the basic set of methods an object should have
|
|
26 to manipulate assembly data.
|
|
27
|
|
28 =head1 FEEDBACK
|
|
29
|
|
30 =head2 Mailing Lists
|
|
31
|
|
32 User feedback is an integral part of the evolution of this and other
|
|
33 Bioperl modules. Send your comments and suggestions preferably to the
|
|
34 Bioperl mailing lists Your participation is much appreciated.
|
|
35
|
|
36 bioperl-l@bioperl.org - General discussion
|
|
37 http://bio.perl.org/MailList.html - About the mailing lists
|
|
38
|
|
39 =head2 Reporting Bugs
|
|
40
|
|
41 Report bugs to the Bioperl bug tracking system to help us keep track
|
|
42 the bugs and their resolution. Bug reports can be submitted via email
|
|
43 or the web:
|
|
44
|
|
45 bioperl-bugs@bio.perl.org
|
|
46 http://bugzilla.bioperl.org/
|
|
47
|
|
48 =head1 AUTHOR - Robson Francisco de Souza
|
|
49
|
|
50 Email: rfsouza@citri.iq.usp.br
|
|
51
|
|
52 =head1 APPENDIX
|
|
53
|
|
54 The rest of the documentation details each of the object
|
|
55 methods. Internal methods are usually preceded with a _
|
|
56
|
|
57 =cut
|
|
58
|
|
59 #
|
|
60 # Now, let's code!
|
|
61
|
|
62
|
|
63 package Bio::Assembly::ScaffoldI;
|
|
64
|
|
65 use strict;
|
|
66 use vars qw(@ISA);
|
|
67 use Carp;
|
|
68 use Bio::Root::RootI;
|
|
69
|
|
70 # Inheritance
|
|
71
|
|
72 @ISA = qw(Bio::Root::RootI);
|
|
73
|
|
74 #
|
|
75 # Methods
|
|
76
|
|
77 =head1 Accessing general assembly data
|
|
78
|
|
79 =cut
|
|
80
|
|
81 =head2 get_nof_contigs
|
|
82
|
|
83 Title : get_nof_contigs
|
|
84 Usage : $assembly->get_nof_contigs()
|
|
85 Function: Get the number of contigs included in the assembly
|
|
86 Returns : integer
|
|
87 Args : none
|
|
88
|
|
89 =cut
|
|
90
|
|
91 sub get_nof_contigs {
|
|
92 my $self = shift;
|
|
93
|
|
94 $self->throw_not_implemented();
|
|
95 }
|
|
96
|
|
97 =head2 get_nof_singlets
|
|
98
|
|
99 Title : get_nof_singlets
|
|
100 Usage : $assembly->get_nof_singlets()
|
|
101 Function: Get the number of singlets included in the assembly
|
|
102 Returns : integer
|
|
103 Args : none
|
|
104
|
|
105 =cut
|
|
106
|
|
107 sub get_nof_singlets {
|
|
108 my $self = shift;
|
|
109
|
|
110 $self->throw_not_implemented();
|
|
111 }
|
|
112
|
|
113 =head2 get_contig_ids
|
|
114
|
|
115 Title : get_contig_ids
|
|
116 Usage : $assembly->get_contig_ids()
|
|
117 Function: Access list of contig IDs from assembly
|
|
118 Returns : an array if there are any contigs in the assembly.
|
|
119 undef otherwise
|
|
120 Args : an array of contig IDs
|
|
121
|
|
122 =cut
|
|
123
|
|
124 sub get_contig_ids {
|
|
125 my $self = shift;
|
|
126
|
|
127 $self->throw_not_implemented();
|
|
128 }
|
|
129
|
|
130 =head2 get_singlet_ids
|
|
131
|
|
132 Title : get_singlet_ids
|
|
133 Usage : $assembly->get_singlet_ids()
|
|
134 Function: Access list of singlet IDs from assembly
|
|
135 Returns : an array if there are any singlets in the assembly.
|
|
136 undef otherwise
|
|
137 Args : an array of singlet IDs
|
|
138
|
|
139 =cut
|
|
140
|
|
141 sub get_singlet_ids {
|
|
142 my $self = shift;
|
|
143
|
|
144 $self->throw_not_implemented();
|
|
145 }
|
|
146
|
|
147 =head2 get_contig_by_id
|
|
148
|
|
149 Title : get_contig_by_id
|
|
150 Usage : $assembly->get_contig_by_id($id)
|
|
151 Function: Get a reference for a contig from the assembly
|
|
152 Returns : a Bio::Assembly::Contig object or undef
|
|
153 Args : [string] contig unique identifier (ID)
|
|
154
|
|
155 =cut
|
|
156
|
|
157 sub get_contig_by_id {
|
|
158 my $self = shift;
|
|
159 $self->throw_not_implemented();
|
|
160 }
|
|
161
|
|
162 =head2 get_singlet_by_id
|
|
163
|
|
164 Title : get_singlet_by_id
|
|
165 Usage : $assembly->get_singlet_by_id()
|
|
166 Function: Get a reference for a singlet from the assembly
|
|
167 Returns : Bio::PrimarySeqI object or undef
|
|
168 Args : [string] a singlet ID
|
|
169
|
|
170 =cut
|
|
171
|
|
172 sub get_singlet_by_id {
|
|
173 my $self = shift;
|
|
174 $self->throw_not_implemented();
|
|
175 }
|
|
176
|
|
177 =head1 Modifier methods
|
|
178
|
|
179 Implementation of these methods is optional in the sense that
|
|
180 read-only implementations may not have these. If an object implements
|
|
181 one of them, it should however implement all.
|
|
182
|
|
183 =cut
|
|
184
|
|
185 =head2 add_contig
|
|
186
|
|
187 Title : add_contig
|
|
188 Usage : $assembly->add_contig($contig)
|
|
189 Function: Add another contig to the Bio::Assembly::ScaffoldI object
|
|
190 Returns : 1 on success, 0 otherwise
|
|
191 Args : a Bio::Assembly:Contig object
|
|
192
|
|
193 See Bio::Assembly::Contig for more information
|
|
194
|
|
195 =cut
|
|
196
|
|
197 #---------------------
|
|
198 sub add_contig {
|
|
199 #---------------------
|
|
200 my ($self) = @_;
|
|
201 $self->throw_not_implemented();
|
|
202 }
|
|
203
|
|
204 =head2 add_singlet
|
|
205
|
|
206 Title : add_singlet
|
|
207 Usage : $assembly->add_singlet($seq)
|
|
208 Function: Add another singlet to the Bio::Assembly::ScaffoldI object
|
|
209 Returns : 1 on success, 0 otherwise
|
|
210 Args : a Bio::Align::Singlet object
|
|
211
|
|
212 =cut
|
|
213
|
|
214 #---------------------
|
|
215 sub add_singlet {
|
|
216 #---------------------
|
|
217 my ($self) = @_;
|
|
218 $self->throw_not_implemented();
|
|
219 }
|
|
220
|
|
221 =head2 remove_contigs
|
|
222
|
|
223 Title : remove_contigs
|
|
224 Usage : $assembly->remove_contigs(1..4)
|
|
225 Function: Remove contig from assembly object
|
|
226 Returns : a Bio::Assembly::Contig object
|
|
227 Args : a list of contig IDs
|
|
228
|
|
229 See function get_contig_ids() above
|
|
230
|
|
231 =cut
|
|
232
|
|
233 #---------------------
|
|
234 sub remove_contigs {
|
|
235 #---------------------
|
|
236 my ($self) = @_;
|
|
237 $self->throw_not_implemented();
|
|
238 }
|
|
239
|
|
240 =head2 remove_singlets
|
|
241
|
|
242 Title : remove_singlets
|
|
243 Usage : $assembly->remove_singlets(1..4)
|
|
244 Function: Remove singlet from assembly object
|
|
245 Returns : a Bio::SeqI object
|
|
246 Args : a list of singlet IDs
|
|
247
|
|
248 See function get_singlet_ids() above
|
|
249
|
|
250 =cut
|
|
251
|
|
252 #---------------------
|
|
253 sub remove_singlets {
|
|
254 #---------------------
|
|
255 my ($self) = @_;
|
|
256 $self->throw_not_implemented();
|
|
257 }
|
|
258
|
|
259 =head1 Contig and singlet selection methos
|
|
260
|
|
261 =cut
|
|
262
|
|
263 =head2 select_contigs
|
|
264
|
|
265 Title : select_contig
|
|
266 Usage : $assembly->select_contig
|
|
267 Function: Selects an array of contigs from the assembly
|
|
268 Returns : an array of Bio::Assembly::Contig objects
|
|
269 Args : an array of contig ids
|
|
270
|
|
271 See function get_contig_ids() above
|
|
272
|
|
273 =cut
|
|
274
|
|
275 #---------------------
|
|
276 sub select_contigs {
|
|
277 #---------------------
|
|
278 my ($self) = @_;
|
|
279 $self->throw_not_implemented();
|
|
280 }
|
|
281
|
|
282 =head2 select_singlets
|
|
283
|
|
284 Title : select_singlets
|
|
285 Usage : $assembly->select_singlets(@list)
|
|
286 Function: Selects an array of singlets from the assembly
|
|
287 Returns : an array of Bio::SeqI objects
|
|
288 Args : an array of singlet ids
|
|
289
|
|
290 See function get_singlet_ids() above
|
|
291
|
|
292 =cut
|
|
293
|
|
294 #---------------------
|
|
295 sub select_singlets {
|
|
296 #---------------------
|
|
297 my ($self) = @_;
|
|
298 $self->throw_not_implemented();
|
|
299 }
|
|
300
|
|
301 =head2 all_contigs
|
|
302
|
|
303 Title : all_contigs
|
|
304 Usage : my @contigs = $assembly->all_contigs
|
|
305 Function: Returns a list of all contigs in this assembly.
|
|
306 Contigs are both clusters and alignments of one
|
|
307 or more reads, with an associated consensus
|
|
308 sequence.
|
|
309 Returns : array of Bio::Assembly::Contig
|
|
310 Args : none
|
|
311
|
|
312 =cut
|
|
313
|
|
314 #---------------------
|
|
315 sub all_contigs {
|
|
316 #---------------------
|
|
317 my ($self) = @_;
|
|
318 $self->throw_not_implemented();
|
|
319 }
|
|
320
|
|
321 =head2 all_singlets
|
|
322
|
|
323 Title : all_singlets
|
|
324 Usage : my @singlets = $assembly->all_singlets
|
|
325 Function: Returns a list of all singlets in this assembly.
|
|
326 Singlets are isolated reads, without non-vector
|
|
327 matches to any other read in the assembly.
|
|
328 Returns : array of Bio::Assembly::Contig
|
|
329 Args : none
|
|
330
|
|
331 =cut
|
|
332
|
|
333 #---------------------
|
|
334 sub all_singlets {
|
|
335 #---------------------
|
|
336 my ($self) = @_;
|
|
337 $self->throw_not_implemented();
|
|
338 }
|
|
339
|
|
340 1;
|