Bio::Tools Est2Genome
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::Tools::Est2Genome - Parse est2genome output, makes simple Bio::SeqFeature::Generic objects
Package variables
No package variables defined.
Included modules
Bio::Root::Root
Bio::SeqFeature::Gene::Exon
Bio::SeqFeature::Gene::GeneStructure
Bio::SeqFeature::Gene::Intron
Bio::SeqFeature::SimilarityPair
Bio::Tools::AnalysisResult
Inherit
Bio::Tools::AnalysisResult
Synopsis
  use Bio::Tools::Est2Genome;
my $featureiter = new Bio::Tools::Est2Genome(-file => 'output.est2genome'); # This is going to be fixed to use the SeqAnalysisI next_feature # Method eventually when we have the objects to put the data in # properly while( my $f = $featureiter->parse_next_gene ) { # process Bio::SeqFeature::Generic objects here }
Description
This module is a parser for est2genome [EMBOSS] alignments of est/cdna
sequence to genomic DNA. This is generally accepted as the best
program for predicting splice sites based on est/cdnas*.
This module currently does not try pull out the ungapped alignments
(Segment) but may in the future.
* AFAIK
Methods
_initialize_state
No description
Code
analysis_methodDescriptionCode
next_featureDescriptionCode
parse_next_geneDescriptionCode
Methods description
analysis_methodcode    nextTop
 Usage     : $sim4->analysis_method();
Purpose : Inherited method. Overridden to ensure that the name matches
/est2genome/i.
Returns : String
Argument : n/a
next_featurecodeprevnextTop
 Title   : next_feature
Usage : $seqfeature = $obj->next_feature();
Function: Returns the next feature available in the analysis result, or
undef if there are no more features.
Example :
Returns : A Bio::SeqFeatureI implementing object, or undef if there are no
more features.
Args : none
parse_next_genecodeprevnextTop
 Title   : parse_next_gene
Usage : @gene = $est2genome_result->parse_next_gene;
foreach $exon (@exons) {
# do something
}
Function: Parses the next alignments of the est2genome result file and returns the found exons as an array of Bio::SeqFeature::SimilarityPair objects. Call this method repeatedly until an empty array is returned to get the results for all alignments. The $exon->seq_id() attribute will be set to the identifier of the respective sequence for both sequences. The length is accessible via the seqlength() attribute of $exon->query() and $exon->est_hit(). Returns : An array (or array reference) of Bio::SeqFeature::SimilarityPair and Bio::SeqFeature::Generic objects Args : none
Methods code
_initialize_statedescriptionprevnextTop
sub _initialize_state {
    my($self,@args) = @_;

    # call the inherited method first
my $make = $self->SUPER::_initialize_state(@args); my ($genome_is_first) = $self->_rearrange([qw(GENOMEFIRST)], @args); delete($self->{'_genome_is_first'}); $self->{'_genome_is_first'} = $genome_is_first if(defined($genome_is_first)); $self->analysis_method("est2genome");
}
analysis_methoddescriptionprevnextTop
sub analysis_method {
#-------------
my ($self, $method) = @_; if($method && ($method !~ /est2genome/i)) { $self->throw("method $method not supported in " . ref($self)); } return $self->SUPER::analysis_method($method);
}
next_featuredescriptionprevnextTop
sub next_feature {
    my ($self) = shift;
    $self->throw("We haven't really done this right, yet, use parse_next_gene");
}


1;
}
parse_next_genedescriptionprevnextTop
sub parse_next_gene {
   my ($self) = @_;
   my $seensegment = 0;
   my @features;
   my ($qstrand,$hstrand) = (1,1);
   my $lasthseqname;
   while( defined($_ = $self->_readline) ) {
       if( /Note Best alignment is between (reversed|forward) est and (reversed|forward) genome, (but|and) splice\s+sites imply\s+(forward gene|REVERSED GENE)/) {
	   if( $seensegment ) {
	       $self->_pushback($_);
	       return wantarray ? @features :\@ features;
	   }
	   $hstrand = -1 if $1 eq 'reversed';
	   $qstrand = -1 if $4 eq 'REVERSED GENE';
	   $self->debug( "1=$1, 2=$2, 4=$4\n");
       }
       elsif( /^Exon/ ) {
	   my ($name,$len,$score,$qstart,$qend,$qseqname,
	       $hstart,$hend, $hseqname) = split;
	   $lasthseqname = $hseqname;
	   my $query = new Bio::SeqFeature::Similarity(-primary => $name,
						       -source  => $self->analysis_method,
						       -seq_id => $qseqname, # FIXME WHEN WE REDO THE GENERIC NAME CHANGE
-start => $qstart, -end => $qend, -strand => $qstrand, -score => $score, -tag => { # 'Location' => "$hstart..$hend",
'Sequence' => "$hseqname", } ); my $hit = new Bio::SeqFeature::Similarity(-primary => 'exon_hit', -source => $self->analysis_method, -seq_id => $hseqname, -start => $hstart, -end => $hend, -strand => $hstrand, -score => $score, -tag => { # 'Location' => "$qstart..$qend",
'Sequence' => "$qseqname", } ); push @features, new Bio::SeqFeature::SimilarityPair (-query => $query, -hit => $hit, -source => $self->analysis_method); } elsif( /^([\-\+\?])(Intron)/) { my ($name,$len,$score,$qstart,$qend,$qseqname) = split; push @features, new Bio::SeqFeature::Generic(-primary => $2, -source => $self->analysis_method, -start => $qstart, -end => $qend, -strand => $qstrand, -score => $score, -seq_id => $qseqname, -tag => { 'Sequence' => $lasthseqname}); } elsif( /^Span/ ) { } elsif( /^Segment/ ) { $seensegment = 1; } elsif( /^\s+$/ ) { # do nothing
} else { $self->warn( "unknown line $_\n"); } } return undef unless( @features ); return wantarray ? @features :\@ features;
}
General documentation
FEEDBACKTop
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.
  bioperl-l@bioperl.org              - General discussion
http://bioperl.org/MailList.shtml - About the mailing lists
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via
email or the web:
  bioperl-bugs@bioperl.org
http://bugzilla.bioperl.org/
AUTHOR - Jason StajichTop
Email jason@bioperl.org
Describe contact details here
CONTRIBUTORSTop
Additional contributors names and emails here
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _
newTop
 Title   : new
Usage : my $obj = new Bio::Tools::Est2Genome();
Function: Builds a new Bio::Tools::Est2Genome object
Returns : an instance of Bio::Tools::Est2Genome
Args : -file => 'output.est2genome' or
-fh => \*EST2GENOMEOUTPUT
-genomefirst => 1 # genome was the first input (not standard)