Blogs

Utimate Flexibility

Well, I've finally finished sorting out the new ID scheme that is used to identify objects in a simulation (e.g. atoms, residues, chains, molecules). The scheme is incredibly flexible, and is best understood by demonstration;


//select the residue ALA 39
res = mol.select( ResName("ALA") + ResNum(39) )

//what if there are two ALA 39 residues (maybe in two chains)
// Lets select the first one
res = mol.select( (ResName("ALA")+ResNum(39))[0] )

// Lets select the one that is the chain called "A"
res = mol.select( ChainName("A") + ResName("ALA") + ResNum(39) )

AtomIndex is not an index - and AtomID is not an ID!

I can now officially say that Sire is cross-platform - yes, it now works on a Mac. The Unix foundation of OS X meant that nothing much was needed other than me fixing some problems in my cmake build files, and fixing a few bugs that OS X picked up (mainly missing SIRE_BEGIN_HEADER or SIRE_END_HEADER lines).

OS X

I've just got a new toy - a nice little macbook :-)

Metadata and Metaforcefields

With the paper now out of the way, I have been concentrating on cleaning up parts of Sire that I am not happy with. The first thing to change was the forcefields. While designing the forcefields I used separate code for each pair-pair forcefield, despite each one using the same basic ideas (so I had seperate LJFF, CoulombFF and CLJFF, each with their own class for intermolecular all molecules - InterLJFF, InterCoulombFF and InterCLJFF, each with own intermolecular grouped FF, InterGroupLJFF, InterGroupCoulombFF and InterGroupCLJFF).

The code works!

I am now in the process of writing up for publication some QM/MM simulation results produced by Sire! The code worked extremely well, and produced lots of good trajectories which I have been analysing. The nice thing is that the code now feels more tested, as the code was able to produce large trajectories without leaking any memory, and producing results that are comparable to experiment and to other simulations. Of course, all of this running of simulations etc.

900 to 25000 in 3 days!

I've just written nearly 25 thousand lines of code in just 3 days! Well, to be honest, I've only written nearly 900 lines of code, and then Py++ then went and generated the other 25 thousand! This may sound like nothing, that an auto-code generator tool has produced lots of code, but the key thing here is that before Py++ I had had to write thousands of lines of python wrapping code by hand (I used to have over 10 thousand lines of python wrapping code which were written and maintained by hand). Py++ has changed this into 900 lines, which are much easier to maintain, understand and configure.

Computers Replacing Programmers...

I've bitten the bullet, and finally moved over to using Py++ to generate the python bindings for Sire. I've spent the last couple of years writing my python wrappers by hand. This was great, as I had complete control of the bindings, and was able to add neat overloads, e.g. turning a tuple of atom IDs into a bond. I've always steered clear of code generators as I have rarely been happy with the resulting code, and have never felt that I've had sufficient control over the generated bindings to achieve the result that I want.

Talks and Teaching

It's been a busy week, with another busy week to come. I gave talks on Tuesday and Wednesday last week (including one to some scientists from Novartis who were visiting Bristol for the day), and then spent the end of the week in London at a meeting, and then at an all day course on how to apply for European grants. Next week I am giving another talk, and I will also be spending each afternoon teaching undergraduates how to do QM/MM calculations. On the plus side, my wife won tickets to the ballet this coming Friday, so at least the week will end on a relaxing note.

QM to MM Perturbations

I've made a decision regarding my QM forcefields - I won't add any MM terms to them! I'm back working with MolproFF and I was thinking about how I would use it during a QM/MM simulation. Molpro can handle QM/MM by allowing point charges to be placed around the QM atoms, thus allowing electrostatic polarisation of the wavefunctions when they are calculated. This polarisation thus incorporates the electrostatic interaction energy between the QM and MM atoms. However, it does not include the van der waals interactions between the QM and MM atoms.

Rapid Prototyping

The code in Sire to handle complete molecular systems is now progressing well, and I am now finally implementing ideas that I have had way back in April last year. In particular, I have now pretty much finished the implementation of dynamic forcefields. Each forcefield has functions (FFComponents) that represent components within that forcefield, e.g. the coulomb and LJ energy of an intermolecular forcefield, or the bond energy of an intramolecular forcefield.