Problem Set: Perl V

Files for Perl_V_ProblemSet:
  1. Perl_V.genesAndSeq
  2. Perl_V.fasta
Perl V Problem Set
====================
1. Create a hash of your favorite 5 genes and their nucleotide sequences. Make the genes the keys and the sequences the values.
 
2. With a foreach loop, iterate through each key (gene name) of your hash.
  - Print each key and value in this format "gene:seq\n";
  - Are the genes printing in the order you added them to the hash? Why?
 
3. Use the included file "Perl_V.genesAndSeq.txt". Open file and build hash with the first column for your key and the second for your value.
 
4. With a foreach loop, iterate through each key (gene name) of your hash.
  - Calculate the length of each seq
  - Print each key and value in this format "key:value\n"; (gene:seq_len)
 
5. Create your hash with gene names and sequences from a FASTA file (Perl_V.fasta). You will have to parse out the gene names and sequences from the file.
 
6. With a foreach loop, iterate through each gene name (key) in your hash.
  - Print each key/value pair. "gene:seq\n"
  - Now, add a sort (default) of the keys and print each value.
  - Now, sort (numeric, smallest to biggest) by the length of the sequence, and print each key/value pair as well as the length of the sequence
  - Now, sort biggest to smallest. Print each key/value pair as well the length of the sequence
 
 
7. In a new script, determine and report the codon usage for a DNA sequence
  - Create a string containing a DNA sequence
  - Within a for loop 
    - use the function substr ($seq, $offset, 3) to extract codons
    - store each codon and the number of times it has occurred in a hash

Comments are closed.