Commit 9323609f authored by Lucianna's avatar Lucianna

Updated AminoAcidChain to use indexing methods similar to mRNA

Added list[int] initiation to mRNA
parent a2f3eb16
......@@ -2,15 +2,29 @@
#
# Utils for dealing with Amino Acid Chains
#
# Authored by:
# Coauthored by: Lucianna Osucha (email:lucianna@vulpinedesigns.com)
# Authored by: Lucianna Osucha (email:lucianna@vulpinedesigns.com)
from mRNA import *
const aminoAlphabet:str = '*RHKDESTNQCUGPAVILMFYW'
const aminoCodons:list = [3, 8, 3, 8, 16, 16, 18, 16, 1, 6, 1, 6, 7, 7, 7, 7, 0, 20
, 0, 20, 17, 19, 17, 19, 0, 10, 21, 10, 6, 6, 6, 6, 5, 4, 5, 4, 15, 15, 15
, 15, 12, 12, 12, 12, 14, 14, 14, 14, 9, 2, 9, 2, 17, 17, 17, 17, 1, 1, 1, 1
, 13, 13, 13, 13]
const aminoAlphabet = "KNKNIIMIRSRSTTTT*Y*YLFLF*CWCSSSSEDEDVVVVGGGGAAAAQHQHLLLLRRRRPPPP"
class AminoAcidChain:
def __init__(self,seq:str):
self.sequence:str = seq
def __init__(self, seq:list[int]):
self.sequence:list[int] = seq
self.length:int = len(seq)
self.postTranslationalModificationSites:list[tuple] = []
self.postTranslationalModificationSites:list = []
def __init__(self, seq:str):
self.__init__([aminoAlphabet.index(i) for i in seq])
......@@ -38,9 +38,10 @@ def indexRNA(code:str) -> list:
class mRNA :
def __init__(self,cd:str,og:str,pal:int):
def __init__(self, cd:list[int], og:str, pal:int):
self.code:list[int] = indexRNA(cd)
self.code:list[int] = cd
self.originGene:str = og
self.polyALength:int = pal
......@@ -56,7 +57,14 @@ class mRNA :
self.adjustedWeights:list[float] = []
self.processedBy:list[str] = []
def __init__(self, cd:str, og:str, pal:int):
self.__init__(indexRNA(cd), og, pal)
def __string__(self) -> str:
result = ''
for i in range (0, len(self.code), 3):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment