Perl References

Simon Prochnik, Lincoln Stein (From Steve Rozen, 2001)

Problem Set

  1. Create a script that stores the data in a hash of hashes, according to the labels (gene, expression, tissue), so that you can access the data using those labels. For example, if your data structure is called %hash, you should be able to look up the data related the CDC2 gene like this:

    $gene = 'CDC2';
    my $expression_for_gene = $hash{$gene}{'expression'};
    my $tissue_for_gene     = $hash{$gene}{'tissue'};
    

    geneexpressiontissue
    CDC245liver
    PLK134.2heart
    MCM49kidney


  2. Modify your script so that the data for MCM4 is printed out like this:
    gene     expression    tissue
    MCM4     9             kidney
    

  3. Add a new gene, with an expression level, in a tissue.

  4. Modify your script to take the data from a tab-delimited file with many genes with expression data. Be sure to include a few genes that are expressed in the liver. Print this as you did in question 2

  5. Print out all genes that are expressed in the liver. Report the average expression level of these genes.