comparison GetHaplotypesFromPhasedVCF/GetHaplotypesFromPhasedVCF.pl @ 12:88748d846a20 draft

planemo upload commit 11382afe87364aaafb19973470d5066229a6e34f
author dereeper
date Tue, 14 Aug 2018 08:21:55 -0400
parents ebb0ac9b6fa9
children
comparison
equal deleted inserted replaced
11:15b23cdde685 12:88748d846a20
5 my $vcf = $ARGV[0]; 5 my $vcf = $ARGV[0];
6 my $out = $ARGV[1]; 6 my $out = $ARGV[1];
7 7
8 open(O1,">$out.haplo.fas"); 8 open(O1,">$out.haplo.fas");
9 open(O2,">$out.distinct_haplotypes.txt"); 9 open(O2,">$out.distinct_haplotypes.txt");
10 open(O3,">$out.distinct_haplotypes.fa");
10 11
11 my %indiv; 12 my %indiv;
12 my %genes; 13 my %genes;
13 my $nb_cols = 0; 14 my $nb_cols = 0;
14 my %phasing; 15 my %phasing;
94 $num_haplo++; 95 $num_haplo++;
95 my $haplo_name = "haplo".$num_haplo; 96 my $haplo_name = "haplo".$num_haplo;
96 my $nb = $haplos{$gene}{$haplo}; 97 my $nb = $haplos{$gene}{$haplo};
97 my $ind = $haplotypes2{$gene}{$haplo}; 98 my $ind = $haplotypes2{$gene}{$haplo};
98 print O2 $haplo_name.":$nb:".$haplotypes2{$gene}{$haplo}."\n".$haplo."\n"; 99 print O2 $haplo_name.":$nb:".$haplotypes2{$gene}{$haplo}."\n".$haplo."\n";
99 if ($nb > 1){ 100 if ($nb >= 1){
100 #print "$nb \n"; 101 print O3 ">".$haplo_name."|$nb\n";
102 print O3 $haplo."\n";
101 } 103 }
102 } 104 }
103 } 105 }
104 106
105 close(O1); 107 close(O1);
106 close(O1); 108 close(O2);
109 close(O3);
107 #print scalar keys(%haplos); 110 #print scalar keys(%haplos);
108 111