Bioperl Training Exercise 4

From BITS wiki
Jump to: navigation, search
  1. create array
    my @id = qw/id2 id7 id1 id4 id3 id5 id6/;
  2. add the following list of duplicates using an array function: id3 id2 id7 id2 id2 id3
  3. Create a hash for which the keys are the unique elements in @id and values the number of occurences
  4. Print the number of unique elements
  5. Print the unique elements
  6. Print the key/value pairs using the each function. Compare the order of the elements !
  7. Print the key/value pairs again preserving the original order
  8. Hash interpolation (= double quotes). What happens ?
  9. Advanced: print the hash values in the same order as the original @id array using hash slice and interpolation
  10. Advanced: print the top 3 of most occuring elements
  11. Advanced: interpolate the keys of the hash (print the keys of the hash in double quoted string)