Skip to content

added (de)protonated AA #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion aminoAcids.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ def __init__(self):
self.codes321 = {
'ALA': 'A',
'ARG': 'R',
'ARN': 'R',
'ASN': 'N',
'ASP': 'D',
'ASH': 'D',
'CYS': 'C',
'CYX': 'C',
'GLN': 'Q',
'GLU': 'E',
'GLH': 'E',
'GLY': 'G',
'HIS': 'H',
'HIE': 'H',
Expand All @@ -21,6 +25,7 @@ def __init__(self):
'ILE': 'I',
'LEU': 'L',
'LYS': 'K',
'LYN': 'K',
'MET': 'M',
'PHE': 'F',
'PRO': 'P',
Expand Down Expand Up @@ -69,6 +74,11 @@ def __init__(self):
O = 1,
C = 6,
),
'ARN': Counter(
N = 4,
O = 1,
C = 6,
),
'ASN': Counter(
N = 2,
O = 2,
Expand All @@ -79,12 +89,23 @@ def __init__(self):
O = 3,
C = 4
),
'ASH': Counter(
N = 1,
O = 3,
C = 4
),
'CYS': Counter(
N = 1,
O = 1,
C = 3,
S = 1
),
'CYX': Counter(
N = 1,
O = 1,
C = 3,
S = 1
),
'GLN': Counter(
N = 2,
O = 2,
Expand All @@ -95,6 +116,11 @@ def __init__(self):
O = 3,
C = 5
),
'GLH': Counter(
N = 1,
O = 3,
C = 5
),
'GLY': Counter(
N = 1,
O = 1,
Expand Down Expand Up @@ -135,6 +161,11 @@ def __init__(self):
O = 1,
C = 6
),
'LYN': Counter(
N = 2,
O = 1,
C = 6
),
'MET': Counter(
N = 1,
O = 1,
Expand Down Expand Up @@ -176,4 +207,4 @@ def __init__(self):
O = 1,
C = 5
)
}
}
14 changes: 11 additions & 3 deletions protein.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

class System(object):
def __init__(self, **kwargs):
protein_res_names = ["ALA", "ARG", "ASN", "ASP", "CYS", "CYX", "GLN", "GLU", "GLY", "HIS",
"HIE", "HID", "HIP", "HISE", "HISD", "HISH", "ILE", "LEU", "LYS",
protein_res_names = ["ALA", "ARG","ARN", "ASN", "ASP", "ASH", "CYS", "CYX", "GLN", "GLH", "GLU", "GLY", "HIS",
"HIE", "HID", "HIP", "HISE", "HISD", "HISH", "ILE", "LEU", "LYS", "LYN",
"MET", "PHE", "PRO", "SER", "THR", "TRP", "TYR", "VAL", ]

self.pdb = kwargs["pdb"]
Expand Down Expand Up @@ -249,7 +249,7 @@ def __init__(self, *args, **kwargs):

def _setRes(self):
"""
Change Histidines and Cysteins in pdb to the format preferred by gromacs.
Change Histidines and Cysteins and Protonated ASP and GLU and Deprotonated LYS pdb to the format preferred by gromacs.
"""
tgt = open(self.pdb.replace(".pdb", "-his.pdb"), "w")
self.pdb_his = tgt.name
Expand All @@ -264,6 +264,14 @@ def _setRes(self):
tgt.write(line.replace('HIP ','HISH'))
elif line.split()[3] == "CYX":
tgt.write(line.replace('CYX ','CYS '))
elif line.split()[3] == "ASH":
tgt.write(line.replace('ASH ','ASPH'))
elif line.split()[3] == "ASH":
tgt.write(line.replace('GLH ','GLUH'))
elif line.split()[3] == "LYN":
tgt.write(line.replace('LYN ','LYSN'))
elif line.split()[3] == "ARN":
tgt.write(line.replace('ARN ','ARGN'))
else:
tgt.write(line)
else:
Expand Down