[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.3 - (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 :    
9 :     my $genomeHash = $sapObject->all_genomes(-complete => 1);
10 :     for my $genome (keys %$genomeHash) {
11 :     my $genomeName = $genomeHash->{$genome};
12 :     my $geneHash = $sapObject->feature_assignments(-genome => $genome,
13 : parrello 1.2 -type => 'peg');
14 :     my @hypotheticalGenes = grep { &SeedUtils::hypo($geneHash->{$_}) } sort keys %$geneHash;
15 : parrello 1.3 my $couplingHash = $sapObject->conserved_in_neighborhood(-ids => \@hypotheticalGenes,
16 :     -hash => 1);
17 : parrello 1.1 for my $gene (@hypotheticalGenes) {
18 :     my $couplingList = $couplingHash->{$gene};
19 :     if (defined $couplingList) {
20 :     my $subHash = $sapObject->ids_to_subsystems(-ids => [ map { $_->[1]} @$couplingList ]);
21 :     my ($bestCoupler, $bestScore, $bestFunction) = (undef, 0, '');
22 :     for my $coupling (@$couplingList) {
23 :     my ($score, $coupler, $function) = @$coupling;
24 :     if ($subHash->{$coupler} && $score > $bestScore) {
25 :     $bestCoupler = $coupler;
26 :     $bestScore = $score;
27 :     $bestFunction = $function;
28 :     }
29 :     }
30 :     if (defined $bestCoupler) {
31 :     print join("\t", $gene, $geneHash->{$gene}, $genome, $genomeName,
32 :     $bestCoupler, $bestScore, $bestFunction) . "\n";
33 :     }
34 :     }
35 :     }
36 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3