[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.310, Tue Jul 12 22:10:07 2005 UTC revision 1.311, Wed Jul 13 01:49:54 2005 UTC
# Line 3324  Line 3324 
3324    
3325  Return a list of genome IDs that match a partial genus.  Return a list of genome IDs that match a partial genus.
3326    
3327  For example partial_genus_matching("Listeria") will return all genome IDs that begin with Listeria  For example partial_genus_matching("Listeria") will return all genome IDs that begin with Listeria, and this can also be restricted to complete genomes with another argument like this partial_genus_matching("Listeria", 1)
3328    
3329  =cut  =cut
3330    
3331  sub partial_genus_matching {  sub partial_genus_matching {
3332   my ($self, $gen)=@_;   my ($self, $gen, $complete)=@_;
3333   return grep {$self->genus_species($_) =~ /$gen/i} $self->genomes();   return grep {$self->genus_species($_) =~ /$gen/i} $self->genomes($complete);
3334  }  }
3335    
3336    
# Line 7474  Line 7474 
7474    
7475  =head2 protein families  =head2 protein families
7476    
7477  In the protein families we have our own concept of an id that I have called an eid. This is entirely internal and does not map to any known database except our own, however it is used to store the correspondence between different protein families. Therefore, to find out what family any protein is in you need to convert that protein to an eid. You can start with a KEGG, COG, TIGR, SP, GI, or FIG id, and get an eid back. From there, you can find out what other proteins that eid maps to, and what families that protein is also in.  In the protein families we have our own concept of an id that I have called an cid. This is entirely internal and does not map to any known database except our own, however it is used to store the correspondence between different protein families. Therefore, to find out what family any protein is in you need to convert that protein to an cid. You can start with a KEGG, COG, TIGR, SP, GI, or FIG id, and get an cid back. From there, you can find out what other proteins that cid maps to, and what families that protein is also in.
7478    
7479  =head3 all_protein_families  =head3 all_protein_families
7480    
# Line 7506  Line 7506 
7506  This takes any type of protein identifier (e.g. fig, swissprot, kegg, etc) and returns an array of families that this protein is in.  This takes any type of protein identifier (e.g. fig, swissprot, kegg, etc) and returns an array of families that this protein is in.
7507    
7508  Notes:  Notes:
7509  1. This is really a wrapper to prot_to_eid and then in_family, but this is what you will likely use most of the time  1. This is really a wrapper to prot_to_cid and then in_family, but this is what you will likely use most of the time
7510    
7511  =cut  =cut
7512    
7513  sub families_for_protein {  sub families_for_protein {
7514   my($self, $peg)=@_;   my($self, $peg)=@_;
7515   return unless ($peg);   return unless ($peg);
7516   my $eid=$self->prot_to_eid($peg);   my $cid=$self->prot_to_cid($peg);
7517   return unless ($eid);   return unless ($cid);
7518   return $self->in_family($eid);   return $self->in_family($cid);
7519  }  }
7520    
7521  =head3 proteins_in_family  =head3 proteins_in_family
# Line 7532  Line 7532 
7532   my($self, $family)=@_;   my($self, $family)=@_;
7533   return unless ($family);   return unless ($family);
7534   my @prots;   my @prots;
7535   foreach my $eid ($self->ids_in_family($family)) {   foreach my $cid ($self->ids_in_family($family)) {
7536    push @prots, $self->eid_to_prots($eid);    push @prots, $self->cid_to_prots($cid);
7537   }   }
7538   # note that some proteins may be duplicated, so we flatten this array and return only those things that are unique   # note that some proteins may be duplicated, so we flatten this array and return only those things that are unique
7539   my %seen; # only return the first occurence of anyting.   my %seen; # only return the first occurence of anyting.
# Line 7587  Line 7587 
7587      return 0;      return 0;
7588  }  }
7589    
7590  =head3 all_eids  =head3 all_cids
7591    
7592  usage: @all_eids=$fig->all_eids();  usage: @all_cids=$fig->all_cids();
7593    
7594  Returns a list of all the ids we know about.  Returns a list of all the ids we know about.
7595    
7596  =cut  =cut
7597    
7598  sub all_eids {  sub all_cids {
7599      my($self) = @_;      my($self) = @_;
7600    
7601      my($relational_db_response);      my($relational_db_response);
# Line 7614  Line 7614 
7614    
7615  usage: @pegs = $fig->ids_in_family($family)  usage: @pegs = $fig->ids_in_family($family)
7616    
7617  Returns a list of the eids in $family.  Returns a list of the cids in $family.
7618    
7619  =cut  =cut
7620    
# Line 7636  Line 7636 
7636    
7637  =head3 in_family  =head3 in_family
7638    
7639  usage: @families = $fig->in_family($eid)  usage: @families = $fig->in_family($cid)
7640    
7641  Returns an array containing the families containing an eid.  Returns an array containing the families containing an cid.
7642    
7643  =cut  =cut
7644    
# Line 7657  Line 7657 
7657      return ();      return ();
7658  }  }
7659    
7660  #prot_to_cid  =head3 prot_to_cid
 #usage: convert a protein to a global ID  
 #Note that this is not the same cid as GenBank uses, it is unique to our database. Because of this, this method is deprecated and should be called as eid instead.  
   
 sub prot_to_cid {  
  return &prot_to_eid(@_);  
 }  
   
 =head3 prot_to_eid  
7661    
7662  Convert a protein to a global ID  Convert a protein to a global ID
7663  my $eid=$fig->prot_to_eid($proteinid)  my $cid=$fig->prot_to_cid($proteinid)
7664    
7665  $proteinid can be a FIG ID, a SP, tigr, or one of many other IDs  $proteinid can be a FIG ID, a SP, tigr, or one of many other IDs
7666    
# Line 7677  Line 7669 
7669  =cut  =cut
7670    
7671    
7672  sub prot_to_eid {  sub prot_to_cid {
7673      my($self,$prot) = @_;      my($self,$prot) = @_;
7674    
7675      my($relational_db_response);      my($relational_db_response);
# Line 7692  Line 7684 
7684      return "";      return "";
7685  }  }
7686    
7687  #cid_to_prots  =head3 cid_to_prots
 # deprecated to eid_to_prots (see above)  
   
 sub cid_to_prots {  
  return eid_to_prots(@_);  
 }  
   
 =head3 eid_to_prots  
7688    
7689  Convert an internal ID to the proteins that map to that ID.  Convert an internal ID to the proteins that map to that ID.
7690  my @proteins=$fig->eid_to_prots($eid);  my @proteins=$fig->cid_to_prots($cid);
7691    
7692  =cut  =cut
7693    
7694  sub eid_to_prots {  sub cid_to_prots {
7695      my($self,$cid) = @_;      my($self,$cid) = @_;
7696    
7697      my($relational_db_response);      my($relational_db_response);

Legend:
Removed from v.1.310  
changed lines
  Added in v.1.311

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3