Mercurial > repos > mgarnier > pangenome_cog_analysis
comparison pangenomeCogAnalysis_V1.pl @ 4:db4e1e6850b0 draft
Uploaded
author | mgarnier |
---|---|
date | Fri, 02 Jul 2021 17:32:59 +0000 |
parents | 0428ce25da81 |
children | 3d565ddc7b95 |
comparison
equal
deleted
inserted
replaced
3:27c5a6f2301c | 4:db4e1e6850b0 |
---|---|
515 } | 515 } |
516 | 516 |
517 close (G); | 517 close (G); |
518 } | 518 } |
519 | 519 |
520 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); | |
521 | |
520 mkdir("Core"); | 522 mkdir("Core"); |
521 foreach my $i (keys (%coregenes2)){ | 523 foreach my $i (keys (%coregenes2)){ |
522 | 524 |
523 if (!$hCol_Annotated{$i}) { # si le fichier GFF n'existe pas | 525 if (!$hCol_Annotated{$i}) { # si le fichier GFF n'existe pas |
524 next; | 526 next; |
530 my $specie_name = $hSpecies{$strain_name}; | 532 my $specie_name = $hSpecies{$strain_name}; |
531 | 533 |
532 | 534 |
533 | 535 |
534 open (OUT5, "> Core/$strain_name.$specie_name.txt") or die "Cannot create file $!\n"; | 536 open (OUT5, "> Core/$strain_name.$specie_name.txt") or die "Cannot create file $!\n"; |
535 print OUT5 "Orthogroup\tGene\tChromosome\tStart\tEnd\tCOG categories\n"; | 537 print OUT5 "Orthogroup\tGene\tChromosome\tStart\tEnd\tCOG categories\tLetter assigned\n"; |
536 | 538 |
537 my $refcoregenes2 = $coregenes2{$i}; | 539 my $refcoregenes2 = $coregenes2{$i}; |
538 my %subhash = %$refcoregenes2; | 540 my %subhash = %$refcoregenes2; |
539 foreach my $gene (keys (%subhash)){ | 541 foreach my $gene (keys (%subhash)){ |
540 # print "$gene\n"; | 542 # print "$gene\n"; |
547 # } | 549 # } |
548 | 550 |
549 # if (!$subhash{$gene}){ | 551 # if (!$subhash{$gene}){ |
550 # print "$gene\n"; | 552 # print "$gene\n"; |
551 # } | 553 # } |
552 print OUT5 $subhash{$gene}."\t"."$gene\t".$Gene_position{$gene}."\t".$cat."\n"; | 554 print OUT5 $subhash{$gene}."\t"."$gene\t".$Gene_position{$gene}."\t".$cat."\t".$Hash_Convert{$cat}."\n"; |
553 | 555 |
554 } | 556 } |
555 | 557 |
556 close (OUT5); | 558 close (OUT5); |
557 } | 559 } |
566 my $strain_name = $hCol_Annotated{$i}; | 568 my $strain_name = $hCol_Annotated{$i}; |
567 | 569 |
568 my $specie_name = $hSpecies{$strain_name}; | 570 my $specie_name = $hSpecies{$strain_name}; |
569 | 571 |
570 open (OUT6, "> GroupSpecific/$strain_name.$specie_name.txt") or die "Cannot create file $!\n"; | 572 open (OUT6, "> GroupSpecific/$strain_name.$specie_name.txt") or die "Cannot create file $!\n"; |
571 print OUT6 "Orthogroup\tGene\tChromosome\tStart\tEnd\tCOG categories\n"; | 573 print OUT6 "Orthogroup\tGene\tChromosome\tStart\tEnd\tCOG categories\tLetter assigned\n"; |
572 | 574 |
573 my $refGenes_of_OG = $Genes_of_OG{$i}; | 575 my $refGenes_of_OG = $Genes_of_OG{$i}; |
574 my %subhash = %$refGenes_of_OG; | 576 my %subhash = %$refGenes_of_OG; |
575 | 577 |
576 foreach my $orthogroup (keys (%subhash)){ | 578 foreach my $orthogroup (keys (%subhash)){ |
579 | 581 |
580 my $cat = "unknown"; | 582 my $cat = "unknown"; |
581 if ($Cog_of_gene{$gene}){ | 583 if ($Cog_of_gene{$gene}){ |
582 $cat = $Cog_of_gene{$gene}; | 584 $cat = $Cog_of_gene{$gene}; |
583 } | 585 } |
584 print OUT6 $orthogroup."\t".$subhash{$orthogroup}."\t".$Gene_position{$gene}."\t".$cat."\n"; | 586 print OUT6 $orthogroup."\t".$subhash{$orthogroup}."\t".$Gene_position{$gene}."\t".$cat."\t".$Hash_Convert{$cat}."\n"; |
585 } | 587 } |
586 | 588 |
587 } | 589 } |
588 close (OUT6); | 590 close (OUT6); |
589 } | 591 } |