[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.296, Mon Jun 20 17:08:32 2005 UTC revision 1.297, Mon Jun 20 21:58:56 2005 UTC
# Line 17  Line 17 
17  use Construct;  use Construct;
18  use FIGRules;  use FIGRules;
19  use Tracer;  use Tracer;
20    use GenomeIDMap;
21    
22  eval { require FigGFF; };  eval { require FigGFF; };
23  if ($@ and $ENV{USER} eq "olson") {  if ($@ and $ENV{USER} eq "olson") {
# Line 4674  Line 4675 
4675              (@$relational_db_response == 1)) ? 1 : 0;              (@$relational_db_response == 1)) ? 1 : 0;
4676  }  }
4677    
4678    
4679    =head3 map_peg_to_ids
4680    
4681    C<<my $gnum, $pnum = $fig->map_peg_to_ids($peg)>>
4682    
4683    Map a peg ID to a pair of numbers describing that peg.
4684    
4685    In order to conserve storage and increase performance for some operations (the
4686    functional coupling computation, for instance), we provide a mechanism by which a full peg
4687    (of the form fig|X.Y.peg.Z) is mapped to a pair of integers: a genome number and a PEG
4688    index. We maintain a table genome_mapping that retains the mapping between genome ID
4689    and local genome number. No effort is expended to ensure this mapping is at all coherent
4690    between SEED instances; this is purely a local mechanism for performance enhancement.
4691    
4692    =over 4
4693    
4694    =item $peg
4695    
4696    ID of the peg to be mapped.
4697    
4698    =item RETURN
4699    
4700    A pair of numbers ($gnum, $pnum)
4701    
4702    =back
4703    
4704    =cut
4705    
4706    sub map_peg_to_ids
4707    {
4708        my($self, $peg) = @_;
4709    
4710        my $mapperc = $self->cached("_genome_mapper");
4711        my $mapper = $mapperc->{mapper_obj};
4712        if (!defined($mapper))
4713        {
4714            $mapper = new GenomeIDMap($self);
4715            $mapperc->{mapper_obj} = $mapper;
4716        }
4717    
4718        return $mapper->map_peg_to_nums($peg);
4719    }
4720    
4721    sub map_ids_to_peg
4722    {
4723        my($self, @ids) = @_;
4724    
4725        my $mapperc = $self->cached("_genome_mapper");
4726        my $mapper = $mapperc->{mapper_obj};
4727        if (!defined($mapper))
4728        {
4729            $mapper = new GenomeIDMap($self);
4730            $mapperc->{mapper_obj} = $mapper;
4731        }
4732    
4733        return $mapper->map_nums_to_peg(@ids);
4734    }
4735    
4736    sub map_genome_to_id
4737    {
4738    }
4739    
4740  ################ Routines to process functional coupling for PEGs  ##########################  ################ Routines to process functional coupling for PEGs  ##########################
4741    
4742  ################ Routines to process functional coupling for PEGs  ##########################  ################ Routines to process functional coupling for PEGs  ##########################

Legend:
Removed from v.1.296  
changed lines
  Added in v.1.297

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3