[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.579, Fri Mar 16 04:33:22 2007 UTC revision 1.580, Tue Apr 10 03:30:01 2007 UTC
# Line 3886  Line 3886 
3886    
3887  =head3 genome_szdna  =head3 genome_szdna
3888    
3889  usage: $szdna = $fig->genome_szdna($genome_id);  C<< my $szdna = $fig->genome_szdna($genome_id); >>
3890    
3891  Return the number of DNA base-pairs in a genome's contigs.  Return the number of DNA base-pairs in a genome's contigs.
3892    
# Line 4245  Line 4245 
4245      return "";      return "";
4246  }  }
4247    
4248    =head3 orgid_of_orgname
4249    
4250    C<< my $genomeID = $fig->orgid_of_orgname($genomeName); >>
4251    
4252    Return the ID of the genome corresponding to the specified organism name, or a
4253    null string if the genome is not found.
4254    
4255    =over 4
4256    
4257    =item genomeName
4258    
4259    Name of the organism, consisting of the organism's genus, species, and
4260    unique characterization, separated by spaces.
4261    
4262    =item RETURN
4263    
4264    Returns the genome ID number for the named organism, or an empty string if
4265    the genome is not found.
4266    
4267    =back
4268    
4269    =cut
4270    
4271  sub orgid_of_orgname {  sub orgid_of_orgname {
4272    my($self,$genome_name) = @_;    my($self,$genome_name) = @_;
4273    my $relational_db_response;    my $relational_db_response;
# Line 4449  Line 4472 
4472    
4473  sub wikipedia_link {  sub wikipedia_link {
4474    my ($self, $organism_name) = @_;    my ($self, $organism_name) = @_;
4475        return FIGRules::wikipedia_link($organism_name);
   my $link = undef;  
   my @organism_tokens = split(/\s/, $organism_name);  
   my $wikipedia_url = "http://en.wikipedia.org/wiki/";  
   my $curr_link = $wikipedia_url . $organism_tokens[0];  
   if (scalar(@organism_tokens) > 1) {  
     $curr_link .= "_" . $organism_tokens[1];  
   }  
   
   my $ua = new LWP::UserAgent;  
   
   my $res = $ua->get($curr_link);  
   if (not $res->is_success) {  
     print STDERR "Could not access Wikipedia\n";  
     return undef;  
   }  
   my $page = $res->content;  
   
   if ($page =~ /Wikipedia does not have an article with this exact name/) {  
     $curr_link = $wikipedia_url . $organism_tokens[0];  
     $res = $ua->get($curr_link);  
     $page = $res->content;  
     if ($page =~ /Wikipedia does not have an article with this exact name/) {  
       $link = undef;  
     } else {  
       $link = $curr_link;  
     }  
   } else {  
     $link = $curr_link;  
   }  
   
   return $link;  
4476  }  }
4477    
4478  =head3 ncbi_contig_description  =head3 ncbi_contig_description
# Line 5794  Line 5786 
5786      return \@features;      return \@features;
5787  }  }
5788    
5789    =head3 all_features_detailed_fast
5790    
5791    C<< my $featureList = $fig->all_features_detailed($genome, $min, $max, $contig); >>
5792    
5793    Returns a list of all features in the designated genome, with various useful information
5794    included.
5795    
5796    Deleted features are not returned!
5797    
5798    =over 4
5799    
5800    =item genome
5801    
5802    ID of the genome whose features are desired.
5803    
5804    =item min (optional)
5805    
5806    If specified, the minimum contig location of interest. Features not entirely to the right
5807    of this location are ignored.
5808    
5809    =item max (optional)
5810    
5811    If specified, the maximum contig location of interest. Features not entirely to the left
5812    of this location are ignore.
5813    
5814    =item contig (optional)
5815    
5816    If specified, the contig of interest. Features not on this contig are ignored.
5817    
5818    =item RETURN
5819    
5820    Returns a reference to a list of tuples. Each tuple consists of four elements: (1) the feature
5821    ID, (2) the feature location (as a comma-delimited list of location specifiers), (3) the feature
5822    aliases (as a comma-delimited list of named aliases), (4) the feature type, (5) the leftmost
5823    index of the feature's first location, (6) the rightmost index of the feature's last location,
5824    (7) the current functional assignment, (8) the user who made the assignment, and (9) the
5825    quality of the assignment (which is usually an empty string).
5826    
5827    =back
5828    
5829    =cut
5830    
5831  # does the same as the above, except using the advantage of a join statement  # does the same as the above, except using the advantage of a join statement
5832  # and including minloc and maxloc as well as the function, annotator and quality  # and including minloc and maxloc as well as the function, annotator and quality
5833  sub all_features_detailed_fast {  sub all_features_detailed_fast {
# Line 7747  Line 7781 
7781      return $initial_filter;      return $initial_filter;
7782  }  }
7783    
7784  =head3 sims  =head3 osims
7785    
7786  usage: @sims = $fig->sims($peg,$maxN,$maxP,$select,$max_expand, $filters)  usage: @sims = $fig->osims($peg,$maxN,$maxP,$select,$max_expand, $filters)
7787    
7788  Returns a list of similarities for $peg such that  Returns a list of similarities for $peg such that
7789    
# Line 12996  Line 13030 
13030      return sort keys(%subs);      return sort keys(%subs);
13031  }  }
13032    
13033    =head3 protein_subsystem_to_roles
13034    
13035    C<< my $roles = $fig->protein_subsystem_to_roles($peg, $subsystem); >>
13036    
13037    Return the roles played by a particular PEG in a particular subsytem. If the protein is not part of the
13038    subsystem, an empty list will be returned.
13039    
13040    =over 4
13041    
13042    =item peg
13043    
13044    ID of the protein whose role is desired.
13045    
13046    =item subsystem
13047    
13048    Name of the relevant subsystem.
13049    
13050    =item RETURN
13051    
13052    Returns a reference to a list of the roles performed by the specified PEG in the specified subsystem.
13053    
13054    =back
13055    
13056    =cut
13057    
13058  sub protein_subsystem_to_roles {  sub protein_subsystem_to_roles {
13059      my($self,$prot, $subsystem) = @_;      my($self,$prot, $subsystem) = @_;
13060    
# Line 13047  Line 13106 
13106    
13107  =head3 seqs_with_role  =head3 seqs_with_role
13108    
13109  usage: @pegs = $fig->seqs_with_role($role,$who)  C<< my @pegs = $fig->seqs_with_role($role,$who); >>
13110    
13111  Returns a list of the pegs that implement $role.  If $who is not given, it  Return a list of the pegs that implement $role.  If $who is not given, it
13112  defaults to "master".  The system returns all pegs with an assignment made by  defaults to "master".  The system returns all pegs with an assignment made by
13113  either "master" or $who (if it is different than the master) that implement $role.  either "master" or $who (if it is different than the master) that implement $role.
13114  Note that this includes pegs for which the "master" annotation disagrees with that  Note that this includes pegs for which the "master" annotation disagrees with that
# Line 14638  Line 14697 
14697    
14698  =head3 all_subsystems  =head3 all_subsystems
14699    
14700  Return a list of all subsystems.  C<< my @names = $fig->all_subsystems(); >>
14701    
14702    Return a list of all of the subsystems in the data store.
14703    
14704  =cut  =cut
14705    

Legend:
Removed from v.1.579  
changed lines
  Added in v.1.580

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3