Bioperl Training Exercise 4
From BITS wiki
- create array
-
my @id = qw/id2 id7 id1 id4 id3 id5 id6/;
-
- add the following list of duplicates using an array function: id3 id2 id7 id2 id2 id3
- Create a hash for which the keys are the unique elements in @id and values the number of occurences
- Print the number of unique elements
- Print the unique elements
- Print the key/value pairs using the each function. Compare the order of the elements !
- Print the key/value pairs again preserving the original order
- Hash interpolation (= double quotes). What happens ?
- Advanced: print the hash values in the same order as the original @id array using hash slice and interpolation
- Advanced: print the top 3 of most occuring elements
- Advanced: interpolate the keys of the hash (print the keys of the hash in double quoted string)
Solution |
---|
|