in reply to Changing the format of output
my @samples; my %aws; foreach my $geno( @ {$genotype} ){ push @samples, $geno->[4]; if(defined $geno->[3]){ push @{ $aws{$geno->[1]} }, $geno->[3]; }#end of if loop to check the genotype defined else{ push @{ $aws{$geno->[1]} }, 'NO'; } }#end of @$genotype print 'Sample,'; print(join ',', @samples); print "\n"; for (keys %aws) { print "$_,"; print(join ',', @{ $aws{$_} }); print "\n"; }
|
|---|