Obtaining Code

Most of ChimeraX is written in Python and that code is included in the ChimeraX distribution:

Windows: ChimeraX/bin/Lib/site-packages/chimerax
macOS: ChimeraX.app/Contents/lib/python3.x/site-packages/chimerax
Linux: chimerax/lib/python3.x/site-packages/chimerax

The ‘3.x’ in the latter two lines depends on the exact version of Python 3 being used by your version of ChimeraX. ChimeraX 1.0 and 1.1 use 3.7. ChimeraX 1.2 uses 3.8. Later ChimeraX versions may use even later versions of Python 3.

Small modifications to the code can be tested by simply editing the Python code and restarting ChimeraX.

Git Repository

The Python and C++ ChimeraX source code is available at the ChimeraX GitHub repository.

How to use Git

Here are a minimal set of commands to get started using git:

  1. Git associates a user name and email address with all check-ins. The defaults are based on your USERNAME and your computer’s hostname. The email address is usually wrong. To explicitly set those values:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com
  2. Make local copy of repository:

    git clone https://github.com/RBVI/ChimeraX.git
  3. Use the develop branch (the master branch is only used for releases):

    git switch develop
  4. To update repository to latest version:

    git pull
  5. Add current state of file to the repository:

    git add "filename(s)"
  6. Commit all changes to repository (added files and changes to those added files):

    git commit -a
  7. Copy local repository changes to master repository:

    git push
  8. Diff from previous to current revision of file (ignores additions):

    git whatchanged -n 1 -p <file>
  9. Diff to previous commit of file:

    git diff HEAD^ <file>