[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.106, Tue Jun 1 20:45:39 2004 UTC revision 1.107, Wed Jun 2 09:23:35 2004 UTC
# Line 1318  Line 1318 
1318          $relational_db_response = $rdbH->SQL("SELECT genome,maindomain  FROM genome");          $relational_db_response = $rdbH->SQL("SELECT genome,maindomain  FROM genome");
1319      }      }
1320    
1321      my ($a,$b,$e,$v) = (0,0,0,0);      my ($arch, $bact, $euk, $vir, $env, $unk) = (0, 0, 0, 0, 0, 0);
1322      if (@$relational_db_response > 0)      if (@$relational_db_response > 0)
1323      {      {
1324          foreach $x (@$relational_db_response)          foreach $x (@$relational_db_response)
1325          {          {
1326              if    ($x->[1] =~ /^a/i) { $a++ }              if    ($x->[1] =~ /^archaea/i)  { ++$arch }
1327              elsif ($x->[1] =~ /^b/i) { $b++ }              elsif ($x->[1] =~ /^bacter/i)   { ++$bact }
1328              elsif ($x->[1] =~ /^e/i) { $e++ }              elsif ($x->[1] =~ /^eukar/i)    { ++$euk }
1329              elsif ($x->[1] =~ /^v/i) { $v++ }              elsif ($x->[1] =~ /^vir/i)      { ++$vir }
1330                elsif ($x->[1] =~ /^env/i)      { ++$env }
1331                else  { ++$unk }
1332          }          }
1333      }      }
1334    
1335      return ($a,$b,$e,$v);      return ($arch, $bact, $euk, $vir, $env, $unk);
1336    }
1337    
1338    
1339    =pod
1340    
1341    =head1 genome_domain
1342    
1343    usage: $domain = $fig->genome_domain($genome_id);
1344    
1345    Returns the domain of a genome ID, and 'undef' if it is not in the database.
1346    
1347    =cut
1348    
1349    sub genome_domain {
1350        my($self,$genome) = @_;
1351        my $relational_db_response;
1352        my $rdbH = $self->db_handle;
1353    
1354        if ($genome)
1355        {
1356            if (($relational_db_response = $rdbH->SQL("SELECT genome,maindomain FROM genome WHERE ( genome = \'$genome\' )"))
1357                && (@$relational_db_response == 1))
1358            {
1359                # die Dumper($relational_db_response);
1360                return $relational_db_response->[0]->[1];
1361            }
1362        }
1363        return undef;
1364  }  }
1365    
1366    
# Line 1338  Line 1368 
1368    
1369  =head1 genome_pegs  =head1 genome_pegs
1370    
1371  usage: $pegs = $fig->genome_pegs($genome_id);  usage: $num_pegs = $fig->genome_pegs($genome_id);
1372    
1373  Returns the number of DNA base-pairs in the genome contigs file(s) if  Returns the number of protein-encoding genes (PEGs) in $genome_id if
1374  "$genome_id" is in the "genome" database, and 'undef' otherwise.  "$genome_id" is indexed in the "genome" database, and 'undef' otherwise.
1375    
1376  =cut  =cut
1377    
# Line 1366  Line 1396 
1396    
1397  =head1 genome_rnas  =head1 genome_rnas
1398    
1399  usage: $rnas = $fig->genome_rnas($genome_id);  usage: $num_rnas = $fig->genome_rnas($genome_id);
1400    
1401  Returns the number of DNA base-pairs in the genome contigs file(s) if  Returns the number of RNA-encoding genes (RNAs) in $genome_id if
1402  "$genome_id" is in the "genome" database, and 'undef' otherwise.  "$genome_id" is indexed in the "genome" database, and 'undef' otherwise.
1403    
1404  =cut  =cut
1405    
# Line 1396  Line 1426 
1426    
1427  usage: $szdna = $fig->genome_szdna($genome_id);  usage: $szdna = $fig->genome_szdna($genome_id);
1428    
1429  Returns the number of DNA base-pairs in the genome contigs file(s) if  Returns the number of DNA base-pairs in the genome contigs file(s) of $genome_id
1430  "$genome_id" is in the "genome" database, and 'undef' otherwise.  "$genome_id" is indexed in the "genome" database, and 'undef' otherwise.
1431    
1432  =cut  =cut
1433    

Legend:
Removed from v.1.106  
changed lines
  Added in v.1.107

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3