Simulating a DNA Sequence by Programming Randomization in Perl

Prep readings:

In this assignment, we wish to:
- practice with Perl code for programming randomization
- learn how to write your own programs involving randomization
Before You Start This Lab
- 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.
- 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.
- 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
- After you complete the steps above, begin reading Chapter 7 of your text.
As you encounter example code, execute the Perl programs provided.
- 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:
- 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.
- 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?
- 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.
- 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.
- 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.