[Bio] / FigKernelScripts / server_paper_example4.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/server_paper_example4.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download) (as text)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :     use strict;
3 :     use SAPserver;
4 :     use COserver;
5 : parrello 1.2 use SeedUtils;
6 : parrello 1.1
7 :     my $sapObject = SAPserver->new();
8 :     my $coObject = COserver->new();
9 :    
10 :     my $genomeHash = $sapObject->all_genomes(-complete => 1);
11 :     for my $genome (keys %$genomeHash) {
12 :     my $genomeName = $genomeHash->{$genome};
13 :     my $geneHash = $sapObject->feature_assignments(-genome => $genome,
14 : parrello 1.2 -type => 'peg');
15 :     my @hypotheticalGenes = grep { &SeedUtils::hypo($geneHash->{$_}) } sort keys %$geneHash;
16 : parrello 1.1 my $couplingHash = $coObject->conserved_in_neighborhood(-ids => \@hypotheticalGenes,
17 :     -hash => 1);
18 :     for my $gene (@hypotheticalGenes) {
19 :     my $couplingList = $couplingHash->{$gene};
20 :     if (defined $couplingList) {
21 :     my $subHash = $sapObject->ids_to_subsystems(-ids => [ map { $_->[1]} @$couplingList ]);
22 :     my ($bestCoupler, $bestScore, $bestFunction) = (undef, 0, '');
23 :     for my $coupling (@$couplingList) {
24 :     my ($score, $coupler, $function) = @$coupling;
25 :     if ($subHash->{$coupler} && $score > $bestScore) {
26 :     $bestCoupler = $coupler;
27 :     $bestScore = $score;
28 :     $bestFunction = $function;
29 :     }
30 :     }
31 :     if (defined $bestCoupler) {
32 :     print join("\t", $gene, $geneHash->{$gene}, $genome, $genomeName,
33 :     $bestCoupler, $bestScore, $bestFunction) . "\n";
34 :     }
35 :     }
36 :     }
37 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3