Problem with patches for modified DNA

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Ennio L
Posts: 3
Joined: Mon Jul 22, 2024 8:49 am

Problem with patches for modified DNA

Post by Ennio L » Tue Jul 23, 2024 3:28 am

Hi,

Relatively new user here,
I have been using openMM with amber FF for both DNA and RNA without major problems but I am struggling to apply patches to run modified DNA/RNA sequences.

I had a look around the forum and I have followed the instructions on this link,
http://docs.openmm.org/latest/userguide ... ce%20field
but I still getting the usual "ValueError: No template found for residue 2 (DG)" and cannot figure out what I am doing wrong.

As an example, I want to run the phosphorothioate version (one oxygen bound on the phosphate is swapped with a sulphur atom) of a simple CG dimer. My approach is to modify the .xlm file to add the patch like showed below:

adding the new atom type

Code: Select all

   <Type class="PS" element="S" mass="32.06" name="DNA-S"/>
adding the patch description

Code: Select all

  <Patches>
    <Patch name="PS">
      <ChangeAtom name="S" type="DNA-S"/>
    </Patch>
  </Patches>
allowing the patch on each residue

Code: Select all

      <AllowPatch name="PS"/>
and the phosphate group on the pdb file is modified to:

Code: Select all

   
ATOM     29  P    DG A   2      22.409  31.286  21.483  1.00  0.00         P
ATOM     30  S    DG A   2      23.536  32.157  21.851  1.00  0.00         S
ATOM     31  OP2  DG A   2      21.822  31.459  20.139  1.00  0.00         O
ATOM     32  O5'  DG A   2      22.840  29.751  21.498  1.00  0.00         O  
Since is the first time I am using the patches I am not sure what I am doing wrong.
I know it is a simple problem but I think a lot of new users could benefit from a clarification....
I am more than happy to provide the input files, the modified .xlm and the python script if useful.

Thanks guys for the great work.

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: Problem with patches for modified DNA

Post by Peter Eastman » Wed Jul 24, 2024 1:15 pm

This FAQ entry discusses the various things that can cause that error message. I'm going to guess you have incorrect bonds. When loading a PDB file it knows to add bonds to standard residues, but if you've modified it to be nonstandard it won't know how to add the necessary bonds, and therefore it won't match the template.

Your patch definition also looks incorrect. ChangeAtom means to change the type of an existing atom. The line

Code: Select all

<ChangeAtom name="S" type="DNA-S"/>
means to look for an existing atom named "S" and assign a different type to it. But none of the standard DNA templates have an atom named "S", so it can't be applied to them. You probably instead want to use RemoveAtom to remove the oxygen, AddAtom to add the sulfur in its place, and AddBond to indicate that it's bonded to the phosphorus.

User avatar
Gunnar W
Posts: 2
Joined: Fri Jul 26, 2024 6:38 am

Re: Problem with patches for modified DNA

Post by Gunnar W » Fri Jul 26, 2024 7:02 am

Hi,

I'm an openMM and MD novice, working on a similar problem.
I have made an .xml file with the following

Code: Select all

<ForceField>
	<Patches>
		<Patch name="SP">
			<RemoveAtom name="O1P" type="O"/>
			<AddAtom name="S01" type="S"/>
			<RemoveBond atomName1="O1P" atomName2="P"/>
			<AddBond atomName1="S01" atomName2="P"/>
			<AddBond atomName1="S01" atomName2="P"/>
		</Patch>
	</Patches>
	
	<Residue name="C">
		<AllowPatch name="SP"/>
	</Residue>
	
	<AtomTypes>
		<Type name="S" class="C" element="S" mass="32.059"/>
	</AtomTypes>
	
</ForceField>
I then include this xml file when calling ForceField().
I'm also calling amber14/RNA.OL3.xml and amber/tip3p_standard.xml

The model I'm working on is a single 2-mer RNA. A CG, where one of the oxygen atom on the C residue is replaced by a sulphur atom. The file is attached.

I'm getting the error ".... No template found for residue 2 (C).
I should add that using a model with a normal C residue works fine.
I'ts difficult to find where the fault is. My guess is that maybe the amber14/RNA.OL3 forcefield does not contain the element S and more needs changes need to be done to the forcefield.

Any suggestions how to get this to work are welcome.
Attachments
CG_S.txt
(7.2 KiB) Downloaded 453 times

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: Problem with patches for modified DNA

Post by Peter Eastman » Wed Jul 31, 2024 11:59 am

I see several problems with your PDB file:

- It lists all the atoms with HETATM rather than ATOM. C and G are standard residues, but the file claims they're heterogens.
- The hydrogens are named incorrectly. They just have arbitrary numbers like H01 and H02.
- The molecule isn't terminated correctly, or perhaps it's that the bonds are listed incorrectly. Look at the CONECT record for atom 16 (O3' in the first residue). It adds bonds to atoms 14 and 32, which are C3' in the first residue and P in the second residue, respectively. But a terminal O3' also includes a terminal hydrogen which is missing.

User avatar
Ennio L
Posts: 3
Joined: Mon Jul 22, 2024 8:49 am

Re: Problem with patches for modified DNA

Post by Ennio L » Mon Aug 12, 2024 7:01 am

Hi Peter,

Thanks for the prompt replies... Unfortunately i still have some problem to have the modified version (PS) working...

I built a small example where you can reproduce the problem... I attached two inputs, one working (with unmodified bases) and one not working with the PS substitution, here are the files...

1bna_2n.pdb: standard CG system, it will run.
1bna_2n_modified.pdb: PS modified CG system, it will throw the error.
run_exp.py: the python file to test the systems.
DNA_mod_CG.xml: the amber file with the added patches.

I hope this is enough to reproduce the problem.
Thanks again for your time.
Attachments
inputs_patches.tar.gz
(9.57 KiB) Downloaded 461 times

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: Problem with patches for modified DNA

Post by Peter Eastman » Mon Aug 12, 2024 8:45 am

It still has the same problem described above. Your PDB file labels the residue as DG, claiming that it's a standard residue. But of course it isn't. OpenMM tries to add the standard bonds expected in a DG residue, but there are no bonds connecting the S atom.

User avatar
Ennio L
Posts: 3
Joined: Mon Jul 22, 2024 8:49 am

Re: Problem with patches for modified DNA

Post by Ennio L » Tue Aug 13, 2024 8:37 am

Hi Peter, thanks again for the reply,
I think this is the part which is not too clear... my understanding is that patches allow to define new Residues based on existing ones, so we don't have to redefine an entire new residue because of a single modification. So far so good....
But then it would be logic for me to point at the patched residue (in this case DG) which allows the patch needed.

What am I missing here? and if this is not the case, how am I supposed to call the new residue?
This might sound obvious from someone quite navigated but it would be of much help for people that just started to use patches....

I guess what am I asking is... What corrections will the modified PDB file require in order to work?

Many thanks

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: Problem with patches for modified DNA

Post by Peter Eastman » Tue Aug 13, 2024 9:19 am

Read https://github.com/openmm/openmm/wiki/F ... s#template, which explains what's going on. There are two distinct things here: the definition of the molecules to simulate, which comes from the PDB file, and the definition of the force field, which comes from the XML file. The two need to match. If there's any difference between them, the force field won't be able to parameterize the molecules.

Patches are part of the definition of the force field. They're a concise way of defining lots of templates at once so it can parameterize a wider range of molecules. But the molecules themselves still need to be specified with a complete, valid PDB file. If you start from an incorrect PDB file, the definition of the molecules will be incorrect. The force field won't be able to parameterize them because it's intended to parameterize correctly defined molecules, not incorrectly defined ones.
What corrections will the modified PDB file require in order to work?
There are two main changes.

1. Call the residue by the correct name. I'm not sure what the PDB code is for that particular modified nucleotide, but I assume it's been defined. You can look it up on Ligand Expo.

2. Since it's not a standard nucleotide, OpenMM won't add any bonds to it automatically. You need to include CONECT records to specify the bonds.

Although it's not really "correct", you might be able to make it work if you keep calling it DG (so OpenMM will add all the bonds that appear in a standard DG residue), and add CONECT records only for the bonds involving the S. That's a hack, but it might work.

User avatar
Gunnar W
Posts: 2
Joined: Fri Jul 26, 2024 6:38 am

Re: Problem with patches for modified DNA

Post by Gunnar W » Fri Aug 16, 2024 8:08 am

I sort of got Patches to work.
Using the files from Ennio I did the following.

1. added CONECT information to 1bna_2n_modified.pdb, using pymol. Saved the file as 1bna_2n_modified2.pdb

2.Added a new atom type to the DNA_mod_CG.xml file

Code: Select all

<Type class="SP1" element="S" mass="32.06" name="DNA-S"/>
3. Modified the patches block in DNA_mod_CG2.xml

Code: Select all

<Patches>
    <Patch name="PS">
      <RemoveAtom name="OP1" type="DNA-O2"/>
      <RemoveBond atomName1="OP1" atomName2="P"/>
      <AddAtom charge="-0.7761" name="S" type="DNA-S"/>
      <AddBond atomName1="S" atomName2="P"/>
    </Patch>
 </Patches>
As far as I can see, the residue and atom names in the PDB file don't matter. What matters is the CONECT information and the atom elements.
The elements and bonds in the force field residues have to match the elements and bonds in the PDB file.

4. Added AllowPatch only to the DG3 residue, since the nucleotide with the sulphur atom is a 3' terminal G.

Code: Select all

<AllowPatch name="PS"/>
5. Added a non-bonded force for the sulphur atom

Code: Select all

<Atom epsilon="0.87864" sigma="0.2959921901149463" type="DNA-S"/>
Saved the force field file as DNA_mod_GC2.xml

Note. The charge and non-bonded force are just copied from the DNA-O2 atom type.
The simulation runs but the results are of course rubbish. So still some work left to do.
Any suggestions are welcome.

The files I used are attached.
Attachments
patches2.zip
(11.34 KiB) Downloaded 476 times

POST REPLY