Commit 809f1d70 authored by Graham McVicker's avatar Graham McVicker
Browse files

removed deprecated methods

parent d1f30e65
......@@ -284,52 +284,6 @@ sub snps {
=head2 chromosome_id
Args : none
Example : none
Description: deprecated, use dbID or chr_name
Returntype : none
Exceptions : none
Caller : none
=cut
sub chromosome_id {
my ($self, $id ) = @_;
my ($package, $filename, $line) = caller();
$self->warn("Chromosome::chromosome_id is deprecated, use Chromosome::dbID
instead\n line:$line package:$package filename:$filename");
return $self->dbID($id);
}
=head2 get_landmark_MarkerFeatures
Arg [1] : none
Example : none
Description: DEPRECATED
use Bio::EnsEMBL::Slice::get_all_landmark_MarkerFeatures instead
Returntype : none
Exceptions : none
Caller : none
=cut
sub get_landmark_MarkerFeatures{
my ($self,@args) = @_;
$self->warn("Chromosome::get_landmark_MarkerFeatures is deprecated. \n" .
"Use Slice::get_landmark_MarkerFeatures instead\n");
return $self->adaptor->get_landmark_MarkerFeatures($self->chr_name);
}
1;
......
......@@ -584,27 +584,6 @@ sub get_DBEntryAdaptor {
}
=head2 get_StaticGoldenPathAdaptor
Args : none
Example : $sgpa = $db_adaptor->get_StaticGoldenPathAdaptor();
Description: Gets a StaticGoldenPathAdaptor for this database
Use of the StaticGoldenPathAdaptor is not recommended. It is
being phased out, and is largly deprecated already. The
SliceAdaptor or AssemblyMapperAdaptor may be a viable
alternatives.
Returntype : Bio::EnsEMBL::DBSQL::AnalysisAdaptor
Exceptions : none
Caller : general
=cut
sub get_StaticGoldenPathAdaptor{
my( $self ) = @_;
return $self->_get_adaptor("Bio::EnsEMBL::DBSQL::StaticGoldenPathAdaptor");
}
=head2 get_KaryotypeBandAdaptor
......
......@@ -131,45 +131,38 @@ sub fetch_by_chr_start_end {
=cut
sub fetch_by_contig_name {
my ($self,$name, $size) = @_;
if( !defined $size ) {$size=0;}
my ($chr_name,$start,$end) = $self->_get_chr_start_end_of_contig($name);
$start -= $size;
$end += $size;
if($start < 1) {
$start = 1;
}
return $self->fetch_by_chr_start_end($chr_name, $start, $end);
}
my ($self,$name, $size) = @_;
if( !defined $size ) {$size=0;}
my ($chr_name,$start,$end) = $self->_get_chr_start_end_of_contig($name);
$start -= $size;
$end += $size;
if($start < 1) {
$start = 1;
}
return $self->fetch_by_chr_start_end($chr_name, $start, $end);
}
=head2 fetch_by_fpc_name
=head2 fetch_by_supercontig_name
Arg [1] : string $fpc_name
Example : my $slice = $slice_adaptor->fetch_by_fpc_name('NT_004321');
Arg [1] : string $supercontig_name
Example : $slice = $slice_adaptor->fetch_by_supercontig_name('NT_004321');
Description: Creates a Slice on the region of the assembly where
the specified FPC (super) contig lies.
the specified super contig lies. Note that this slice will
have the same orientation as the supercontig. If the supercontig
has a negative assembly orientation, the slice will also have
a negative orientation relative to the assembly.
Returntype : Bio::EnsEMBL::Slice
Exceptions : none
Caller : general
=cut
sub fetch_by_fpc_name {
my ($self,$fpc_name) = @_;
my( $p, $f, $l ) = caller;
$self->warn( "$f:$l calls deprecated method fetch_by_fpc_name. Please use fetch_by_supercontig_name instead" );
$self->fetch_by_supercontig_name( $fpc_name );
}
sub fetch_by_supercontig_name {
my ($self,$supercontig_name) = @_;
......
......@@ -1328,462 +1328,4 @@ triplets (start, stop, strand) from which new ranges could be built.
=head1 sub Deprecated Methods
=cut
###############################################################################
=head2 _rephase_exon_genscan
Arg [1] : none
Example : none
Description: DEPRECATED do not use
Returntype : none
Exceptions : none
Caller : none
=cut
sub _rephase_exon_genscan{
my ($self) = @_;
$self->throw("call to deprecated method _rephase_exon_genscan");
# my $dna = $self->seq();
# my $phase;
# my $pep = $self->_genscan_peptide();
# # trim top and bottem
# my $dnaseq = $dna->seq();
# LOOP : {
# $dna->setseq(substr($dnaseq,3,-3));
# my $tr1 = $dna->translate();
# my $tr1pep = $tr1->str();
# chop $tr1pep;
## print STDERR "[$tr1pep] to\n[$pep]\n";
# if( $tr1pep !~ /\*/ && $pep =~ /$tr1pep/ ) {
# $phase = 0;
# last LOOP;
# }
# $dna->setseq(substr($dnaseq,4,-3));
# $tr1 = $dna->translate();
# $tr1pep = $tr1->str();
# chop $tr1pep;
## print STDERR "[$tr1pep] to\n[$pep]\n";
# if( $tr1pep !~ /\*/ && $pep =~ /$tr1pep/ ) {
# $phase = 1;
# last LOOP;
# }
# $dna->setseq(substr($dnaseq,5,-3));
# $tr1 = $dna->translate();
# $tr1pep = $tr1->str();
# chop $tr1pep;
## print STDERR "[$tr1pep] to\n[$pep]\n";
# if( $tr1pep !~ /\*/ && $pep =~ /$tr1pep/ ) {
# $phase = 2;
# last LOOP;
# }
# }
## print STDERR "For exon ",$self->strand," ",$self->phase," ",$phase,"\n";
# $self->phase($phase);
}
=head2 _genscan_peptide
Arg [1] : none
Example : none
Description: DEPRECATED do not use
Returntype : none
Exceptions : none
Caller : none
=cut
sub _genscan_peptide{
my $obj = shift;
$obj->throw("call to deprecated method Exon::_genscan_peptide");
# if( @_ ) {
# my $value = shift;
# $obj->{'_genscan_peptide'} = $value;
# }
# return $obj->{'_genscan_peptide'};
}
=head2 _translate
Arg [1] : none
Example : none
Description: DEPRECATED - This method was not implemented correctly. It did
not take into account the possibility of exons with UTRs.
Use peptide instead.
Returntype : none
Exceptions : none
Caller : none
=cut
sub _translate {
my($self) = @_;
$self->throw("Exon::_translate is deprecated - it was implemented " .
"incorrectly, and could not provide correct translations ".
"for exons with UTRs. Use Exon::peptide instead");
# my $pep;
# my $i;
# if( $self->length < 3 ) {
# $self->throw("Perfectly valid sub length 2 exon. Impossible to translate. Doh!".$self->length." ".$self->dbID);
# }
# # changed this to work with the new SeqFeature stuff. I am still not
# # 100% happy about this. EB.
# # Get the DNA sequence and create the sequence string
# $self->seq() || $self->throw("No DNA in object. Can't translate\n");
# my $dna = $self->seq();
# # Translate in all frames - have to chop
# # off bases from the beginning of the dna sequence
# # for frames 1 and 2 as the translate() method
# # only translates in one frame. Pah!
# for ($i = 0; $i < 3; $i++) {
# my $tmp = new Bio::Seq(-seq => substr($dna->seq,$i));
# $pep->[$i] = $tmp->translate();
# }
# return $pep;
}
=head2 translate
Arg [1] : none
Example : none
Description: DEPRECATED - This method was not implemented correctly. It did
not take into account the possibility of exons with UTRs.
Use peptide instead.
Returntype : none
Exceptions : none
Caller : none
=cut
sub translate {
my($self) = @_;
$self->throw("Exon::translate is deprecated - it was implemented " .
"incorrectly, and could not provide correct translations ".
"for exons with UTRs. Use Exon::peptide instead");
# my $pep = $self->_translate() || throw ("Can't translate DNA\n");
# my $phase= 0;
# if (defined($self->phase)) {
# $phase = $self->phase;
# }
# if ($phase){
# $phase = 3 - $phase;
# }
# return $pep->[$phase];
}
=head2 start_translation
Arg [1] : none
Example : none
Description: DEPRECATED this method was implemented incorrectly and did not
work for exons with UTRs. Use the translation object to obtain
this information
Returntype : none
Exceptions : none
Caller : none
=cut
sub start_translation {
my ($self,$value) = @_;
$self->throw("end_translation is deprecated. use the Translation object ".
"to obtain this information instead");
# if( defined $value){
# $self->throw("cannot set translation start!");
# }
# my $phase=$self->phase;
# $phase=3-$phase if $phase;
# if($self->strand==1){
# return ($self->start + $phase);
# }else{
# return ($self->end - $phase);
# }
}
=head2 end_translation
Arg [1] : none
Example : none
Description: DEPRECATED this method was implemented incorrectly and did not
work for exons with UTRs. Use the translation object to obtain
this information
Returntype : none
Exceptions : none
Caller : none
=cut
sub end_translation {
my ($self,$value) = @_;
$self->throw("end_translation is deprecated. use the Translation object ".
"to obtain this information instead");
# if( defined $value){
# $self->throw("cannot set translation end!");
# }
# my $phase=$self->end_phase;
# if($self->strand==1){
# return ($self->end - $phase);
# }else{
# return ($self->start + $phase);
# }
}
=head2 pep_seq
Arg [1] : none
Example : none
Description: DEPRECATED This method was implemented incorrectly and did not
work for exons with UTRs. Use peptide instead.
Returntype : none
Exceptions : none
Caller : none
=cut
sub pep_seq {
my ($self) = @_;
$self->throw("pep_seq is deprecated, use peptide instead\n");
# my $pep = $self->_translate();
# return @$pep;
}
=head2 add_frameshift
Arg [1] : none
Example : none
Description: not currently used
Returntype : none
Exceptions : none
Caller : none
=cut
sub add_frameshift {
my ($self,$start,$length) = @_;
# do some simple sanity checks
my $tseq = $self->seq->seq;
if ( $start > length( $tseq ) ) {
print STDERR "Trying to add a frameshift outside the range of the sequence. Ignoring.\n";
return;
}
if ( !defined $start ) {
print STDERR "Trying to add a frameshift without any parameters. Ignoring.\n";
return;
}
if ( !defined $length ) {
print STDERR "Trying to add a frameshift without a specified length. Ignoring.\n";
return;
}
if ( $start <= 0) {
print STDERR "Trying to add a frameshift with a start point of zero or less. Ignoring.\n";
return;
}
if ( $length == 0) {
print STDERR "Trying to add a frameshift with a length of zero. Ignoring.\n";
return;
}
# and finally if the frameshift data is valid....
push @{$self->{'_frameshifts'}},[$start,$length];
}
=head2 get_frameshifts
Arg [1] : none
Example : none
Description: Not currently used
Returntype : none
Exceptions : none
Caller : none
=cut
sub get_frameshifts {
my ($self) = @_;
# if already stored in the current exon object
if ( defined $self->{'_frameshifts'} ) {
return @{$self->{'_frameshifts'}};
}
else { # else fetch frameshift data from database
if ( !defined $self->adaptor ) {
return; # return undef if no ExonAdaptor
}
$self->adaptor->fetch_frameshifts( $self );
if ( defined $self->{'_frameshifts'}){
return @{$self->{'_frameshifts'}};
}
else {
return; # not necessarily any frameshifts stored
}
}
}
=head2 get_cdna
Arg [1] : none
Example : none
Description: Not currently used. In the future this may be useful if
frameshifts are implemented
Returntype : none
Exceptions : none
Caller : none
=cut
sub get_cdna {
my ($self) =@_;
my $seq1 = $self->seq();
my $seq = $seq1->seq();
# check to see if frameshifts actually exist
my @frameshifts = $self->get_frameshifts();
# if the exon has no frameshifts, simply return the dna
# sequence unmodified
if ( scalar(@frameshifts) ==0 ) {
my $temp_seq = Bio::Seq->new(
-SEQ => $seq,
-DISPLAY_ID => 'cdna_unmodified',
-MOLTYPE => 'dna'
);
return $temp_seq;
}
# if there are frameshifts...
# sort frameshifts into order based on their start positions.
# important that this is done because the while loop below relies on this!!
# frameshifts are stored as [start, length]
@frameshifts = sort { $a->[0] <=> $b->[0] } @frameshifts;
my $fshift_seq = ""; # frameshift modified sequence
# need to check that starting from 1 is in fact correct!!
my $bp = 1; # position along sequence
my $curr_frame = 0; # current frameshift
# run along the genomic sequence for the current exon
while ( $bp <= length($seq) ) {
# do something if we find a frameshift
if ( $bp == $frameshifts[$curr_frame][0] ) {
# if bps have been inserted then jump along the sequence
# ignoring extraneous bps
if ( $frameshifts[$curr_frame][1] > 0 ) {
$bp += $frameshifts[$curr_frame][1];
}
# else if bps have been deleted, insert some Ns.
# there shouldnt be a 0 case but cover it just in case.
elsif ( $frameshifts[$curr_frame][1] <= 0 ) {
$fshift_seq .= substr($seq, $bp-1, 1);
# -1 to be consistent with the dna seqeunce
$fshift_seq .= 'N' x -$frameshifts[$curr_frame][1];
$bp++;
}
# to stop -warnings complaining
if ( $curr_frame < $#frameshifts ) {
$curr_frame++; # point to the next frameshift
}
}
else { # store the current base pair
$fshift_seq .= substr($seq, $bp-1, 1);
# -1 to be consistent with the dna seqeunce
$bp++;
}
}
# a sanity check here to make sure the modified sequence is the
# right length - but return modified cdna anyway...
my $seq_changes = 0;
for my $i ( 0 .. $#frameshifts ) {
$seq_changes += $frameshifts[$i][1];
}
if ( length($seq) - $seq_changes != length($fshift_seq)) {
print STDERR "Frameshift modified sequence isn't the correct length.\n";
}
# push the modified sequence into a Bio::Seq object
my $temp_seq = Bio::Seq->new(
-SEQ => $fshift_seq,
-DISPLAY_ID => 'cdna_modified',
-MOLTYPE => 'dna'
);
return $temp_seq;
}
1;
......@@ -534,105 +534,6 @@ sub hend_phase {
=head2 hprimary_tag
Title : hprimary_tag
Usage : $ptag = $featpair->hprimary_tag