in reply to Re^2: how can I print my hash values once?
in thread how can I print my hash values once?
Just a quick note, you seem to be placing some garbage in your hash:
Chromosome has X genes Chromosome KLHL13 has X genes Chromosome UTY has Y genes Chromosome SPIN2B has X genes Chromosome PIR has X genes
The values in the hash should only be counts. Once you fix that bug, you can use
foreach my $geneid ( sort { $geneids{$a} <=> $geneids{$b} } keys %geneids ) { if ($geneid =~ /^(?:[0-9]+|X|Y)\z/) { print OUT "Chromosome $geneid has $geneids{$geneid} genes\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how can I print my hash values once?
by lomSpace (Scribe) on Mar 11, 2011 at 15:17 UTC | |
by ikegami (Patriarch) on Mar 11, 2011 at 21:50 UTC |