Add ability to remove specific features, using primary_tag
[bioperl-live.git] / Bio / Assembly / ScaffoldI.pm
blobdbfb485111020f12756651731ef8d29369732e22
2 # BioPerl module for Bio::Assembly::ScaffoldI
4 # Copyright by Robson F. de Souza
6 # You may distribute this module under the same terms as perl itself
8 # POD documentation - main docs before the code
10 =head1 NAME
12 Bio::Assembly::ScaffoldI - Abstract Inteface of Sequence Assemblies
14 =head1 SYNOPSIS
16 # get a Bio::Assembly::ScaffoldI object somehow
18 foreach my $contig ($assembly->all_contigs) {
19 # do something (see Bio::Assembly::Contig)
22 =head1 DESCRIPTION
24 This interface defines the basic set of methods an object should have
25 to manipulate assembly data.
27 =head1 FEEDBACK
29 =head2 Mailing Lists
31 User feedback is an integral part of the evolution of this and other
32 Bioperl modules. Send your comments and suggestions preferably to the
33 Bioperl mailing lists Your participation is much appreciated.
35 bioperl-l@bioperl.org - General discussion
36 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
38 =head2 Support
40 Please direct usage questions or support issues to the mailing list:
42 I<bioperl-l@bioperl.org>
44 rather than to the module maintainer directly. Many experienced and
45 reponsive experts will be able look at the problem and quickly
46 address it. Please include a thorough description of the problem
47 with code and data examples if at all possible.
49 =head2 Reporting Bugs
51 Report bugs to the Bioperl bug tracking system to help us keep track
52 the bugs and their resolution. Bug reports can be submitted via the
53 web:
55 https://github.com/bioperl/bioperl-live/issues
57 =head1 AUTHOR - Robson Francisco de Souza
59 Email: rfsouza@citri.iq.usp.br
61 =head1 APPENDIX
63 The rest of the documentation details each of the object
64 methods. Internal methods are usually preceded with a _
66 =cut
69 # Now, let's code!
72 package Bio::Assembly::ScaffoldI;
74 use strict;
75 use Carp;
77 # Inheritance
79 use base qw(Bio::Root::RootI);
82 # Methods
84 =head1 Accessing general assembly data
86 =cut
88 =head2 get_nof_contigs
90 Title : get_nof_contigs
91 Usage : $assembly->get_nof_contigs()
92 Function: Get the number of contigs included in the assembly
93 Returns : integer
94 Args : none
96 =cut
98 sub get_nof_contigs {
99 my $self = shift;
101 $self->throw_not_implemented();
104 =head2 get_nof_singlets
106 Title : get_nof_singlets
107 Usage : $assembly->get_nof_singlets()
108 Function: Get the number of singlets included in the assembly
109 Returns : integer
110 Args : none
112 =cut
114 sub get_nof_singlets {
115 my $self = shift;
117 $self->throw_not_implemented();
120 =head2 get_contig_ids
122 Title : get_contig_ids
123 Usage : $assembly->get_contig_ids()
124 Function: Access list of contig IDs from assembly
125 Returns : an array if there are any contigs in the assembly.
126 undef otherwise
127 Args : an array of contig IDs
129 =cut
131 sub get_contig_ids {
132 my $self = shift;
134 $self->throw_not_implemented();
137 =head2 get_singlet_ids
139 Title : get_singlet_ids
140 Usage : $assembly->get_singlet_ids()
141 Function: Access list of singlet IDs from assembly
142 Returns : an array if there are any singlets in the assembly.
143 undef otherwise
144 Args : an array of singlet IDs
146 =cut
148 sub get_singlet_ids {
149 my $self = shift;
151 $self->throw_not_implemented();
154 =head2 get_contig_by_id
156 Title : get_contig_by_id
157 Usage : $assembly->get_contig_by_id($id)
158 Function: Get a reference for a contig from the assembly
159 Returns : a Bio::Assembly::Contig object or undef
160 Args : [string] contig unique identifier (ID)
162 =cut
164 sub get_contig_by_id {
165 my $self = shift;
166 $self->throw_not_implemented();
169 =head2 get_singlet_by_id
171 Title : get_singlet_by_id
172 Usage : $assembly->get_singlet_by_id()
173 Function: Get a reference for a singlet from the assembly
174 Returns : Bio::Assembly::Singlet object or undef
175 Args : [string] a singlet ID
177 =cut
179 sub get_singlet_by_id {
180 my $self = shift;
181 $self->throw_not_implemented();
184 =head1 Modifier methods
186 Implementation of these methods is optional in the sense that
187 read-only implementations may not have these. If an object implements
188 one of them, it should however implement all.
190 =cut
192 =head2 add_contig
194 Title : add_contig
195 Usage : $assembly->add_contig($contig)
196 Function: Add another contig to the Bio::Assembly::ScaffoldI object
197 Returns : 1 on success, 0 otherwise
198 Args : a Bio::Assembly:Contig object
200 See Bio::Assembly::Contig for more information
202 =cut
204 #---------------------
205 sub add_contig {
206 #---------------------
207 my ($self) = @_;
208 $self->throw_not_implemented();
211 =head2 add_singlet
213 Title : add_singlet
214 Usage : $assembly->add_singlet($seq)
215 Function: Add another singlet to the Bio::Assembly::ScaffoldI object
216 Returns : 1 on success, 0 otherwise
217 Args : a Bio::Assembly::Singlet object
219 =cut
221 #---------------------
222 sub add_singlet {
223 #---------------------
224 my ($self) = @_;
225 $self->throw_not_implemented();
228 =head2 remove_contigs
230 Title : remove_contigs
231 Usage : $assembly->remove_contigs(1..4)
232 Function: Remove contig from assembly object
233 Returns : a Bio::Assembly::Contig object
234 Args : a list of contig IDs
236 See function get_contig_ids() above
238 =cut
240 #---------------------
241 sub remove_contigs {
242 #---------------------
243 my ($self) = @_;
244 $self->throw_not_implemented();
247 =head2 remove_singlets
249 Title : remove_singlets
250 Usage : $assembly->remove_singlets(1..4)
251 Function: Remove singlets from assembly object
252 Returns : an array of Bio::Assembly::Singlet objects
253 Args : an array of singlet IDs
255 See function get_singlet_ids() above
257 =cut
259 #---------------------
260 sub remove_singlets {
261 #---------------------
262 my ($self) = @_;
263 $self->throw_not_implemented();
266 =head1 Contig and singlet selection methos
268 =cut
270 =head2 select_contigs
272 Title : select_contig
273 Usage : $assembly->select_contig
274 Function: Selects an array of contigs from the assembly
275 Returns : an array of Bio::Assembly::Contig objects
276 Args : an array of contig ids
278 See function get_contig_ids() above
280 =cut
282 #---------------------
283 sub select_contigs {
284 #---------------------
285 my ($self) = @_;
286 $self->throw_not_implemented();
289 =head2 select_singlets
291 Title : select_singlets
292 Usage : $assembly->select_singlets(@list)
293 Function: Selects an array of singlets from the assembly
294 Returns : an array of Bio::Assembly::Singlet objects
295 Args : an array of singlet ids
297 See function get_singlet_ids() above
299 =cut
301 #---------------------
302 sub select_singlets {
303 #---------------------
304 my ($self) = @_;
305 $self->throw_not_implemented();
308 =head2 all_contigs
310 Title : all_contigs
311 Usage : my @contigs = $assembly->all_contigs
312 Function: Returns a list of all contigs in this assembly.
313 Contigs are both clusters and alignments of one
314 or more reads, with an associated consensus
315 sequence.
316 Returns : array of Bio::Assembly::Contig
317 Args : none
319 =cut
321 #---------------------
322 sub all_contigs {
323 #---------------------
324 my ($self) = @_;
325 $self->throw_not_implemented();
328 =head2 all_singlets
330 Title : all_singlets
331 Usage : my @singlets = $assembly->all_singlets
332 Function: Returns a list of all singlets in this assembly.
333 Singlets are isolated reads, without non-vector
334 matches to any other read in the assembly.
335 Returns : array of Bio::Assembly::Singlet objects
336 Args : none
338 =cut
340 #---------------------
341 sub all_singlets {
342 #---------------------
343 my ($self) = @_;
344 $self->throw_not_implemented();