%hashname = (); %hashlow = (); %hashhigh = (); open(INPUTL,"<$listfile") || die "Can't open \$listfile for reading.\n"; while($line=){ chomp $line; @toks = split(/\t/, $line); $dataset = $toks[0]; $gene = $toks[1]; $hashname{$dataset} = $dataset; $hashlow{$gene}{$dataset} = $toks[2]." ($toks[4])"; $hashhigh{$gene}{$dataset} = $toks[3]." ($toks[4])"; } close(INPUTL); foreach $gene (sort keys %hashlow){ if ($gene =~ /AA/){ foreach $set (sort keys %{$hashlow{$gene}}){ print OUTD2 NAME."\t".$set; } } } print "\n"; foreach $gene (sort keys %hashlow){ print OUTD2 $gene."\t"; foreach $set (sort keys %{$hashlow{$gene}}){ print OUTD2 $hashlow{$gene}{$set}."\t"; } print OUTD2 "\n"; }