1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
print "\nParcourt du dossier $path et recuperation des infos\n";
find(\&Analyse_results,"$path");
print "\nGeneration des fichiers de resultats\n";
foreach my $concept(keys(%infos_p_value))
{
print "Concept $concept :\n\tTaille = ".$infos_p_value{$concept}->{"taille"}."\n\tPourcentage de genes auto-regule = ".$infos_p_value{$concept}->{"pourcent"}."\n";
print "GOBIOL : \n";
foreach my $p (@{$infos_p_value{$concept}->{"gobiol"}})
{
print "\t".$p->{'p-value'}." => ".$p->{'nb_match'}."\n";
}
print "GOMOLE : \n";
foreach my $p (@{$infos_p_value{$concept}->{"gomole"}})
{
print "\t".$p->{'p-value'}." => ".$p->{'nb_match'}."\n";
}
print "L2LMDB : \n";
foreach my $p (@{$infos_p_value{$concept}->{"l2lmdb"}})
{
print "\t".$p->{'p-value'}." => ".$p->{'nb_match'}."\n";
}
}
$T2 = time();
$T = ($T2 - $T1);
sub Analyse_results
{
my ($pourcent, $concept_id, $type, $nb_match, $taille);
#sur chaque fichier trouve
if (-f $_ && $_ =~ m/L2L_concept(\d+)_(\d+)_.+_([a-z2]+)\.html/)
{
$pourcent = $1;
$concept_id = $2;
$type = $3;
print "$type\n";
$taille = $taille_concepts{$concept_id};
$infos_p_value{$concept_id} = {"pourcent" => $pourcent, "taille" => $taille, "gobiol" =>[], "gomole" =>[], "l2lmdb" => []};
open(L2L, "<$_") or die("Impossible d'ouvrir $_");
my ($line, $p_value);
my $garder = 0;
my $entry = 0;
while(defined($line=<L2L>))
{
if($line =~ m/<tr class="entry">/)
{
$entry = 1;
}
elsif($line =~ m/>(\d+)<\/a><\/td>/ && $entry == 1)
{
$nb_match = $1;
}
elsif($line =~ m/<td>(\d{1}\.\d{2}e-\d{2})<\/td>/ && $entry == 1)
{
$p_value = $1;
push(@{$infos_p_value{$concept_id}->{$type}}, {"p-value" => $p_value, "nb_match" => $nb_match});
$entry = 0;
}
}
close(L2L);
}
} |
Partager