Structure prediction has not made crystallography obsolete, but it has however made it easier — here I explore a potential trick that could be used. Under certain conditions, proteins pack in mathematically precise crystalline lattices because the lattice configuration is energetically preferable over being free in the unfriendly crystallisation solution used. Sometimes the protein will refuse to crystallise because either it is happy in solution or it would rather unfold. As a result researchers mutate surface residues to be more hydrophobic or copy the crystal packing interface ("crystal epitope") of a homologue that crystallises. A different (untested) approach could be to design the interface with ProteinMPNN or FastDesign. The catch is that one needs to make a model of the desired supercell to optimise. Here I will discuss how to make it.
A segfault and NaN driven series of disconnected ideas, analyses and just plain silly posts about computational biochemistry, synthetic biology and microbiology.
Sunday, 17 August 2025
Wednesday, 8 January 2025
Natural products and drug discovery: an evolutionary take
A question (of the nice variety) that students sometimes ask is about the relevance of natural products. The answer is a yes-and-no answer. I like to add to the usual arguments, an evolutionary take, which is two sided. A lot of secondary metabolites made by plants have been evolved to kill you (a mostly herbivore), but your liver has been evolved to be good at destroying them. For drug discovery, this has two opposite effects: the pro is a long list of antibacterial, antifungal and anticancer compounds to use or to adapt, the con is their ADME (absorption, distribution, metabolism, and excretion) properties have frustrated medchemists for decades and decades. Herein, the two faces of this coin are explored not by advocating for or against natural products, but exploring what they mean for medicinal chemistry.
Sunday, 10 March 2024
Crossposting
I have been rather quiet here, my personal blog, for a variety of reasons. As part of OPIG, I have written a few posts there (Blopig), some on requests (who would willingly write about fixing CUDA installations or exposing Jupyter notebooks in a compute node via reverse port forwarding?) and some out of personal choice. I have been involved in various projects, many of which I would like to write blog post about or people would like me to write about, so I am well behind on what I would like to post.
Monday, 22 January 2024
Custom carbon colours in py3Dmol
Due to NGLView (the Python module) having a frozen older IPywidget version it breaks Colab and the major change for the latter library was a year ago (early 2023), so I am forced to revisit old code and switch to py3Dmol in my Colab demos. Today I figured out how to use custom carbon colours.
Sunday, 31 December 2023
A possible BioB bipass route
Thursday, 24 August 2023
Reading compressed molecular files on NFS
There are some tasks that make one feel like a failed door-to-door evangelist, one amongst these is proselyting about using compressed files on networked file systems. Namely, NFS are slower than local SSD drives, so most often it is actually quicker to read compressed files in memory rather than decompress them to disk. Here are two Python snippets for dealing with small molecule files.
Sunday, 2 July 2023
A note on PLIP interactions
PLIP is a handy tool to enumerate the interactions of a given ligand. However, a few of tripping point I keep having is related to the fact the interactions are namedtuples. Here are some notes to circumvent the traps.
Sunday, 5 March 2023
7 colour electronic paper
For Christmas I recieved a 5.65" seven-colour e-paper display, which is awesome. The catch as everything with a Raspberry Pi or Arduino is that beyond the gloss of the advert is something that is far from a flexible plug and play system. I enjoyed my voyage, but it was rather odd even if typical of a Raspberry Pi project.
Saturday, 18 February 2023
Swapped university logo colour generator
Like many in academia I have moved across a few universities, each with their own colours, blue, gold, grey (I think) and even pine green (yes, like John Deer merch). Universities are quite possessive of their logos and have guidelines on their 'brand identity', which feels alien to academia as we are used to logos for tools being made in PowerPoint if they even have one. One thing that is frowned upon is changing the colours. But the fondness for ones former and present affiliations should not stand in the way. Luckily I have written a JS tool to help you swap the colours!
Sunday, 5 February 2023
Reading a mmCIF from PyMOL in PyRosetta
The mmCIF (PDBx as in extended PDB) format is meant to replace PDB format. Soon the RCSB PDB will have to adopt 4-letter codes for novel chemical components, which will break the PDB format. PDBx format is space separate as opposed to the really annoying column position in the PDB format and in the PDBx format the metadata can be stored in a nearly sensible manner. However, PDBx is solely a deposition format, but it is not really used as analysis format regardless of what the PDB claims. I personally had to add support for it because a reviewer asked me to. This lack of adoption is often attributed to the "if it ain't broken don't fix it" principle. Although I personally would argue that it may due to how it's implemented: opening a PDBx from one program ought to work in another, but this is not often the case. An example of this is PyMOL files read in PyRosetta.
Sunday, 22 January 2023
Typing emoji with a Pico keypad
Typing emoji with a Pico keypad
I got myself a Pimoroni RGB keypad, a keypad with 16 coloured buttons controlled by a Raspberry Pico. So the first thing I wanted to do was code it to output emoji, because I am very professional person. However, this was not a simple task as I had hoped.
Sunday, 20 November 2022
glibc 2.36 vs. CentOS 7: a tale of failure
My favourite part of coding is planning and implementing some cool idea for doing something, especially if it involves some fun maths I read up on Wikipedia a minute beforehand. In reality polishing dirty data, refactoring someone-else's bad code, reverse engineering the use of a module and trying to get stuff to work is what take up most of my time.
Having got cocky I thought I could get the latest GNU library for C (glibc) working
on CentOS 7. I failed miserably, here is my sorry tale down the rabbit hole.
Friday, 4 November 2022
In ML a module is not a namespace but a base class, because... ?
Deep learning is changing the world and fast. The list of achievements is impressive, however, why focus on the positive, when we can moan about the negative? In this blog post I will discuss three minor details that I find annoying about deep learning, namely the key word Module, the limited use of Google/Coral Edge TPUs and the coding quality of the field.
Saturday, 8 October 2022
Star imports trick
Star-imports (from typing import *) in Python are a handy, but dangerous. They are meant for quick coding, i.e. like on a jupyterlab notebook. However they are bad as they can mask other variables and cause issues down the line. They are ubiquitous online as are guides explaining why they are bad, here I just want to share a handy snippet to iron out star-imports.
Saturday, 1 October 2022
Move aside coIP Westerns, ColabFold has got this!
Recently AlphaFold2 released a new batch of models, this time covering all of the Trembl sequences in Uniprot, resulting in a huge number, which got hashtag-academic-twitter and some news editors very excited for the stamp-collecting feat. Personally, I find it annoying, not because it's pointless, but as of writing this, it has made any search for a target by name swamped by irrelevant sequences.
However, AlphaFold is great for other feats.
I have blogged about it a few times (e.g. link), which gives away my positive view of it! It can predict oligomers, with a lot more precision and confidence than docking. It does not always work either technically or meet the hypothesis. I did a long series of experiments with a hypothesis in mind which wasn't valid in the end (here), but revealed novel science and took a few minutes to set up and a few hours to run, which would have taken years if done by Western blot of a co-immunoprecipitation or cross-linking mass-spec.
Sunday, 19 June 2022
Top 10 silliest PDB residue names for ligands!
UPDATE: The PDB will finish 3 letter chemical component IDs sometime before 2024 at which point they will switch to 5 letter codes, which will be usable solely in CIF format: https://www.wwpdb.org/news/news?year=2022#630fee4cebdf34532a949c34
In some situations it is handy to use in an in silico experiment a 3-letter residue name that is not taken in the PDB. For example, PyRosetta has a system of pregenerated topologies for PDB components, which can cause issues when a ligand is loaded and the movers may use that over an incorrectly provided residue type / param file, resulting in a blown up mishapen ligand —an overly common incident*. As a result, having a list handy of what is taken is helpful. Herein are some silly observations about what the taken and untaken names are —but not ranked as a top 10, because this is not a science blog, not my local newspaper.
Saturday, 4 June 2022
Annotate as you go
There's a counter-constructive saying: a project is dead as soon as you add documentation (Aeschylus, I believe).
This could not be more incorrect. Whereas it is true that writing documentation on an evolving project will quickly result in the fresh documentation becoming quickly invalid, it is a planning truth that writing documentation once a project is finishing is impossible because there are a hundread and one more pressing issues. Therefore, adding docstrings to each function, method and class in Python as one goes along is by far more advantageous. Once this is done, however this information needs to be transmuted into documentation. Here is how once can set up ReadTheDocs without falling into a few traps, as the documentation generator Sphinx is ironically weirdly documented and should be done ideally early on, so one knows what mistakes one's making.
Tuesday, 10 May 2022
Show neighbours in nglview
Nglview is a really nice Python library which encodes a widget to show a NGL viewport, a JS 3D protein viewer used until recently by the PDB. One annoying feature is that one cannot select neighbours as easily as say PyMOL's "select byres HEM around 3". But it is possible and here is how.
Saturday, 7 May 2022
JS in Colab
A Jupyter or Colab notebook has two sides, one is the Python kernel, which may be running on a remote machine, and the front-end running in one's browser. The JavaScript in the browser and the Python kernel as a result may be on separate machine, yet it is possible to make them dialogue. However, this differs between Jupyter and Colab, the latter being more restrictive. I have found this difference problematic and even though I may not be fully versed in Colab functionality I want share some pointers, discussed below. Majorly:
- Colab diverges greatly from Jupyter in terms of JS operations.
- JS code injected into Colab is sandboxed within each cell.
- There is no requireJS in Colab cells or window.
- Imported modules have to be external to Colab/Drive.
Saturday, 2 April 2022
Covalents, patches and N-O-S bridges in PyRosetta
PyMOL will strip LINK entries from PDBs on saving while NGL obeys only CONECT entries in PBDs. An exception is PyRosetta: it behaves very nicely with disulfides, isopeptide bonds ( cf. repo of PyRosetta code from Keeble et al.) and other crosslinks —mostly. As a result I thought I'd add a note on how to add them in PyRosetta.



