Bio::EnsEMBL::ExternalData::DAS GenomicPeptideMapper
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::TranscriptMapper
Inherit
Bio::EnsEMBL::Mapper
Synopsis
No synopsis!
Description
No description!
Methods
map_coordinates
No description
Code
new
No description
Code
Methods description
None available.
Methods code
map_coordinatesdescriptionprevnextTop
sub map_coordinates {
  my $self = shift;
  
  my (@coords, $out_id, $out_cs);
  # Query is genomic
if ( $_[4] eq $self->{'genomic'} ) { @coords = $self->{'_mapper'}->genomic2pep(@_[1 .. 3]); $out_id = $self->{'peptide_id'}; $out_cs = $self->{'peptide_cs'}; # Query is peptide
} elsif ( $_[4] eq $self->{'peptide'} ) { @coords = $self->{'_mapper'}->pep2genomic(@_[1 .. 2]); $out_id = $self->{'genomic_id'}; $out_cs = $self->{'genomic_cs'}; } else { throw($_[4].' is neither the genomic or peptide coordinate system'); } for my $c ( @coords ) { if ($c->isa('Bio::EnsEMBL::Mapper::Coordinate')) { $c->id( $out_id ); $c->coord_system( $out_cs ); # TranscriptMapper doesn't set this
} } return @coords; } 1;
}
newdescriptionprevnextTop
sub new {
  my ( $proto, $from, $to, $from_cs, $to_cs, $transcript ) = @_;
  my $class = ref $proto || $proto;
  
  my $self = {
    '_mapper' => Bio::EnsEMBL::TranscriptMapper->new( $transcript->transfer($transcript->slice->seq_region_Slice) ),
    'from'    => $from,
    'to'      => $to,
    'from_cs' => $from_cs,
    'to_cs'   => $to_cs,
  };
  bless $self, $class;
  
  my $is_forward = $to_cs->name =~ m/peptide/;
$self->{'genomic_id'} = $transcript->slice->seq_region_name; $self->{'peptide_id'} = $transcript->translation->stable_id; $self->{'genomic'} = $is_forward ? $from : $to; $self->{'peptide'} = $is_forward ? $to : $from; $self->{'genomic_cs'} = $is_forward ? $from_cs : $to_cs; $self->{'peptide_cs'} = $is_forward ? $to_cs : $from_cs; return $self;
}
General documentation
No general documentation available.