openmm / pdbfixer

PDBFixer fixes problems in PDB files
Other
464 stars 114 forks source link

Which parameter set(periodicity, offset, k) does PeriodicTorsionForce use in soft.xml? #250

Closed psp3dcg closed 2 years ago

psp3dcg commented 2 years ago

There are several parameter sets in some atom combinations of PeriodicTorsionForce, just like xml code below. <Proper class1="N" class2="CT" class3="C" class4="N" periodicity1="4" phase1="0" k1="0" periodicity2="3" phase2="3.14159" k2="2.3012" periodicity3="2" phase3="3.14159" k3="6.61072" periodicity4="1" phase4="3.14159" k4="1.8828" /> So, how does pdbfixer choose parameters when calculating PeriodicTorsionForce?

peastman commented 2 years ago

This chapter in the OpenMM user guide describes how force fields work. It first matches templates to residues to select an atom type for each atom. Then it matches patterns like the one you quoted to select parameters.

psp3dcg commented 2 years ago

This chapter in the OpenMM user guide describes how force fields work. It first matches templates to residues to select an atom type for each atom. Then it matches patterns like the one you quoted to select parameters.

Thank you for the quick and exact reply. After reading the chapter you mentioned, I still have two questions: First, the Openmm user guide said "each torsion definition can specify multiple periodic torsion terms to add to its atoms." Are these parameter terms equivalent to each other when calculating torsion force? Second, an improper torsion involves a central atom and three others that are bonded to it: atoms 2, 3, and 4 are all bonded to atom 1. I found two definations of the angle of improper dihedral when searching in browser. (1) Consider four atoms i,j,k,l, among which j is linked covalently to i,l,k. The improper angle is defined as the angle between the (jl) line and the plane (ijk) from here (2) If the 4 atoms in an improper quadruplet (listed in the data file read by the read_data command) are ordered I,J,K,L then is the angle between the plane of I,J,K and the plane of J,K,L.from here How does the pdbfixer define the angle of improper dihedral?

peastman commented 2 years ago

Are these parameter terms equivalent to each other when calculating torsion force?

Equivalent in what way? If it lists multiple torsions, all of them are added to the system. Force fields often apply multiple torsions with different periodicities to a single set of four atoms.

Ordering of the atoms in an improper is really complicated, because it's trying to be compatible with various other codes that all use different orders. That's why it has the ordering attribute. If you want to see the exact code it uses, here it is.

https://github.com/openmm/openmm/blob/1dac981a63300a2a53a7925f570995914f7163ed/wrappers/python/openmm/app/forcefield.py#L1867-L1956

psp3dcg commented 2 years ago

an improper torsion involves a central atom and three others that are bonded to it: atoms 2, 3, and 4 are all bonded to atom 1.

OK, thank you for your help~:)

peastman commented 2 years ago

Did you intend to reopen this? Was there something else you wanted clarification on?

psp3dcg commented 2 years ago

Recently I computed the Periodic Torsion Force of 4 atoms according to their true positions in PDB file, but some results seemed not closed to zero. Different with torsion force, Harmonic Bond Force and Angle Force results are almost zero when using true bond length and angle as input. If I take the true atom position as input, is it need to choose the parameter set(periodicity, offset, k) which make the minimum torsion force result , or it is still need to add all parameters to system?

peastman commented 2 years ago

Is there a reason you expect the force to be zero? Unless you energy minimized the structure, it will certainly not be at a minimum. And even if you minimize it, that doesn't mean every contribution to the force will independently be zero, only that the total force will be zero.

psp3dcg commented 2 years ago

Is there a reason you expect the force to be zero? Unless you energy minimized the structure, it will certainly not be at a minimum. And even if you minimize it, that doesn't mean every contribution to the force will independently be zero, only that the total force will be zero.

OK, I got it. Thank you for your answer, you are so nice~:)