Introduction to Bioinformatics

Simulating a DNA Sequence by Programming Randomization in Perl


Prep readings:

In this assignment, we wish to:


Before You Start This Lab

  1. Think about how your course Website is developing. Is it fairly easy for folks to read and follow? Review the pages developed by other students in the class and make any changes needed to your course Website to improve the overall presentation.
  2. Think about how your files and folders/directories for this class are evolving on your H: and I: drives at school, and your C: drive at home. Organize all these folders/directories now, removing unnecessary files and making the structure easy for you to use. Update any links on your course Webpage as needed to reflect your new organization.
  3. Finally, review the written feedback you received on the Perl code you submitted in previous labs. Take the latest version of your DNA processing code and clean it up now. Fix any issues with indentation and layout and all logical errors/bugs. Call the new version of your program nucleotide-counting4.pl when all changes have been made and tested.

Getting More Practice

  1. After you complete the steps above, begin reading Chapter 7 of your text. As you encounter example code, execute the Perl programs provided.
  2. Carefully study the code provided for each of the example programs.

Getting Credit for Your Progress

To get credit for this assignment, you need to complete these additional steps:

  1. In the new version of your program in nucleotide-counting4.pl, you need to add a menu option to randomly generate a DNA sequence and write it to file. The user should be prompted for the length of the sequence and the name of the output file. Before the sequence is written to the file, it should be displayed to the screen with output indicating the percentage of instances of each of the bases in the generated sequence. Begin by adding this code to the main body of your Perl program. Once you have the code working and have done some preliminary testing, move the code into a subroutine that is called by the main body, under that program option.
  2. Test your new feature by generating short (as small as 1) and long sequences (choose a range of values, such as 4, 10, 50, 100, etc). How does the percentage of each base used vary as you increase the length? How does the percentage vary as you run the program multiple times with the same length sequence?
  3. Also test your generated output file by reading it back in with the menu option that provides counts of bases from a user-specified file. Confirm that the correct counts are displayed.
  4. Make sure the final code you post is well-documented, thoroughly tested, and clearly indicates that you have considered issues of readability, code reuse, user interface, and modularity. You will receive a numerical score for this lab which considers each of these issues.
  5. Include a link to your new Perl program on your course Webpage, under the heading, "Lab: Simulating a DNA Sequence by Programming Randomization in Perl."

Feel free to see how other students in the class are doing on the assignments.
These pages are optimized for viewing under Netscape.
© Copyright 2003. Melanie A. Sutton, Ph.D. (msutton@uwf.edu) All rights reserved.