[bug 2663]
[bioperl-live.git] / Bio / UpdateableSeqI.pm
bloba980fd0b1f66f6e95e6a1f797299bbbf5ed34938
1 # $Id$
3 # BioPerl module for Bio::UpdateableSeqI
5 # Cared for by David Block <dblock@gene.pbi.nrc.ca>
7 # Copyright David Block
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 =head1 NAME
15 Bio::UpdateableSeqI - Descendant of Bio::SeqI that allows updates
17 =head1 SYNOPSIS
19 See Bio::SeqI for most of the documentation.
20 See the documentation of the methods for further details.
22 =head1 DESCRIPTION
24 Bio::UpdateableSeqI is an interface for Sequence objects which are
25 expected to allow users to perform basic editing functions (update/delete)
26 on their component SeqFeatures.
28 =head1 FEEDBACK
30 =head2 Mailing Lists
32 User feedback is an integral part of the evolution of this and other
33 Bioperl modules. Send your comments and suggestions preferably to
34 the Bioperl mailing list. Your participation is much appreciated.
36 bioperl-l@bioperl.org - General discussion
37 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
39 =head2 Reporting Bugs
41 Report bugs to the Bioperl bug tracking system to help us keep track
42 of the bugs and their resolution. Bug reports can be submitted via the
43 web:
45 http://bugzilla.open-bio.org/
47 =head1 AUTHOR - David Block
49 Email dblock@gene.pbi.nrc.ca
51 =head1 CONTRIBUTORS
53 Ewan Birney forced me to this...
55 =head1 APPENDIX
57 The rest of the documentation details each of the object methods.
58 Internal methods are usually preceded with a _
60 =cut
63 # Let the code begin...
66 package Bio::UpdateableSeqI;
67 use strict;
68 use Carp;
70 # Object preamble - inherits from Bio::Root::Root
74 use base qw(Bio::SeqI);
77 =head2 delete_feature
79 Title : delete_feature
80 Usage : my $orphanlist=$self->delete_feature($feature,$transcript,$gene);
81 Function: deletes the specified $feature from the given transcript, if $transcript is sent and exists and $feature is a feature of $transcript,
82 or from $gene if the $feature is a feature of $gene, or from $self if $transcript and $gene are not sent. Keeps track of the features
83 of the $gene object that may be left as orphans and returns them as a listref.
84 Example : I want to delete transcript 'abc' of gene 'def', with three exons, leaving only transcript 'ghi' with two exons.
85 This will leave exons 1 and 3 part of 'ghi', but exon 2 will become an orphan.
86 my $orphanlist=$seq->delete_feature($transcript{'abc'},undef,$gene{'def'});
87 $orphanlist is a reference to a list containing $exon{'2'};
88 Returns : a listref of orphaned features after the deletion of $feature (optional)
89 Args : $feature - the feature to be deleted
90 $transcript - the transcript containing the $feature, so that a $feature can be removed from only one transcript when there are multiple
91 transcripts in a gene.
92 $gene - the gene containing the $transcript and/or the $feature
95 =cut
97 sub delete_feature{
98 my ($self,$feature,$transcript,$gene) = @_;
100 $self->throw_not_implemented();