Skip to content
Snippets Groups Projects
Commit e4e2fa36 authored by Tony Cox's avatar Tony Cox
Browse files

Added $vc->extend_maximally(_left/right) to virtual contig code

Not the prettiest way to do it but it works.
parent 1c22f3b3
No related branches found
No related tags found
No related merge requests found
......@@ -150,7 +150,7 @@ These functions are to implement the ContigI interface
Title : extend
Usage : $new_vc = $vc->extend(100,100);
Function: Make a new vc by entending an existing one
Function: Make a new vc by extending an existing one
Example :
Returns : Bio::EnsEMBL::DB::VirtualContig
Args :
......@@ -182,6 +182,78 @@ sub extend {
}
=head2 extend_maximally
Title : extend_maximally
Usage : $new_vc = $vc->extend_maximally();
Function: Extends an existing vc as far as possible in both directions
Example :
Returns : Bio::EnsEMBL::DB::VirtualContig
Args :
=cut
sub extend_maximally {
my ($self) = @_;
if( !ref $self || ! $self->isa('Bio::EnsEMBL::DB::VirtualContigI') ) {
$self->throw("Can only extend a VirtualContigI, Bailing out...");
}
# based on an original idea by Ewan Birney. ;)
my $nvc = $self->extend(100000000000,100000000000);
return $nvc;
}
=head2 extend_maximally_left
Title : extend_maximally_left
Usage : $new_vc = $vc->extend_maximally_left();
Function: Extends an existing vc as far as possible in both directions
Example :
Returns : Bio::EnsEMBL::DB::VirtualContig
Args :
=cut
sub extend_maximally_left {
my ($self) = @_;
if( !ref $self || ! $self->isa('Bio::EnsEMBL::DB::VirtualContigI') ) {
$self->throw("Can only extend a VirtualContigI, Bailing out...");
}
# based on an original idea by Ewan Birney. ;)
my $nvc = $self->extend(100000000000,0);
return $nvc;
}
=head2 extend_maximally_right
Title : extend_maximally_right
Usage : $new_vc = $vc->extend_maximally_right();
Function: Extends an existing vc as far as possible in both directions
Example :
Returns : Bio::EnsEMBL::DB::VirtualContig
Args :
=cut
sub extend_maximally_right {
my ($self) = @_;
if( !ref $self || ! $self->isa('Bio::EnsEMBL::DB::VirtualContigI') ) {
$self->throw("Can only extend a VirtualContigI, Bailing out...");
}
# based on an original idea by Ewan Birney. ;)
my $nvc = $self->extend(0,100000000000);
return $nvc;
}
=head2 primary_seq
Title : primary_seq
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment