@@ -62,7 +62,7 @@ def select_levels(self, data_container):
6262 "united_atom"
6363 ) # every molecule has at least one atom
6464
65- atoms_in_fragment = fragments [molecule ].select_atoms ("not name H* " )
65+ atoms_in_fragment = fragments [molecule ].select_atoms ("prop mass > 1.1 " )
6666 number_residues = len (atoms_in_fragment .residues )
6767
6868 if len (atoms_in_fragment ) > 1 :
@@ -337,19 +337,23 @@ def get_beads(self, data_container, level):
337337 atom_group = "resindex " + str (residue )
338338 list_of_beads .append (data_container .select_atoms (atom_group ))
339339
340- # NOTE this could cause problems for hydrogen or helium molecules
341340 if level == "united_atom" :
342341 list_of_beads = []
343- heavy_atoms = data_container .select_atoms ("not name H*" )
344- for atom in heavy_atoms :
345- atom_group = (
346- "index "
347- + str (atom .index )
348- + " or (name H* and bonded index "
349- + str (atom .index )
350- + ")"
351- )
352- list_of_beads .append (data_container .select_atoms (atom_group ))
342+ heavy_atoms = data_container .select_atoms ("prop mass > 1.1" )
343+ if len (heavy_atoms ) == 0 :
344+ # molecule without heavy atoms would be a hydrogen molecule
345+ list_of_beads .append (data_container .select_atoms ("all" ))
346+ else :
347+ # Select one heavy atom and all light atoms bonded to it
348+ for atom in heavy_atoms :
349+ atom_group = (
350+ "index "
351+ + str (atom .index )
352+ + " or ((prop mass <= 1.1) and bonded index "
353+ + str (atom .index )
354+ + ")"
355+ )
356+ list_of_beads .append (data_container .select_atoms (atom_group ))
353357
354358 logger .debug (f"List of beads: { list_of_beads } " )
355359
@@ -421,7 +425,7 @@ def get_axes(self, data_container, level, index=0):
421425 # Rotation
422426 # for united atoms use heavy atoms bonded to the heavy atom
423427 atom_set = data_container .select_atoms (
424- f"not name H* and bonded index { index } "
428+ f"(prop mass > 1.1) and bonded index { index } "
425429 )
426430
427431 if len (atom_set ) == 0 :
@@ -432,7 +436,7 @@ def get_axes(self, data_container, level, index=0):
432436 atom_group = data_container .select_atoms (f"index { index } " )
433437 center = atom_group .positions [0 ]
434438
435- # get vector for average position of hydrogens
439+ # get vector for average position of bonded atoms
436440 vector = self .get_avg_pos (atom_set , center )
437441
438442 # use spherical coordinates function to get rotational axes
@@ -1125,7 +1129,7 @@ def build_conformational_states(
11251129 )
11261130 heavy_res = (
11271131 entropy_manager ._run_manager .new_U_select_atom (
1128- res_container , "not name H* "
1132+ res_container , "prop mass > 1.1 "
11291133 )
11301134 )
11311135 states = self .compute_dihedral_conformations (
0 commit comments