CCTBX: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
No edit summary
(conda-forge::cctbx-base)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=Note=
This page describes how to use the [https://github.com/cctbx/cctbx_project Computational Crystallography Toolbox (cctbx)] with PyMOL.
We need someone to make some edits to this page. I don't know anything about CCTBX except what's shown here.


=Computational Crystallography Toolbox=
cctbx and PyMOL need to be compiled with the same Python distribution, otherwise they won't be compatible.
[http://cctbx.sourceforge.net CCTBX]


==Using With PyMol==
=== Incentive PyMOL ===


===On a Mac===
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].
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].


===Roger Dodd's Solution===
On Linux and Windows:
Some folks were having issues getting CCTBX to work.  Here's one solution.


I hesitated to post this because I thought someone would have a more elegant solution, but I have got the draw_cell/symmops scripts working
<syntaxhighlight lang="bash">conda create -n env1 schrodinger::pymol conda-forge::cctbx-base</syntaxhighlight>
on windows with cctbx. I have had it working with all versions of PyMOL including the latest betas. I install PyMOL as usual in '''C:\Program
Files\Delano Scientific\PyMOL'''. I also got hold of python 2.4.1 [http://www.python.org/ftp/python/2.4.1/python-2.4.1.msi Python 2.4.1] and cctbx
[http://cci.lbl.gov/cctbx_build/results/2005_08_18_0201/cctbx_win_xp_py24_pre.exe CCTBX For Windows With Python 2.4] and installed them to '''C:\python24''' and ''''C:\cctbx_build''' & '''C:\cctbx_sources''', respectively.


In order to get things working together, I launch PyMOL with the following batch file:
On macOS, you also need [https://anaconda.org/schrodinger/pymol schrodinger::tk] and [https://www.xquartz.org/ XQuartz]:


<pre>
<syntaxhighlight lang="bash">conda create -n env1 schrodinger::pymol conda-forge::cctbx-base schrodinger::tk</syntaxhighlight>
@ECHO off
set LIBTBX_DIST_ROOT=C:\cctbx_sources
if not defined PYTHONPATH set PYTHONPATH=
set
PYTHONPATH=C:\cctbx_sources\boost_adaptbx;C:\cctbx_sources\scitbx;C:\cctbx_sources\cctbx;C:\cctbx_sources\iotbx;C:\cctbx_build\libtbx;C:\cctbx_sources\libtbx;%PYTHONPATH%
set LIBTBX_BUILD=C:\cctbx_build
set LIBTBX_PYTHON_EXE=C:\Python24\python.exe
if not defined PATH set PATH=
set PATH=C:\cctbx_build\libtbx\bin;C:\cctbx_build\libtbx;%PATH%
set SCITBX_DIST=C:\cctbx_sources\scitbx
set IOTBX_DIST=C:\cctbx_sources\iotbx
set CCTBX_DIST=C:\cctbx_sources\cctbx
set BOOST_ADAPTBX_DIST=C:\cctbx_sources\boost_adaptbx
set LIBTBX_DIST=C:\cctbx_sources\libtbx
if not defined PATHEXT set PATHEXT=
set PATHEXT=.PX;.PY;%PATHEXT%
call "%LIBTBX_PYTHON_EXE%" "%LIBTBX_DIST%\libtbx\assoc_ftype.py"
"C:\Program Files\DeLano Scientific\PyMOL\PyMOLWin.exe"  +2
</pre>


Just save as '''PyMOL.bat''' and run it (this is basically the cctbx '''setpaths.bat''' with a pymol command tagged on the end). I hope this helps.
=== Open-Source PyMOL ===


See [[CCTBX-fedora32]].


 
[[Category:PyMol_Integration|cctbx]]
=== Robert Campbell's Solution ===
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.
 
 
I hope this is clear enough!
 
 
 
[[Category:PyMol_Integration|CCTBX]]

Latest revision as of 04:22, 24 September 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.