Hi, I'm Blaine Mooers.
I'm going to be talking about
the use of molecular graphics in Org
for the purpose of doing
reproducible research in structural biology.
I'm an associate professor of biochemistry
and microbiology at the University of Oklahoma
Health Sciences Center in Oklahoma City.
My laboratory uses X-ray crystallography
to determine the atomic structures
of proteins like this one
in the lower left, and of nucleic acids
important in human health.
This is a crystal of an RNA,
which we have placed in this
X-ray diffraction instrument.
And after rotating the crystal
in the X-ray beam for two degrees,
we obtain this following diffraction pattern,
which has thousands of spots on it.
We rotate the crystal for over 180 degrees,
collecting 90 images to obtain all the data.
We then process those images
and do an inverse Fourier transform
to obtain the electron density.
This electron density map has been
contoured at the one-sigma level.
That level's being shown by
this blue chicken wire mesh.
Atomic models have been fitted
to this chicken wire.
These lines represent bonds between atoms,
atoms are being represented by points.
And atoms are colored by atom type,
red for oxygen, blue for nitrogen,
and then in this case,
carbon is colored cyan.
We have fitted a drug molecule
to the central blob of electron density
which corresponds to that active site
of this protein, which is RET Kinase.
It's important in lung cancer.
When we're finished with model building,
we will then examine
the result of the final structure
to prepare images for publication
using molecular graphics program.
In this case,
we've overlaid a number of structures,
and we're examining the distance between
the side chain of an alanine
and one or two drug molecules.
This alanine sidechain actually blocks
the binding of one of these drugs.
The most popular program
for doing this kind of analysis
and for preparing images
for publication is PyMOL.
PyMOL was used to prepare these images
on the covers of these featured journals.
PyMOL is favored because
it has 500 commands
and 600 parameter settings
that provide exquisite control
over the appearance of the output.
PyMOL has over 100,000 users,
reflecting its popularity.
This is the GUI for PyMOL.
It shows in white the viewport area
where one interacts
with the loaded molecular object.
We have rendered the same RET kinase
with a set of preset parameters
that have been named "publication".
The other way of applying
parameter settings and commands
is to enter them at the PyMOL prompt.
Then the third way is to load and run scripts.
PyMOL is actually written in C for speed,
but it is wrapped in Python for extensibility.
In fact, there are over 100 articles
about various plugins and scripts
that people have developed
to extend PyMOL for years.
Here's some examples
from the snippet library that I developed.
On the left is a default
cartoon representation of a RNA hairpin.
I find this reduced representation
of the RNA hairpin to be too stark.
I prefer these alternate ones
that I developed.
So, these three to the right of this one
are not available through
pull downs in PyMOL.
So why developed a PyMOL
snippet library for Org?
Well, Org provides great support
for literate programming,
where you have code blocks
that contain code that's executable,
and the output is shown
below that code block.
And then you can fill
the surrounding area in the document
with the explanatory prose.
Org has great support
for editing that explanatory prose.
Org can run PyMOL through PyMOL's Python API.
One of the uses of such an Org document
is to assemble a gallery of draft images.
We often have to look at
dozens of candidate images
with the molecule in different orientations,
different zoom settings,
different representations,
different colors, and so on.
And to have those images along with…,
adjacent to the code
that was used to generate them,
can be very effective for
further editing the code
and improving the images.
Once the final images have been selected,
one can submit the code
as part of the supplemental material.
Finally, one can use the journal package
to use the Org files as
an electronic laboratory notebook,
which is illustrated with molecular images.
This can be very useful
when assembling manuscripts
months or years later.
This shows the YASnippet pull down
after my library has been installed.
I have an Org file open,
so I'm in Org mode.
We have the Org mode submenu,
and under it, all my snippets
are located in these sub-sub-menus
that are prepended with pymolpy.
Under the molecular representations menu,
there is a listing of snippets.
The top one is for the ambient occlusion effect,
which we're going to apply
in this Org file.
So these lines of code were inserted after,
as well as these flanking lines
that define the source block,
were inserted by clicking on that line.
Then I've added some additional code.
So, the first line defines
the language that we're using.
We're going to use
the jupyter-python language.
Then you can define the session,
and the name of this is arbitrary.
Then the kernel is our means
by which we gain access
to the Python API of PyMOL.
The remaining settings apply to the output.
To execute this code
and to get the resulting image,
you put the cursor inside this code block,
or on the top line,
and enter Control c Control c (C-c C-c).
This shows the resulting image
has been loaded up.
It takes about 10 seconds for this to appear.
So the downside of this is
if you have a large number of these,
the Org file can lag quite a bit
when you try to scroll through it,
so you need to close up these result drawers,
and only open up the ones
that you're currently examining.
These are features I think
are important in practical work.
So, the plus is, a feature that's present,
minus is absent.
I think tab stops and tab triggers
are really important.
Triggers are important for
the fast assertion code,
tab stops are important for
complete, accurate editing of code.
I already addressed the rendering speed
and scrolling issue.
I think the way around this
is just to export the Org document to a PDF file
and do your evaluation of different images
by examining them in the PDF
rather than the Org file.
The path to PDF is lightning fast in Emacs
compared to Jupyter,
where it's cumbersome in comparison.
This is a snapshot of my initialization file.
These parts are relevant to doing this work.
A full description of them
can be found in the README file
of this repository on GitHub.
I'd like to thank the
Nathan Shock Data Science Workshop
for feedback during presentations
I've made about this work.
And I would also like to thank
the following funding sources for support.
I will now take questions. Thank you.
[captions by Blaine Mooers and Bhavin Gandhi]