That's exactly what I'm doing now....just regex parsing the similarity
line...didn't know if it was built into bioperl and I was just missing
it...
-----Original Message-----
From: Jason Stajich [mailto:jason.stajich at duke.edu]
Sent: Monday, August 15, 2005 12:04 PM
To: golharam at umdnj.edu
Cc: 'Bioperl List'
Subject: Re: [Bioperl-l] Bio::Align::AlignI for EMBOSS:needle
You could sort of figure it out by processing the match_line output
and counting the number of ':", '.', and '*' items and dividing by
the aln length.
If we did parse it - there isn't really anywhere to put that sort of
field right now in SimpleAlign.
I generally just have simple perl parser I run on needle/water output
to get the percent similar/identical stats and if I need the
alignment then parse it again with AlignIO;
Something like:
my %stats;
while(<$io>) {
if(/^\#\s+(Identity|Similarity|Gaps):\s+(\d+)\/(\d+)\s+\(\s*(\d+\.\d
+)\s*%\s*\)/ ) {
$stats{$1} = [$2,$3,$4];
}
}
$io->seek(0);
# process with AlignIO....
-jason
On Aug 15, 2005, at 11:38 AM, Ryan Golhar wrote:
> EMBOSS needle reports percent identity and percent similarity, however
> Bio::Align::AlignI has no method for obtain the percent similarity.
>> My code is essentially:
>> my $in = new Bio::AlignIO(-format => 'emboss', -fh => new
> IO::String($output)); my $aln = $in->next_aln;
> $fepct = $aln->overall_percentage_identity;
>> I tried the different percentage_identity methods to see if any of
> them
> work, but they don't give the similarity number. Is there a way to
> get
> the percent similarity through bioperl?
>> Also, the description part of the document for
> overall_percentage_identity has a type for the Title.
>> Ryan
>> _______________________________________________
> Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org>http://portal.open-bio.org/mailman/listinfo/bioperl-l>
--
Jason Stajich
Duke University
http://www.duke.edu/~jes12