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

Diff of /FigKernelPackages/FIG.pm

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

revision 1.162, Mon Oct 4 15:56:10 2004 UTC revision 1.163, Tue Oct 5 22:06:28 2004 UTC
# Line 3858  Line 3858 
3858      return @bbhs;      return @bbhs;
3859  }  }
3860    
3861    #
3862    # Return just the bbh's that are in the given organisms.
3863    #
3864    sub bbhs_in_org {
3865        my($self,$peg,$org_list,$cutoff,$frac_match) = @_;
3866        my($sim,$peg2,$genome2,$i,@sims2,%seen);
3867    
3868        if ($self->is_deleted_fid($peg)) { return () }
3869    
3870        $frac_match = defined($frac_match) ? $frac_match : 0;
3871    
3872        $cutoff = defined($cutoff) ? $cutoff : 1.0e-10;
3873        my @bbhs = ();
3874        my @precomputed = ();
3875        my $rdbH = $self->db_handle;
3876        my $relational_db_response = $rdbH->SQL("SELECT seek, others FROM bbhs WHERE peg = \'$peg\' ");
3877        if (@$relational_db_response == 1)
3878        {
3879            my($seek,$others) = @{$relational_db_response->[0]};
3880            if (open(CORES,"<$FIG_Config::global/bbh.cores"))
3881            {
3882                seek(CORES,$seek,0);
3883                $_ = <CORES>;
3884                close(CORES);
3885                chop;
3886                push(@precomputed,split(/,/,$_));
3887            }
3888            push(@precomputed,split(/,/,$others));
3889        }
3890    
3891        #
3892        # Extract just the ones in the org_list passed in.
3893        #
3894    
3895        my %org_map;
3896        map { $org_map{$_}++ } @$org_list;
3897    
3898        my %bbhs;
3899        for my $bbh (@precomputed)
3900        {
3901            $bbhs{$bbh} = 1 if ($bbh =~ /fig\|(\d+\.\d+)\./ && $org_map{$1});
3902        }
3903    
3904        foreach $sim ($self->sims($peg,10000,$cutoff,"fig"))
3905        {
3906            $peg2 = $sim->id2;
3907            my $frac = &FIG::min(($sim->e1+1 - $sim->b1) / $sim->ln1, ($sim->e2+1 - $sim->b2) / $sim->ln2);
3908            if ($bbhs{$peg2} && ($frac >= $frac_match))
3909            {
3910                push(@bbhs,[$peg2,$sim->psc]);
3911            }
3912        }
3913        return @bbhs;
3914    }
3915    
3916  =pod  =pod
3917    
3918  =head1 dsims  =head1 dsims

Legend:
Removed from v.1.162  
changed lines
  Added in v.1.163

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3