primaryodors / primarydock

PrimaryOdors.org molecular docker.
Other
6 stars 4 forks source link

Display hydrogen bonds in viewer. #479

Closed primaryodors closed 2 weeks ago

primaryodors commented 2 weeks ago

Can use NGL's shape class to do this:

// addCylinder(position1: Vector3 | Array, position2: Vector3 | Array, color: Color | Array, radius: Float, name: String): Shape
shape.addCylinder( [ 0, 2, 7 ], [ 0, 0, 9 ], [ 1, 1, 0 ], 0.5 );

Only show hydrogen bonds with energies of -1 kJ/mol or stronger. From -1 to -3 kJ/mol, show them in blue with increasing opacity. From -3 to -30 kJ/mol, show them at a uniform opacity, maybe 0.3, but changing color through teal, green, yellow, and finally to white. If any hbonds surpass -30 kJ/mol, add a magenta tinge. The H...FH hbond has an energy of -161.5, so it's important to gracefully handle values that large.

In the .dock file output, make a dedicated section for hydrogen bonds meeting the -1 kJ/mol threshold. List the HEAVY atoms involved in each bond. The viewer will read and interpret these records in order to construct the hbonds from atom center to atom center.