コード例 #1
0
ファイル: trajectory.py プロジェクト: readdy/readdy
    def convert_to_xyz(self,
                       xyz_filename=None,
                       generate_tcl=True,
                       tcl_with_grid=False,
                       particle_radii=None,
                       color_ids=None,
                       draw_box=False):
        """
        Converts this trajectory to a xyz file that can be read into VMD. Assuming the TCL script was generated, the
        trajectory can be visualized by `vmd -e traj.xyz.tcl`.

        :param xyz_filename: the output file name, if None, the filename with an .xyz extension will be used
        :param generate_tcl: generates a tcl script that can be used alongside with the xyz file
        :param tcl_with_grid: enables a grid view inside VMD
        :param particle_radii: map particle radii for visualization purposes, e.g., `{"A": 10., "B": .1}`
        :param color_ids: map particle type names to tcl/vmd color ids, e.g., `{"A": 0, "B": 5}`, default uses
                          consecutive numbering
        :param draw_box: if True, will use box size from trajectory file and make vmd draw the edges of the box
        """
        from readdy.api.utils import convert_trajectory_to_xyz as to_xyz
        if draw_box:
            bs = tuple(self._general.box_size)
        else:
            bs = None

        to_xyz(self._filename,
               self._name,
               xyz_filename=xyz_filename,
               generate_tcl=generate_tcl,
               tcl_with_grid=tcl_with_grid,
               particle_radii=particle_radii,
               color_ids=color_ids,
               box_size=bs)
コード例 #2
0
ファイル: trajectory.py プロジェクト: chrisfroe/readdy
    def convert_to_xyz(self, xyz_filename=None, generate_tcl=True, tcl_with_grid=False, particle_radii=None):
        """
        Converts this trajectory to a xyz file that can be read into VMD. Assuming the TCL script was generated, the
        trajectory can be visualized by `vmd -e traj.xyz.tcl`.

        :param xyz_filename: the output file name, if None, the filename with an .xyz extension will be used
        :param generate_tcl: generates a tcl script that can be used alongside with the xyz file
        :param tcl_with_grid: enables a grid view inside VMD
        :param particle_radii: map particle radii for visualization purposes, e.g., `{"A": 10., "B": .1}`
        """
        from readdy.api.utils import convert_trajectory_to_xyz as to_xyz
        to_xyz(self._filename, self._name, xyz_filename=xyz_filename, generate_tcl=generate_tcl,
               tcl_with_grid=tcl_with_grid, particle_radii=particle_radii)
コード例 #3
0
    def convert_to_xyz(self,
                       xyz_filename=None,
                       generate_tcl=True,
                       tcl_with_grid=False,
                       particle_radii=None):
        """
        Converts this trajectory to a xyz file that can be read into VMD. Assuming the TCL script was generated, the
        trajectory can be visualized by `vmd -e traj.xyz.tcl`.

        :param xyz_filename: the output file name, if None, the filename with an .xyz extension will be used
        :param generate_tcl: generates a tcl script that can be used alongside with the xyz file
        :param tcl_with_grid: enables a grid view inside VMD
        :param particle_radii: map particle radii for visualization purposes, e.g., `{"A": 10., "B": .1}`
        """
        from readdy.api.utils import convert_trajectory_to_xyz as to_xyz
        to_xyz(self._filename,
               self._name,
               xyz_filename=xyz_filename,
               generate_tcl=generate_tcl,
               tcl_with_grid=tcl_with_grid,
               particle_radii=particle_radii)