pierrepo / grodecoder

GroDecoder extracts and identifies the molecular components of a structure file (PDB or GRO) issued from a molecular dynamics simulation.
https://grodecoder.streamlit.app/
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

List residues id instead of atom id start / end in `count_molecules()` #44

Closed pierrepo closed 4 months ago

pierrepo commented 4 months ago

In the function count_molecules() it would be more interesting to list residue ids instead of atom ids start and end.

This function should return a list of residue ids for similar molecules.

Then in the print_graph_inventory() function, one could print start and end of residue intervals based on https://www.geeksforgeeks.org/python-make-a-list-of-intervals-with-sequential-numbers/ (method 1).

pierrepo commented 4 months ago

Actually, one could get both residues and atoms intervals

pierrepo commented 4 months ago

See also: https://codereview.stackexchange.com/questions/220072/construct-intervals-from-a-sequence-of-numbers-and-vice-versa