[Bioperl-l] parsing sim4 results
Brian Osborne
brian_osborne at cognia.com
Fri Mar 14 15:06:23 EST 2003
Charles,
This is from the bptutorial:
use Bio::Tools::Sim4::Results;
$sim4 = new Bio::Tools::Sim4::Results(-file => 't/data/sim4.rev',
-estisfirst => 0);
# $exonset is-a Bio::SeqFeature::Generic with Bio::Tools::Sim4::Exons
# as sub features
$exonset = $sim4->next_exonset;
@exons = $exonset->sub_SeqFeature();
# $exon is-a Bio::SeqFeature::FeaturePair
$exon = 1;
$exonstart = $exons[$exon]->start();
$estname = $exons[$exon]->est_hit()->seqname();
$sim4->close();
Brian O.
-----Original Message-----
From: bioperl-l-bounces at bioperl.org [mailto:bioperl-l-bounces at bioperl.org]On
Behalf Of Charles Hauser
Sent: Friday, March 14, 2003 3:03 PM
To: BioPerl-List
Subject: [Bioperl-l] parsing sim4 results
All,
I'm trying to parse output from sim4 w/ script below.
Looking at docs, Bio::Tools::Sim4 has exon & results modules.
I get the error:Can't locate Bio/Tools/Sim4.pm in @INC, which of course
because there is no Sim4.pm.
Suggestions?
Charles
use strict;
use Bio::Tools::Sim4;
my $filename = shift @ARGV;
if( $filename =~ /\.gz/ ) {
open(FH, "zcat $filename |") || die("cannot run zcat on $filename:
$!");
} else {
open(FH, $filename) || die("cannot open $filename: $!");
}
print STDERR "Processing: ",$filename, "\n";
my $sim4 = Bio::Tools::Sim4->new( -fh => \*FH );
while(my $exonset = $sim4->next_exonset()) {
print "Delimited on sequence ", $exonset->seq_id(),
"from ", $exonset->start(), " to ", $exonset->end(), "\n";
foreach my $exon ( $exonset->sub_SeqFeature() ) {
print "Exon from ", $exon->start, " to ", $exon->end,
" on strand ", $exon->strand(), "\n";
my $homol = $exon->est_hit();
print "Matched to sequence ", $homol->seq_id,
" at ", $homol->start," to ", $homol->end, "\n";
}
}
_______________________________________________
Bioperl-l mailing list
Bioperl-l at bioperl.org
http://bioperl.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list