You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to parallelize the Hole Analysis calculation assuming that I can have n slices of the trajectory being processed simultaneously with a function like
def hole_calc(atomgroup,ts):
PDB_HOLE = f'hole_frame_{ts.frame}.pdb'
# write the frame to pdb
atomgroup.write(PDB_HOLE)
hole_u = mda.Universe(PDB_HOLE)
# Get the pore Center Atoms
center_resis = hole_u.select_atoms('resnum 675 and name CA')
center_coords = np.mean(center_resis.positions,axis=0)
profiles = hole2.hole(PDB_HOLE, executable=hole_exe,
cpoint=center_coords,
cvect=[0,0,1],
keep_files=False)
os.remove(PDB_HOLE)
return {'rxn_coord':profiles[0]['rxn_coord'],
'radius': profiles[0]['radius'],
'cen_line_D':profiles[0]['cen_line_D']
}
Using this as the function inside of:
NewAnalysis(ParallelAnalysisBase)
def _single_frame(self, ts, agroups):
# REQUIRED
# called for every frame. ``ts`` contains the current time step
# and ``agroups`` a tuple of atomgroups that are updated to the
# current frame. Return result of `some_function` for a single
# frame
return {ts.frame: hole_calc(agroups[0], ts)}
and calling it with:
test = HoleParallel(u.select_atoms('all'),None).run()
I get the following error:
test = HoleParallel(u.select_atoms('protein'),None).run()
Traceback (most recent call last):
File "", line 1, in
File "HoleParallel.py", line 57, in init
super(HoleParallel, self).init(atomgroup.universe,
File "conda_environments/miniconda3/envs/mdanalysis/lib/python3.9/site-packages/pmda/parallel.py", line 213, in init
self._indices = [ag.indices for ag in atomgroups]
File "conda_environments/miniconda3/envs/mdanalysis/lib/python3.9/site-packages/pmda/parallel.py", line 213, in
self._indices = [ag.indices for ag in atomgroups]
File "conda_environments/miniconda3/envs/mdanalysis/lib/python3.9/site-packages/MDAnalysis/core/groups.py", line 4142, in getattr
return super(Atom, self).getattr(attr)
File "conda_environments/miniconda3/envs/mdanalysis/lib/python3.9/site-packages/MDAnalysis/core/groups.py", line 4016, in getattr
raise AttributeError(err.format(selfcls=selfcls, attr=attr,
AttributeError: Atom has no attribute indices. Do you mean index
....
'''
Currently version of MDAnalysis: 2.2
The text was updated successfully, but these errors were encountered:
Trying to parallelize the Hole Analysis calculation assuming that I can have n slices of the trajectory being processed simultaneously with a function like
Using this as the function inside of:
NewAnalysis(ParallelAnalysisBase)
and calling it with:
test = HoleParallel(u.select_atoms('all'),None).run()
I get the following error:
Currently version of MDAnalysis: 2.2
The text was updated successfully, but these errors were encountered: