Difference between revisions of "QLanners Week 2"

From LMU BioDB 2017
Jump to: navigation, search
(added first part of the journal including all of code used to solve assignment)
(added to electronic journal with parts of the steps taken)
Line 8: Line 8:
 
I used a combination of my knowledge of DNA transcription and translation from my previous biology classes, along with a little bit of code to do this assignment.
 
I used a combination of my knowledge of DNA transcription and translation from my previous biology classes, along with a little bit of code to do this assignment.
  
The most efficient way I thought of doing this assignment was making a class called DNA that functions within the class to find the DNA strand's complementary strands and protein sequences from the various reading frames.
+
The original template strand provided was:
 +
5’-cgtatgctaataccatgttccgcgtataacccagccgccagttccgctggcggcatttta-3’
  
The code for this class is as follows:
+
The most efficient way I thought of doing this assignment was making a class called DNA that had functions within the class to find the DNA strand's complementary strands and protein sequences from the various reading frames.
{{border|
 
class DNA:
 
  
def __init__(self, sequence):
+
The first step was to create a function that I called compStrand to take the input template strand and output the complementary strand. In order to make the code easier, I just took off the 5' and 3' of the string. And then after passing the template DNA strand through the function, I was sure to add the end labels back on, being sure to put them on in the reverse 3' to 5' order.
self.sequence = sequence
 
  
def compStrand(self):
+
The complementary strand was found to be:
 +
3'-gcatacgattatggtacaaggcgcatattgggtcggcggtcaaggcgaccgccgtaaaat-5'
  
newDNA = ''
+
As for the reading frames portion of this assignment, I created another function, called protein, within the class. This function took one argument which was the location of the start of the reading frame.  
for i in self.sequence:
 
if i == 'a':
 
newDNA += 't'
 
elif i == 't':
 
newDNA += 'a'
 
elif i == 'g':
 
newDNA += 'c'
 
elif i == 'c':
 
newDNA += 'g'
 
print(newDNA)
 
return newDNA
 
  
+
For reading frames +1,+2, and +3, I was able to just use the template DNA strand that was already provided, as this string was oriented in the 5' to 3' direction.
  
def RNA(self):
+
Hence I called the function protein() on this strand using the arguments 1, 2 and 3. A _ in the outputted protein sequence indicated a stop codon, so this was also taken into account, as any codons beyond that point would not be translated. I included the full output from the function called as well in parentheses after the shortened protein sequence. I then added the N and C terminus endings to either end of these output strings.
newDNA = ''
+
The results were as follows:
for i in self.sequence:
+
+1  N-RMLIPCSAYNPAASSAGGIL-C
if i == 't':
+
+2  N-VC-C  (Full outputted protein sequence from function: N-VC_YHVPRITQPPVPLAAF-C)
newDNA += 'u'
+
+3 N-YANTMFRV-C    (Full outputted protein sequence from function: N-YANTMFRV_PSRQFRWRHF-C)
else:
 
newDNA += i
 
 
print(newDNA)
 
 
 
def protein(self, start):
 
seqCap = self.sequence.upper()
 
codons = list()
 
codontable = {
 
    'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M',
 
    'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T',
 
    'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K',
 
    'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R',
 
    'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L',
 
    'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P',
 
    'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q',
 
    'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R',
 
    'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V',
 
    'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A',
 
    'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E',
 
    'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G',
 
    'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S',
 
    'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L',
 
    'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_',
 
    'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W',
 
    }
 
 
 
seqcut = seqCap[start:]
 
while len(seqcut) >= 3:
 
codons.append(seqcut[:3])
 
seqcut = seqcut[3:]
 
print(codons)
 
 
 
protein = ''
 
for codes in codons:
 
protein += codontable[codes]
 
print(protein)}}
 
  
 +
As for the -1, -2, and -3 reading frames, I had to assign the complementary strand computed above to a new variable (called compStrand) and then I used the function compStrand[::
 +
+3
 
==Acknowledgements==
 
==Acknowledgements==
  

Revision as of 06:45, 9 September 2017

The Genetic Code Assignment

Answers to Assignment

Laboratory Notebook

I used a combination of my knowledge of DNA transcription and translation from my previous biology classes, along with a little bit of code to do this assignment.

The original template strand provided was:

5’-cgtatgctaataccatgttccgcgtataacccagccgccagttccgctggcggcatttta-3’

The most efficient way I thought of doing this assignment was making a class called DNA that had functions within the class to find the DNA strand's complementary strands and protein sequences from the various reading frames.

The first step was to create a function that I called compStrand to take the input template strand and output the complementary strand. In order to make the code easier, I just took off the 5' and 3' of the string. And then after passing the template DNA strand through the function, I was sure to add the end labels back on, being sure to put them on in the reverse 3' to 5' order.

The complementary strand was found to be:

3'-gcatacgattatggtacaaggcgcatattgggtcggcggtcaaggcgaccgccgtaaaat-5'

As for the reading frames portion of this assignment, I created another function, called protein, within the class. This function took one argument which was the location of the start of the reading frame.

For reading frames +1,+2, and +3, I was able to just use the template DNA strand that was already provided, as this string was oriented in the 5' to 3' direction.

Hence I called the function protein() on this strand using the arguments 1, 2 and 3. A _ in the outputted protein sequence indicated a stop codon, so this was also taken into account, as any codons beyond that point would not be translated. I included the full output from the function called as well in parentheses after the shortened protein sequence. I then added the N and C terminus endings to either end of these output strings. The results were as follows:

+1   N-RMLIPCSAYNPAASSAGGIL-C
+2  N-VC-C   (Full outputted protein sequence from function: N-VC_YHVPRITQPPVPLAAF-C)
+3  N-YANTMFRV-C    (Full outputted protein sequence from function: N-YANTMFRV_PSRQFRWRHF-C)

As for the -1, -2, and -3 reading frames, I had to assign the complementary strand computed above to a new variable (called compStrand) and then I used the function compStrand[::

+3

Acknowledgements

References

Links

Main Page
User Page
Assignment Pages: Week 1 | Week 2 | Week 3 | Week 4 | Week 5 | Week 6 | Week 7 | Week 8 | Week 9 | Week 10 | Week 11 | Week 12 | Week 14 | Week 15
Journal Entry Pages: Week 1 | Week 2 | Week 3 | Week 4 | Week 5 | Week 6 | Week 7 | Week 8 | Week 9 | Week 10 | Week 11 | Week 12 | Week 14 | Week 15
Shared Journal Pages: Week 1 | Week 2 | Week 3 | Week 4 | Week 5 | Week 6 | Week 7 | Week 8 | Week 9 | Week 10
Group Project Page: JASPAR the Friendly Ghost