simonduerr commited on
Commit
572d3a2
1 Parent(s): b13ea5a

Update utils/helpers.py

Browse files
Files changed (1) hide show
  1. utils/helpers.py +29 -4
utils/helpers.py CHANGED
@@ -82,7 +82,7 @@ def get_all_protein_resids(pdb_file):
82
  Returns
83
  -------
84
  resids : numpy.ndarray
85
- Array of protein resids old -> new
86
 
87
  """
88
  try:
@@ -104,7 +104,7 @@ def get_all_metalbinding_resids(pdb_file):
104
  Returns
105
  -------
106
  resids : numpy.ndarray
107
- id of resids that are metal binding
108
 
109
  """
110
 
@@ -115,10 +115,35 @@ def get_all_metalbinding_resids(pdb_file):
115
  prot.filter("protein")
116
  return prot.get(
117
  "index",
118
- sel="name CA and resid 94 96 119"
119
- #sel="name CA and resname HIS HID HIE HIP CYS CYX GLU GLH GLN ASP ASH ASN GLN MET",
120
  )
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
 
123
  def compute_average_p_fast(point, cutoff=1):
124
  """Using KDTree find the closest gridpoints
 
82
  Returns
83
  -------
84
  resids : numpy.ndarray
85
+ indexes of ca atoms
86
 
87
  """
88
  try:
 
104
  Returns
105
  -------
106
  resids : numpy.ndarray
107
+ indexes of name CA that are metal binding
108
 
109
  """
110
 
 
115
  prot.filter("protein")
116
  return prot.get(
117
  "index",
118
+ sel="name CA and resname HIS HID HIE HIP CYS CYX GLU GLH GLN ASP ASH ASN GLN MET",
 
119
  )
120
 
121
+ def get_all_resids_from_list(pdb_file, resids):
122
+ """Return all metal binding residues from a pdb file
123
+
124
+ Parameters
125
+ ----------
126
+ pdb_file : str
127
+ Path to pdb file
128
+ resids : list
129
+ id of resids that are metal binding
130
+
131
+ Returns
132
+ -------
133
+ resids : numpy.ndarray
134
+ indexes of name CA resids
135
+
136
+ """
137
+
138
+ try:
139
+ prot = Molecule(pdb_file)
140
+ except:
141
+ exit("could not read file")
142
+ prot.filter("protein")
143
+ return prot.get(
144
+ "index",
145
+ sel=f"name CA and resid {resids}",
146
+ )
147
 
148
  def compute_average_p_fast(point, cutoff=1):
149
  """Using KDTree find the closest gridpoints