changeset 4:db4e1e6850b0 draft

Uploaded
author mgarnier
date Fri, 02 Jul 2021 17:32:59 +0000
parents 27c5a6f2301c
children 3d565ddc7b95
files pangenomeCogAnalysis_V1.pl
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pangenomeCogAnalysis_V1.pl	Fri Jul 02 14:54:40 2021 +0000
+++ b/pangenomeCogAnalysis_V1.pl	Fri Jul 02 17:32:59 2021 +0000
@@ -517,6 +517,8 @@
     close (G);
 }
 
+my %Hash_Convert = ( "A"=>1, "B"=>2, "C"=>3, "D"=>4, "E"=>5, "F"=>6, "G"=>7, "H"=>8, "I"=>9, "J"=>10, "K"=>11, "L"=>12, "M"=>13, "N"=>14, "O"=>15, "P"=>16, "Q"=>17, "R"=>18,"S"=>19, "T"=>20, "U"=>21, "V"=>22, "W"=>23, "X"=>24, "Y"=>25, "Z"=>26, "unknown"=>27);
+
 mkdir("Core");
 foreach my $i (keys (%coregenes2)){
 
@@ -532,7 +534,7 @@
 
 
     open (OUT5, "> Core/$strain_name.$specie_name.txt") or die "Cannot create file $!\n";
-    print OUT5 "Orthogroup\tGene\tChromosome\tStart\tEnd\tCOG categories\n";
+    print OUT5 "Orthogroup\tGene\tChromosome\tStart\tEnd\tCOG categories\tLetter assigned\n";
 
     my $refcoregenes2 = $coregenes2{$i};
     my %subhash = %$refcoregenes2;
@@ -549,7 +551,7 @@
         # if (!$subhash{$gene}){
         #     print "$gene\n";
         # }
-        print OUT5 $subhash{$gene}."\t"."$gene\t".$Gene_position{$gene}."\t".$cat."\n";
+        print OUT5 $subhash{$gene}."\t"."$gene\t".$Gene_position{$gene}."\t".$cat."\t".$Hash_Convert{$cat}."\n";
        
     }
 
@@ -568,7 +570,7 @@
     my $specie_name = $hSpecies{$strain_name};
 
     open (OUT6, "> GroupSpecific/$strain_name.$specie_name.txt") or die "Cannot create file $!\n";
-    print OUT6 "Orthogroup\tGene\tChromosome\tStart\tEnd\tCOG categories\n";
+    print OUT6 "Orthogroup\tGene\tChromosome\tStart\tEnd\tCOG categories\tLetter assigned\n";
 
     my $refGenes_of_OG = $Genes_of_OG{$i};
     my %subhash = %$refGenes_of_OG;
@@ -581,7 +583,7 @@
             if ($Cog_of_gene{$gene}){
                 $cat = $Cog_of_gene{$gene};
             }
-            print OUT6 $orthogroup."\t".$subhash{$orthogroup}."\t".$Gene_position{$gene}."\t".$cat."\n";
+            print OUT6 $orthogroup."\t".$subhash{$orthogroup}."\t".$Gene_position{$gene}."\t".$cat."\t".$Hash_Convert{$cat}."\n";
         }
         
     }