Skip to content

v1.24.0

Compare
Choose a tag to compare
@github-actions github-actions released this 27 Jan 19:39

MolSimToolkit v1.24.0

Diff since v1.23.0

New feature

The simulation object can be initialized with the frames keyword argument, which can be set to a range or a vector of indices of the frames. For example:

julia> using MolSimToolkit, MolSimToolkit.Testing

julia> sim = Simulation(Testing.namd2_pdb, Testing.namd2_traj; frames=[1,3,5])
Simulation 
    Atom type: PDBTools.Atom{Nothing}
    PDB file: /home/leandro/.julia/dev/MolSimToolkit/test/data/namd/protein_in_water_tmao/structure.pdb
    Trajectory file: /home/leandro/.julia/dev/MolSimToolkit/test/data/namd/protein_in_water_tmao/trajectory.dcd
    Total number of frames: 20
    Frames to consider: 1, 3, 5
    Number of frames to consider: 3
    Current frame: nothing

This allows computing properties from any subset of the frames of the simulations. For example, to compute the average dihedral angle of the first two residues of the example file above, only considering the selected frames, one would do, as before:

julia> using PDBTools

julia> d1 = select(atoms(sim), "residue 1 and backbone");

julia> d2 = select(atoms(sim), "residue 2 and backbone")
   Array{Atoms,1} with 4 atoms with fields:
   index name resname chain   resnum  residue        x        y        z occup  beta model segname index_pdb
      13    N     CYS     A        2        2   -6.351  -14.461   -5.695  1.00  0.00     1    PROT        13
      15   CA     CYS     A        2        2   -5.113  -13.737   -5.466  1.00  0.00     1    PROT        15
      22    C     CYS     A        2        2   -4.610  -13.207   -6.811  1.00  0.00     1    PROT        22
      23    O     CYS     A        2        2   -4.443  -13.972   -7.759  1.00  0.00     1    PROT        23

julia> average_dihedrals(sim, [d1, d2])
2-element Vector{Float64}:
 -13.971039748471016
 -34.44560612678544

Merged pull requests:

  • support frames argument to set frames with int vector (#24) (@lmiq)