Archive Ensembl HomeArchive Ensembl Home
bio_ens_predictionExon.pm
Go to the documentation of this file.
00001 =head1 LICENSE
00002 
00003   Copyright (c) 1999-2012 The European Bioinformatics Institute and
00004   Genome Research Limited.  All rights reserved.
00005 
00006   This software is distributed under a modified Apache license.
00007   For license details, please see
00008 
00009     http://www.ensembl.org/info/about/code_licence.html
00010 
00011 =head1 CONTACT
00012 
00013   Please email comments or questions to the public Ensembl
00014   developers list at <dev@ensembl.org>.
00015 
00016   Questions may also be sent to the Ensembl help desk at
00017   <helpdesk@ensembl.org>.
00018 
00019 =head1 AUTHOR
00020 
00021 Juguang Xiao <juguang@tll.org.sg>
00022 
00023 =cut
00024 
00025 =head1 NAME
00026 
00027 Bio::EnsEMBL::Utils::Converter::bio_ens_predictionExon
00028 
00029 =head1 SYNOPISIS
00030 
00031   my $converter = new Bio::EnsEMBL::Utils::Converter(
00032     -in     => 'Bio::Tools::Prediction::Exon',
00033     -out    => 'Bio::EnsEMBL::Exon',
00034     -contig => $ens_contig
00035   );
00036 
00037 =head1 DESCRIPTION
00038 
00039 =head1 METHODS
00040 
00041 =cut
00042 
00043 package Bio::EnsEMBL::Utils::Converter::bio_ens_predictionExon;
00044 
00045 use strict;
00046 use vars qw(@ISA);
00047 use Bio::EnsEMBL::Utils::Converter;
00048 use Bio::EnsEMBL::Exon;
00049 use Bio::EnsEMBL::Utils::Converter::bio_ens;
00050 @ISA = qw(Bio::EnsEMBL::Utils::Converter::bio_ens);
00051 
00052 sub _convert_single {
00053     my ($self, $input) = @_;
00054     
00055 
00056     $input || $self->throw("a input object needed");
00057     $self->throw("a Bio::Tools::Prediction::Exon object needed")
00058         unless($input->isa("Bio::Tools::Prediction::Exon"));
00059 
00060     my $output = Bio::EnsEMBL::Exon->new(
00061         -start => $input->start,
00062         -end => $input->end,
00063         -strand => $input->strand
00064     );
00065 
00066     $output->score($input->score);
00067     $output->p_value($input->significance);
00068 
00069     $output->phase($input->get_tag_values("phase")); # only first element is used
00070     $output->end_phase($input->get_tag_values("end_phase"));
00071 
00072     $output->contig($self->contig);
00073 
00074     return $output;
00075 }
00076 
00077 
00078 1;