Bio::T...Results(3pm)
π Bio::Tools::Sim4::Results π
okay bestie, so this is the manual page for Bio::Tools::Sim4::Results, straight out of the User Contributed Perl Documentation collection (iykyk, it's a Perl module page). Sit down, hydrate, and let's get into it. π«Ά
β¨ NAME β¨
Bio::Tools::Sim4::Results β literally just the results of one Sim4 run. one run. that's the whole vibe. π
πΈ SYNOPSIS πΈ
okay so here's the whole flow, copy-paste ready, no cap:
# to preset the order of EST and genomic file as given on the sim4
# command line:
my $sim4 = Bio::Tools::Sim4::Results->new(-file => 'result.sim4',
-estfirst => 1);
# to let the order be determined automatically (by length comparison):
$sim4 = Bio::Tools::Sim4::Results->new( -file => 'sim4.results' );
# filehandle:
$sim4 = Bio::Tools::Sim4::Results->new( -fh => \*INPUT );
# parse the results
while(my $exonset = $sim4->next_exonset()) {
# $exonset is-a Bio::SeqFeature::Generic with Bio::Tools::Sim4::Exons
# as sub features
print "Delimited on sequence ", $exonset->seq_id(),
"from ", $exonset->start(), " to ", $exonset->end(), "\n";
foreach my $exon ( $exonset->sub_SeqFeature() ) {
# $exon is-a Bio::SeqFeature::FeaturePair
print "Exon from ", $exon->start, " to ", $exon->end,
" on strand ", $exon->strand(), "\n";
# you can get out what it matched using the est_hit attribute
my $homol = $exon->est_hit();
print "Matched to sequence ", $homol->seq_id,
" at ", $homol->start," to ", $homol->end, "\n";
}
}
# essential if you gave a filename at initialization (otherwise the file
# stays open)
$sim4->close();
β οΈ bestie, do NOT skip that close() if you passed in a filename at init time β otherwise the file just sits there open, being dramatic. π
π¦ DESCRIPTION π¦
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 make this module work sensibly you need to run
sim4 genomic.fasta est.database.fasta
or
sim4 est.fasta genomic.database.fasta
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. π (yes it's a little cursed, we know)
See the documentation of parse_next_alignment() for abilities of the parser to deal with the different output format options of sim4.
π FEEDBACK π
π Mailing Lists
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. (fr fr, they want to hear from you π)
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
π«Ά Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
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.
π Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
β AUTHOR - Ewan Birney, Hilmar Lapp β
Ewan Birney <birney-at-sanger.ac.uk> Hilmar Lapp <hlapp-at-gmx.net> or <hilmar.lapp-at-pharma.novartis.com>.
(the legends themselves, we stan π)
π APPENDIX π
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ (so if you see one of those, mind your business, it's internal π).
π§ analysis_method
- Usage β
$sim4->analysis_method(); - Purpose β Inherited method. Overridden to ensure that the name matches
/sim4/i. - Returns β String
- Argument β n/a
π₯ parse_next_alignment
- 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::Exonobjects. 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 β (none given, bestie, it's a vibe)
- Returns β An array of
Bio::Tools::Sim4::Exonobjects - Args β (n/a)
π next_exonset
- 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::Genericobject, with theBio::Tools::Sim4::Exonobjects 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 β (none, again π)
- Returns β An
Bio::SeqFeature::Genericobject holdingBio::Tools::Sim4::Exonobjects as sub features. - Args β (n/a)
π next_feature
- Title β next_feature
- Usage β
while($exonset = $sim4->next_feature()) {
# do something
}
- Function β Does the same as
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 β (you guessed it, none)
- Returns β A
Bio::SeqFeature::Genericobject. - Args β (n/a)
and that's the whole page, bestie!! π this one shipped as part of perl v5.32.1, dated 2021-08-15 β so go forth, parse those sim4 results, and slay π β¨π¦
π¦ where this page comes from
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms