Difference between revisions of "CSC334 Lab4"
(→Step 3: Marking the longest repeat) |
|||
Line 35: | Line 35: | ||
* Once your program works, make it display a circle around the longest repeat (or repeats) found. Use the '''drawPoints( int i, int j, int n )''' function as an example for a new function '''putCircleAround( int i, int j, int radius )''' that could be used to highlight the longest segment. | * Once your program works, make it display a circle around the longest repeat (or repeats) found. Use the '''drawPoints( int i, int j, int n )''' function as an example for a new function '''putCircleAround( int i, int j, int radius )''' that could be used to highlight the longest segment. | ||
− | [[Image:DNARepeats_circle.png]] | + | [[Image:DNARepeats_circle.png | center ]] |
Note that to draw a circle that is not filled with color, you use the '''noFill()''' function and call '''ellipse()'''. | Note that to draw a circle that is not filled with color, you use the '''noFill()''' function and call '''ellipse()'''. | ||
Line 41: | Line 41: | ||
noFill(); | noFill(); | ||
ellipse( x, y, radius, radius ); | ellipse( x, y, radius, radius ); | ||
− | |||
==Solution Program== | ==Solution Program== |
Revision as of 15:03, 24 July 2008
Contents
Finding repeats in DNA sequences
In this lab you will work with a Proce55ing sketchbook to create a graphical representation of repeating sequences in DNA sequences. Finding repeating patterns, either adjacent to each other, as in tandom repeats, or long interspersed repeats yield important genetic information about a DNA sequence.
Methodology
- Copy and paste the program DNA_Repeats_start.pde in a new sketchbook which you should call DNA_Repeats.pde.
- Create the font needed for the program. Click on Tools, Create Font, and select Monaco, with a size of 12 points.
This will create the file Monaco-12.vlw in the data folder of your Processing sketchbook. If you cannot find the font Monaco on your computer, select a monospace font such as Prestige Elite, or Courier.
- Run the program. Verify that you get a empty square and a listing of the DNA sequence
Step 1: Finding repeats
This part involves the whole class to discover the algorithm that can be used to find repeat patterns longer than some predefined length.
- come up with an algorithm (this will take some time!)
- code it, and test it. Use a minimum length of 1 or 2 at first, and increase it slowly to see the longest pattern founds.
- verify that you get an image similar to the one above.
Step 2: finding the longest repeat
- Make your program print in the console the locations of the longest repeats it finds, in the following form:
longest repeat: 123, 255 length 7
This means that a sequence of length 7 was found at Index 123 and at Index 255.
Step 3: Marking the longest repeat
- Once your program works, make it display a circle around the longest repeat (or repeats) found. Use the drawPoints( int i, int j, int n ) function as an example for a new function putCircleAround( int i, int j, int radius ) that could be used to highlight the longest segment.
Note that to draw a circle that is not filled with color, you use the noFill() function and call ellipse().
noFill(); ellipse( x, y, radius, radius );
Solution Program
Back to CSC334 Lab Page
© D. Thiebaut 2008