Skip to content

Commit 4a9d160

Browse files
committed
Implement curved membrane support with updated tmd protein logic
1 parent e47aab6 commit 4a9d160

File tree

2 files changed

+450
-46
lines changed

2 files changed

+450
-46
lines changed

domhmm/analysis/base.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,23 +251,25 @@ def __init__(
251251
"where 0 for lower leaflet and 1 for upper leaflet.")
252252
if isinstance(query, AtomGroup):
253253
# Take center of geometry of three positions
254-
cog = np.mean(query.positions, axis=0)
255-
self.tmd_protein[leaflet].append(cog)
254+
self.tmd_protein[leaflet].append(query)
255+
# cog = np.mean(query.positions, axis=0)
256+
# self.tmd_protein[leaflet].append(cog)
256257
# Character string was provided as input, assume it contains a selection for an MDAnalysis.AtomGroup
257258
elif isinstance(query, str):
258259
# Try to create a MDAnalysis.AtomGroup, raise a ValueError if not selection group could be
259260
# provided
260261
try:
261-
cog = np.mean(self.universe.select_atoms(query).positions, axis=0)
262-
self.tmd_protein[leaflet].append(cog)
262+
self.tmd_protein[leaflet].append(self.universe.select_atoms(query))
263+
# cog = np.mean(self.universe.select_atoms(query).positions, axis=0)
264+
# self.tmd_protein[leaflet].append(cog)
263265
except Exception as e:
264266
raise ValueError("Please provide a valid MDAnalysis selection string!") from e
265267
else:
266268
raise ValueError(
267269
"TDM Protein list should contain AtomGroup from MDAnalysis universe or a string "
268270
"query for MDAnalysis selection.")
269-
self.tmd_protein["0"] = np.array(self.tmd_protein["0"])
270-
self.tmd_protein["1"] = np.array(self.tmd_protein["1"])
271+
# self.tmd_protein["0"] = np.array(self.tmd_protein["0"])
272+
# self.tmd_protein["1"] = np.array(self.tmd_protein["1"])
271273
elif tmd_protein_list is not None:
272274
# An unknown argument is provided for tdm_protein_list
273275
raise ValueError(

0 commit comments

Comments
 (0)