[Bio] / FigKernelPackages / FigFam.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FigFam.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.56, Thu Jun 28 23:06:21 2007 UTC revision 1.57, Sun Jul 1 16:22:17 2007 UTC
# Line 777  Line 777 
777  Returns C<TRUE> if the protein sequence in C<$seq> is judged to be  Returns C<TRUE> if the protein sequence in C<$seq> is judged to be
778  "similar enough" to the members of a family to potentially be included.  "similar enough" to the members of a family to potentially be included.
779    
780    I have added the "loose" argument as an optional last argument.  This means that
781    
782    C<< if ( $figfam_obj->should_be_member( $seq,0,1 ) ) { #...do something... } >>
783    
784    will return true, even if the input sequence is truncated (i.e., we do not force the
785    similarity to go across 80% of matched sequences in the family).
786    
787  =cut  =cut
788    
789  sub should_be_member {  sub should_be_member {
790      my($self,$seq,$debug) = @_;      my($self,$seq,$debug,$loose) = @_;
791    
792      if ($debug) {      if ($debug) {
793          $ENV{DEBUG}   = 1;          $ENV{DEBUG}   = 1;
# Line 828  Line 835 
835          my $matched2 = abs($sim->[9] - $sim->[8]) + 1;          my $matched2 = abs($sim->[9] - $sim->[8]) + 1;
836          my $ln2 = $self->{peg_lengths}->{$peg};          my $ln2 = $self->{peg_lengths}->{$peg};
837    
838          if ((! $seen{$peg}) && ($sc <= 1.0e-10) &&          if ((! $seen{$peg}) &&
839                ($loose ||
840                 (($sc <= 1.0e-10) &&
841              ($matched1 >= (0.8 * $ln1)) &&              ($matched1 >= (0.8 * $ln1)) &&
842              ($matched2 >= (0.8 * $ln2)))              ($matched2 >= (0.8 * $ln2)))
843                )
844               )
845          {          {
846              $seen{$peg} = 1;              $seen{$peg} = 1;
847              push @$sim, $query_ln, $self->{peg_lengths}->{$peg};              push @$sim, $query_ln, $self->{peg_lengths}->{$peg};
# Line 840  Line 851 
851              my $bounds = $self->{bounds}->{$peg};              my $bounds = $self->{bounds}->{$peg};
852              if ($bounds && (@$sims <= 10))              if ($bounds && (@$sims <= 10))
853              {              {
854                  if (($bit_score >= $bounds->[1]) && ((! $bounds->[2]) || $bounds->[3] < $bit_score))                  if ((($bit_score >= $bounds->[1]) && ((! $bounds->[2]) || $bounds->[3] < $bit_score)) ||
855                        ($loose &&
856                         ((($bit_score/$ln1) >= ($bounds->[1] / $ln2)) &&
857                          ((! $bounds->[2]) || (($bounds->[3]/$ln2) < ($bit_score/$ln1))))))
858                  {                  {
859                      if ($ENV{DEBUG}) { print STDERR "    yes - $peg matched1=$matched1 ln1=$ln1 matched2=$matched2 ln2=$ln2\n" }                      if ($ENV{DEBUG}) { print STDERR "    yes - $peg matched1=$matched1 ln1=$ln1 matched2=$matched2 ln2=$ln2\n" }
860                      ++$yes;                      ++$yes;
# Line 875  Line 889 
889      return ($good,$sims);      return ($good,$sims);
890  }  }
891    
   
   
892  =head3 family_function  =head3 family_function
893    
894  usage:  usage:

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3