I thought I would share this solution because I can't think of any program
that has ever done this before, and it's pretty easy in Jmol, and it
relates to a recent posting.
Problem: I have two models for the same compound, from two different
sources, such as PubChem and NCI. Or in this case EPFL (3D) and NCI (2D).
Now, I need to make an exact 1:1 atom map. But the atom are in totally
different order. Including hydrogens. (Because in my case, it's all about
1H NMR spectroscopy.)
How to do that?
Solution:
a) Load both models into Jmol applet "jmolApplet0". For example:
*Jmol.scriptWait(jmolApplet0, 'load files "$caffeine" ":caffeine" ')*
// $ is NCI; : is PubChem
(I'm using scriptWait here because I want to be sure it's done before the
next command is issued.)
b) create the map -- an array of arrays: [ [atom1,atom1'],
[atom2,atom2'],....]
*x = Jmol.evaluateVar(jmolApplet0, "compare({1.1} {2.1} 'MAP' 'H')")*
These will be atom indices, which start at 0 and span both models.
Here's how this is done in JSmolJME:
JavaScript here:
proto.__getAtomCorrelation = function(jmol) {
// get the first atom mapping available by loading the JME structure
into model 2,
jmol._loadMolData(this._molData, "jmeMap = compare({1.1} {2.1} 'MAP'
'H'); zap 2.1", true);
var map = jmol._evaluate("jmeMap");
var n = map.length;
var A = [];
var B = [];
// these are Jmol atom indexes. The second number will be >= n, and all
must be incremented by 1.
for (var i = 0; i < map.length; i++) {
var c = map[i];
A[c[0] + 1] = c[1] - n + 1;
B[c[1] - n + 1] = c[0] + 1;
}
return {toJME:A, toJmol:B}; // forward and rev.
}
Oh, and all you really wanted was an atom alignment, You would just use:
c) If you want, you can align them (instead of or in addition to doing the
above).
*compare {1.1} {2.1} SMILES rotate translate*
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users