Difference between revisions of "QLanners Week 2"
(added links using template) |
(added first part of the journal including all of code used to solve assignment) |
||
Line 6: | Line 6: | ||
==Laboratory Notebook== | ==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 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 code for this class is as follows: | ||
+ | {{border| | ||
+ | class DNA: | ||
+ | |||
+ | def __init__(self, sequence): | ||
+ | self.sequence = sequence | ||
+ | |||
+ | def compStrand(self): | ||
+ | |||
+ | newDNA = '' | ||
+ | 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 | ||
+ | |||
+ | |||
+ | |||
+ | def RNA(self): | ||
+ | newDNA = '' | ||
+ | for i in self.sequence: | ||
+ | if i == 't': | ||
+ | newDNA += 'u' | ||
+ | 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)}} | ||
==Acknowledgements== | ==Acknowledgements== |
Revision as of 05:51, 9 September 2017
Contents
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 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 code for this class is as follows:
class DNA:
def __init__(self, sequence): self.sequence = sequence
def compStrand(self):
newDNA = 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
def RNA(self): newDNA = for i in self.sequence: if i == 't': newDNA += 'u' 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)
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