[Bioperl-l] frac_identical VS percent_identity

Jason Stajich jason at bioperl.org
Fri Mar 7 23:24:06 UTC 2014


frac_identical will return values 0 - > 1 and percent_identity will return
values 0 - 100

$result->query_length

Check out http://bioperl.org/wiki/HOWTO:SearchIO Table 2.1, 2.2, 2.3  can
be informative for these types of questions


Jason Stajich
jason at bioperl.org
http://bioperl.org/wiki/User:Jason
http://twitter.com/hyphaltip


On Thu, Mar 6, 2014 at 2:08 PM, Antony03 <antony.vincent.1 at ulaval.ca> wrote:

> Hi,
>
> What is the difference between $hsp->frac_identical and
> $hsp->percent_identity?
>
> I have a second question with this code:
> #!/usr/bin/perl
>
> use strict;
> use Bio::SearchIO;
> use Bio::SeqIO;
>
> my $library = 'lib.fas';
> my $query = 'query.fas';
> my $fh;
> my $fasta   = "fasta36";
>
> my $command = "$fasta $query $library -T 2";
>
> open $fh,"$command |" || die("cannot run fasta cmd of $command: $!\n");
>
> my $searchio  = Bio::SearchIO->new(-format => 'fasta', -fh => $fh);
> while( my $result = $searchio->next_result ) {
>   ## $result is a Bio::Search::Result::ResultI compliant object
>   while( my $hit = $result->next_hit ) {
>     ## $hit is a Bio::Search::Hit::HitI compliant object
>     while( my $hsp = $hit->next_hsp ) {
>       ## $hsp is a Bio::Search::HSP::HSPI compliant object
>       if( $hsp->length('total') > ??? ) {
>         if ( $hsp->percent_identity >= 95 ) {
>
> print $result->query_name , "\n";
>         }
>
>       }
>
>     }
>
>   }
>
> }
> Je veux avoir les résultats pour lesquels l'alignement possède une identité
> sur 95% de la longueur totale du query. How do I find the length of the
> query string (not the result query string). Is it clear?
>
> Thank!
>
>
>
> --
> View this message in context:
> http://bioperl.996286.n3.nabble.com/frac-identical-VS-percent-identity-tp17348.html
> Sent from the Bioperl-L mailing list archive at Nabble.com.
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list