Skip to content
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

initial commit for adding descriptor of water features #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
27 changes: 27 additions & 0 deletions wetmsm/shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,33 @@ def partial_transform(self, traj):
shellcounts = analysis.reshape(shellcounts)
return shellcounts

def describe_features(self, traj):
"""Return a Pandas Dataframe describing the Water features."""
x = []

resSeq = [np.array([traj.top.atom(i).residue.resSeq]) for i in self.solute_indices]
resid = [np.array([traj.top.atom(i).residue.index]) for i in self.solute_indices]
resnames = [[traj.top.atom(i).residue.name] for i in self.solute_indices]
aind = [[i] for i in self.solute_indices]

bigclass = ["water_shells"] * self.n_features
otherInfo = ["None"] * self.n_features
smallclass = range(self.n_shells)


aind = np.array(aind * self.n_shells)
resnames = resnames * self.n_shells
resSeq = resSeq * self.n_shells
resid = resid * self.n_shells
smallclass = [val for val in smallclass for _ in range(self.n_solute)]

for i in range(len(resnames)):
d_i = dict(resname=resnames[i], atomind=aind[i], resSeq=resSeq[i], resid=resid[i],\
bigclass=bigclass[i],otherInfo=otherInfo[i], smallclass=smallclass[i])
x.append(d_i)

return x


class SolventShellsAssigner(SolventShellsFeaturizer):
"""Assign solvent atoms to shells to compliment SolventShellsFeaturizer.
Expand Down