The sim4 module provides a parser and results object for sim4 output. The sim4 results are specialised types of SeqFeatures, meaning you can add them to AnnSeq objects fine, and manipulate them in the "normal" seqfeature manner.

The sim4 Exon objects are Bio::SeqFeature::FeaturePair inherited objects. The $esthit = $exon->est_hit() is the alignment as a feature on the matching object (normally, an EST), in which the start/end points are where the hit lies.

To get the sequence identifiers recorded for the first sequence, too, use A=4 as output option for sim4.

One fiddle here is that there are only two real possibilities to the matching criteria: either one sequence needs reversing or not. Because of this, it is impossible to tell whether the match is in the forward or reverse strand of the genomic DNA. We solve this here by assuming that the genomic DNA is always forward. As a consequence, the strand attribute of the matching EST is unknown, and the strand attribute of the genomic DNA (i.e., the Exon object) will reflect the direction of the hit.

See the documentation of parse_next_alignment() for abilities of the parser to deal with the different output format options of sim4.

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.

rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.

Title : parse_next_alignment
Usage : @exons = $sim4_result->parse_next_alignment;
foreach $exon (@exons) {
# do something
}
Function: Parses the next alignment of the Sim4 result file and returns the
found exons as an array of Bio::Tools::Sim4::Exon 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 if A=4 was used in the sim4
run, and otherwise for the second sequence only. If the output does
not contain the identifier, the filename stripped of path and
extension is used instead. In addition, the full filename
will be recorded for both features ($exon inherits off
Bio::SeqFeature::SimilarityPair) as tag 'filename'. The length
is accessible via the seqlength() attribute of $exon->query() and
$exon->est_hit().
Note that this method is capable of dealing with outputs generated
with format 0,1,3, and 4 (via the A=n option to sim4). It
automatically determines which of the two sequences has been
reversed, and adjusts the coordinates for that sequence. It will
also detect whether the EST sequence(s) were given as first or as
second file to sim4, unless this has been specified at creation
time of the object.
Example :
Returns : An array of Bio::Tools::Sim4::Exon objects
Args :

Title : next_exonset
Usage : $exonset = $sim4_result->parse_next_exonset;
print "Exons start at ", $exonset->start(),
"and end at ", $exonset->end(), "\n";
foreach $exon ($exonset->sub_SeqFeature()) {
# do something
}
Function: Parses the next alignment of the Sim4 result file and returns the
set of exons as a container of features. The container is itself
a Bio::SeqFeature::Generic object, with the Bio::Tools::Sim4::Exon
objects as sub features. Start, end, and strand of the container
will represent the total region covered by the exons of this set.
See the documentation of parse_next_alignment() for further
reference about parsing and how the information is stored.
Example :
Returns : An Bio::SeqFeature::Generic object holding Bio::Tools::Sim4::Exon
objects as sub features.
Args :

Title : next_feature
Usage : while($exonset = $sim4->next_feature()) {
# do something
}
Function: Does the same as L<next_exonset()>. See there for documentation of
the functionality. Call this method repeatedly until FALSE is
returned.
The returned object is actually a SeqFeatureI implementing object.
This method is required for classes implementing the
SeqAnalysisParserI interface, and is merely an alias for
next_exonset() at present.
Example :
Returns : A Bio::SeqFeature::Generic object.
Args :