IChemiton Examples

This profile is in development so you can find also some debug line in the output

What is tested:

  • Pymol Interface: You can get 3d picture using pymol as "backend"
  • Plot: You can plot graphs from file directly in the notebook using the %plot keyword

In [2]:
# PYMOL INTERFACE:

# Load the molecule (You can use different commands)
mol = pybel.readfile('xyz', './methane.xyz').next()

# Activating pymol interface 
v = PyMol.MolViewer()
# Load the molecule in Pymol (You can modify the orientation, ...)
v.ShowMol(mol)
# Print a snapshot of the Pymol view in here
v.GetPNG()


Debug
fdname /tmp/tmpJuzFJ5.png
0
Out[2]:

In [1]:
# PLOT
# example: do not put any comment in the plot line
%plot T*md -c 2 3

%plot -h # Retrieve the guide line


usage: pyplot [-h] [-v] [-c [col [col ...]]] [-nl] [-ks [key [key ...]]]
              [-xl XLABEL] [-yl YLABEL] [-m] [-l] [-xr XRANGE XRANGE]
              [-yr YRANGE YRANGE]
              <FILENAME> [<FILENAME> ...]

Build Graph

positional arguments:
  <FILENAME>            file containing the data (# is comment)

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -c [col [col ...]], --columns [col [col ...]]
                        columns to build the graph (starting from 1)
  -nl, --no-legend      suppress the legend on the output
  -ks [key [key ...]], --keys [key [key ...]]
                        keys for the legend (if ? normal key will be used)
  -xl XLABEL, --xlabel XLABEL
                        label of the x axis
  -yl YLABEL, --ylabel YLABEL
                        label of the y axis
  -m, --markers         toggle markers
  -l, --line            toggle line
  -xr XRANGE XRANGE, --xrange XRANGE XRANGE
                        set the x range (: for nothing)
  -yr YRANGE YRANGE, --yrange YRANGE YRANGE
                        set the y range (: for nothing)

Some General Example

Creating a list of molecules from an xyz trajectory

  trj_list = list(pybel.readfile('xyz', 'filename.xyz')

Then it should be take out a list of snapshot or similar...