In my opinion, the only important functionality left to implement before publishing this is something to work with trajectories. We could probably discuss here how this tool could be shaped.
I would like to avoid additional auxiliary classes as most of the libraries have (mdtraj or MDAnalysis). In my opinion the power of the tool should be in a unique place, a iterator.
¿What do we need? We need a tool to extract frames (step, time, coordinates, and boxes) in a smart and simple way when these structures are stored in a trajectory file. However, their use should not be restricted to trajectory files.
As user, I would like to do something like this:
import molsysmt as msm
iterator = msm.structure.iterator('traj.h5', start=100, interval=10, stop=200, selection='atom_name=="CA"')
for step, time, coordinates, box in iterator:
print(step, time, coordinates, box)
iterator.close()
or
import molsysmt as msm
iterator = msm.structure.iterator(['traj.gro', 'traj.xtc'], indices=[10, 22, 30, 78, 145], selection=[10, 11, 12])
for step, time, coordinates, box in iterator:
print(step, time, coordinates, box)
iterator.close()
or
import molsysmt as msm
iterator = msm.structure.iterator('traj.dcd', start=1, interval=10, stop=1000, chunk_size=20)
for _, chunk_times, chunk_coordinates, _ in iterator:
print(chunk_times, chunk_coordinates)
iterator.close()
This iterator could have the following instatation arguments:
molecular_system: The standard molecular system input.
start: first structure index of the trajectory to start with. [default: 0]
interval: number of structure indices to be skipt in each iteration. [default: 1]
stop: the iteration finishes if the current structure index is larger than or equal to this integer. [default: None]
chunk_size: amount of structures in the output of each iteration [default: 1]
selection: atoms selection [default: 'all']
syntaxis: syntaxis used in selection [default: 'MolSysMT']
I am not sure if to do this iterator method, we need to define a specific structures_iterator in the module item for each form (trajectory file or form with structures in general).
@Daniel-Ibarrola: What do you think? Do you have an alternative proposal?
In my opinion, the only important functionality left to implement before publishing this is something to work with trajectories. We could probably discuss here how this tool could be shaped.
I would like to avoid additional auxiliary classes as most of the libraries have (mdtraj or MDAnalysis). In my opinion the power of the tool should be in a unique place, a iterator.
¿What do we need? We need a tool to extract frames (step, time, coordinates, and boxes) in a smart and simple way when these structures are stored in a trajectory file. However, their use should not be restricted to trajectory files.
As user, I would like to do something like this:
or
or
This iterator could have the following instatation arguments:
I am not sure if to do this
iterator
method, we need to define a specificstructures_iterator
in the moduleitem
for each form (trajectory file or form with structures in general).@Daniel-Ibarrola: What do you think? Do you have an alternative proposal?