How to use the nglview.show_file function in nglview

To help you get started, we’ve selected a few nglview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github michellab / BioSimSpace / python / BioSimSpace / Notebook / _view.py View on Github external
if view is None:
            self._num_views += 1

        # Create a PDB object and write to file.
        if system is not None:
            try:
                pdb = _SireIO.PDB2(system)
                pdb.writeToFile(filename)
            except:
                raise IOError("Failed to write system to 'PDB' format.") from None

        # Import NGLView when it is used for the first time.
        import nglview as _nglview

        # Create the NGLview object.
        view = _nglview.show_file(filename)

        # Return the view and display it.
        return view.display(gui=gui)

nglview

IPython widget to interactively view molecular structures and trajectories.

MIT
Latest version published 9 months ago

Package Health Score

75 / 100
Full package analysis

Similar packages