Skip to content

Commit fa2ff15

Browse files
committed
Fix residue and atom counts outputted for each group
1 parent d4cf3e8 commit fa2ff15

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

CodeEntropy/entropy.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,15 @@ def _compute_entropies(
252252
for group_id in groups.keys():
253253
mol = self._get_molecule_container(reduced_atom, groups[group_id][0])
254254

255+
residue_group = "_".join(sorted(set(res.resname for res in mol.residues)))
256+
group_residue_count = len(groups[group_id])
257+
group_atom_count = 0
258+
for mol_id in groups[group_id]:
259+
each_mol = self._get_molecule_container(reduced_atom, mol_id)
260+
group_atom_count += len(each_mol.atoms)
261+
self._data_logger.add_group_label(
262+
group_id, residue_group, group_residue_count, group_atom_count)
263+
255264
resname = mol.atoms[0].resname
256265
resid = mol.atoms[0].resid
257266
segid = mol.atoms[0].segid
@@ -472,11 +481,8 @@ def _process_united_atom_entropy(
472481
residue_group = "_".join(
473482
sorted(set(res.resname for res in mol_container.residues))
474483
)
475-
residue_count = len(mol_container.residues)
476-
atom_count = len(mol_container.atoms)
477-
self._data_logger.add_group_label(
478-
group_id, residue_group, residue_count, atom_count
479-
)
484+
485+
logger.debug(f"residue_group {residue_group}")
480486

481487
def _process_vibrational_entropy(
482488
self,

0 commit comments

Comments
 (0)