Lab 5: Gene Detection
Web-CAT: Submit Python
programs to this automated grading platform.
Task Outline
- Due Date: Friday, October 18, 2019
- Total Points: 10
- Implement a
Python
program that determines which gene is present in a DNA sequence.
Background Theory
- DNA is often described as a double helix of molecules known as nucleotides. Only four DNA nucleotides exist, and they are known by the labels A, C, G, and T. This means that we can conveniently represent a DNA sequence with a Python text string.
- A cluster of three nucleotides is called a codon, and they represent amino acids which are present in DNA. For example, ATG is a codon which occurs throughout a DNA sequence. Codons are significant, because they are markers which indicate the presence of a gene.
- ATG is the start codon which marks the beginning of a gene sequence. All of the nucleotides which are present, right up to, and including the stop codon are part of the gene.
Example Case
- Consider the following DNA sequence:
ATATGTAGCTAGCATAATA
- The start codon is
ATG
, and the stop codon for this example isTAA
. Note that there are 9 nucleotides between these codons:AT
ATGTAGCTAGCATAA
TA
- Therefore, the gene sequence which results from these codons is:
ATGTAGCTAGCATAA
Hints
- Note that we will not consider the case where a gene is absent from a DNA sequence. All of the DNA sequences used in the test benches have exactly one gene for you to find.
- Also, each of the DNA sequences will have exactly one stop codon for your program to locate. In other words, there will not be multiple stop codons in the gene sequences.
Code Distribution
Description | File Size | File Name |
---|---|---|
Python Source Code for Gene Detection |
1.4KB | lab05.zip |
Contents of lab05.zip
:
Lab05GeneDetection/
├── genedetection.py
└── testgenedetection.py
Specification
- Write a
Python
program in the filegenedetection.py
that finds and displays a single gene which is present in a DNA sequence. - You will write your solution in a function called
findgene(dna, stopcodon)
right below the place where it says:YOUR CODE HERE
- When the function call
findgene("ATATGTAGCTAGCATAATA", "TAA")
is executed, the output of the program should be:ATGTAGCTAGCATAA
Testing
- Run the file
testgenedetection.py
to execute thePyUnit
test bench.PyUnit
indicates a successful test with anOK
output, and an unsuccessful test with aFAIL
output.
Submission
- Upload the file
genedetection.py
to the Web-CAT automated grading platform.