This is a read-only mirror of pymolwiki.org

Difference between revisions of "CCTBX"

From PyMOL Wiki
Jump to navigation Jump to search
m (1 revision)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=Computational Crystallography Toolbox=
+
This page describes how to use the [https://github.com/cctbx/cctbx_project Computational Crystallography Toolbox (cctbx)] with PyMOL.
[http://cctbx.sourceforge.net cctbx]
 
  
==Using With PyMol==
+
cctbx and PyMOL need to be compiled with the same Python distribution, otherwise they won't be compatible.
  
===On a Mac===
+
=== Incentive PyMOL ===
There is a page on the cctbx with special instructions for using it on the Mac [http://cci.lbl.gov/cctbx_build/mac_os_x_notes.html cctbx On Mac].  Note that you need to use the "Framework" build of PyMOL [http://delsci.com/frameworkpymol/ FrameWorkPyMol].
 
  
===Windows XP (Roger Dodd)===
+
Create a [https://repo.continuum.io/miniconda/ conda] environment with [https://anaconda.org/schrodinger/pymol schrodinger::pymol] and [https://anaconda.org/conda-forge/cctbx-base conda-forge::cctbx-base].
1. Download and install python (to the default location - C:\Python24)
 
  
[http://www.python.org/ftp/python/2.4.1/python-2.4.1.msi Python-2.4.1]
+
On Linux and Windows:
  
1a. If you want to use the draw_symops.py or draw_symops_cctbx.py
+
<syntaxhighlight lang="bash">conda create -n env1 schrodinger::pymol conda-forge::cctbx-base</syntaxhighlight>
scripts you also need to install numarray after installing python
 
  
[http://prdownloads.sourceforge.net/numpy/numarray-1.3.3.win32-py2.4.exe?download Numarray-1.3.3]
+
On macOS, you also need [https://anaconda.org/schrodinger/pymol schrodinger::tk] and [https://www.xquartz.org/ XQuartz]:
  
2. Download cctbx *without* python included and unpack into
+
<syntaxhighlight lang="bash">conda create -n env1 schrodinger::pymol conda-forge::cctbx-base schrodinger::tk</syntaxhighlight>
C:\cctbx_build and C:\cctbx_sources (i.e. execute the file in C:\)
 
  
[http://cci.lbl.gov/cctbx_build/ cctbx]
+
=== Open-Source PyMOL ===
  
3. Download pymol built against python 2.4 (but not including its own
+
See [[CCTBX-fedora32]].
python) and install in the default location
 
 
 
[http://delsci.com/rel/098/pymol-0_98rc5-bin-win32-py24.zip pymol-0_98rc5]
 
 
 
(Newer versions of PyMOL linked against an external python are available from Delano Scientific on request for holders of a valid subscription.)
 
 
 
4. Create 2 files (use notepad or wordpad or any other text editor) and
 
save in the C:\Program Files\Delano Scientific\PyMOL directory:
 
 
 
    a) pymol.cmd
 
 
 
      @cctbx.python -x "%~f0" %* & exit /b
 
        import cctbx
 
        import pymol
 
 
 
    b) run.cmd
 
 
 
        CALL C:\cctbx_build\setpaths_all.bat
 
        CALL "C:\Program Files\Delano Scientific\PyMOL\pymol.cmd"
 
 
 
5. It's important to have python in your path variable (which you can access by going to control panel|system|advanced|environment variables), just add C:\python24 to the end of the path variable, separated by a semi-colon.
 
 
 
===Linux (Robert Campbell)===
 
When you run the setpaths.sh script, it adds the cctbx_build/bin directory to the *front* of your $PATH. In that directory is a shell script called "python" that sets the environment necessary to import cctbx. So, to get cctbx to work, you have to call python without prefixing a directory path.  If you were like me and had:
 
/usr/bin/python  $PYMOL_PATH/modules/launch_pymol.py $*
 
in your pymol.com file, then it would not run that cctbx_build/bin/python script. So you need to either change the above line to:
 
python  $PYMOL_PATH/modules/launch_pymol.py $*
 
(assuming you've already run the setpaths.sh script) or you need to copy the cctbx_build/bin/python contents (without the actual "python" command) into your pymol.com file or some other file that you source before pymol.com.
 
 
 
Within pymol, type the command:
 
print sys.path
 
and you should now see the cctbx directories show up.
 
  
 
[[Category:PyMol_Integration|cctbx]]
 
[[Category:PyMol_Integration|cctbx]]

Latest revision as of 04:05, 7 December 2020

This page describes how to use the Computational Crystallography Toolbox (cctbx) with PyMOL.

cctbx and PyMOL need to be compiled with the same Python distribution, otherwise they won't be compatible.

Incentive PyMOL

Create a conda environment with schrodinger::pymol and conda-forge::cctbx-base.

On Linux and Windows:

conda create -n env1 schrodinger::pymol conda-forge::cctbx-base

On macOS, you also need schrodinger::tk and XQuartz:

conda create -n env1 schrodinger::pymol conda-forge::cctbx-base schrodinger::tk

Open-Source PyMOL

See CCTBX-fedora32.