Bob and Rolf,
A fairly lengthy data list is appended to this email.
It looks like atomIndex assignment has problems with my approach. The
JavaScript function is now:
function appendC(x) {
var scpt = "select;var z={*}.length;set appendNew false;data
'append'|1|add|C 5 5 5|end 'append';show data;";
scpt += "connect (atomIndex = @{z})(atomIndex=" + x + ");select
*;wireframe 0.15; spacefill 23%;boundbox {*};"
scpt += "centerat boundbox;delete hydrogens;minimize addHydrogens;"
jmolScript(scpt, "01");
}
Ammonia (starting molfile) to methyamine works fine.
Subsequent methylamine to ethylamine adds the carbon atom, but it will not
connect, nor will it add hydrogens. Checking all three atomInfo's shows the
problem. There is atomIndex confusion with all the deleting and adding going
on. The array lengths are correct, but atomIndex problems start with the
generated methylamaine. They run 0,4,5,6,7,8,9. It looks like deleted H's
are taken out of the counting sequence.
I suspect this was happening in my atom substitution approach which also
deleted H's, but there I was selecting atoms by picking only - not
calculation.
The astatine trick bypassed this problem also, though that's not the reason
that I used it.
Any thoughts?
Otis
Three atomInfo data sets:
atomInfo *Vector[4]
atomInfo[1].element "nitrogen"
atomInfo[1].visible true
atomInfo[1].model "1"
atomInfo[1].radius 0.7416667
atomInfo[1].visibilityFlags 13
atomInfo[1].clickabilityFlags 12
atomInfo[1].bondCount 3
atomInfo[1].atomno 1
atomInfo[1].elemno 7
atomInfo[1].z -0.021499999
atomInfo[1].y 0.47149998
atomInfo[1].x -0.15370001
atomInfo[1].partialCharge -0.3437
atomInfo[1].sym "N"
atomInfo[1].colix -32761
atomInfo[1].spacefill 0.3565
atomInfo[1].coord {-0.15370001 0.47149998 -0.021499999}
atomInfo[1].color "[x3050f8]"
atomInfo[1].info "[SUBUNIT]1:A.N1 #1"
atomInfo[1].atomIndex 0
atomInfo[1]._ipt 0
atomInfo[1].formalCharge 0
atomInfo[2].element "hydrogen"
atomInfo[2].visible true
atomInfo[2].model "1"
atomInfo[2].radius 0.525
atomInfo[2].visibilityFlags 13
atomInfo[2].clickabilityFlags 12
atomInfo[2].bondCount 1
atomInfo[2].atomno 2
atomInfo[2].elemno 1
atomInfo[2].z -0.72179997
atomInfo[2].y 0.55750006
atomInfo[2].x 0.55189997
atomInfo[2].partialCharge 0.1146
atomInfo[2].sym "H"
atomInfo[2].colix -32767
atomInfo[2].spacefill 0.253
atomInfo[2].coord {0.55189997 0.55750006 -0.72179997}
atomInfo[2].color "[xffffff]"
atomInfo[2].info "[SUBUNIT]1:A.H2 #2"
atomInfo[2].atomIndex 1
atomInfo[2]._ipt 1
atomInfo[2].formalCharge 0
atomInfo[3].element "hydrogen"
atomInfo[3].visible true
atomInfo[3].model "1"
atomInfo[3].radius 0.525
atomInfo[3].visibilityFlags 13
atomInfo[3].clickabilityFlags 12
atomInfo[3].bondCount 1
atomInfo[3].atomno 3
atomInfo[3].elemno 1
atomInfo[3].z 0.86950004
atomInfo[3].y 0.3621
atomInfo[3].x 0.2819
atomInfo[3].partialCharge 0.1146
atomInfo[3].sym "H"
atomInfo[3].colix -32767
atomInfo[3].spacefill 0.253
atomInfo[3].coord {0.2819 0.3621 0.86950004}
atomInfo[3].color "[xffffff]"
atomInfo[3].info "[SUBUNIT]1:A.H3 #3"
atomInfo[3].atomIndex 2
atomInfo[3]._ipt 2
atomInfo[3].formalCharge 0
atomInfo[4].element "hydrogen"
atomInfo[4].visible true
atomInfo[4].model "1"
atomInfo[4].radius 0.525
atomInfo[4].visibilityFlags 13
atomInfo[4].clickabilityFlags 12
atomInfo[4].bondCount 1
atomInfo[4].atomno 4
atomInfo[4].elemno 1
atomInfo[4].z -0.2147
atomInfo[4].y -0.3345
atomInfo[4].x -0.70919997
atomInfo[4].partialCharge 0.1146
atomInfo[4].sym "H"
atomInfo[4].colix -32767
atomInfo[4].spacefill 0.253
atomInfo[4].coord {-0.70919997 -0.3345 -0.2147}
atomInfo[4].color "[xffffff]"
atomInfo[4].info "[SUBUNIT]1:A.H4 #4"
atomInfo[4].atomIndex 3
atomInfo[4]._ipt 3
atomInfo[4].formalCharge 0
atomInfo *Vector[7]
atomInfo[1].element "nitrogen"
atomInfo[1].visible true
atomInfo[1].model "1"
atomInfo[1].radius 0.7416667
atomInfo[1].visibilityFlags 13
atomInfo[1].clickabilityFlags 12
atomInfo[1].bondCount 3
atomInfo[1].atomno 1
atomInfo[1].elemno 7
atomInfo[1].z 2.0656333
atomInfo[1].y 4.430047
atomInfo[1].x 1.8383527
atomInfo[1].partialCharge -0.3437
atomInfo[1].sym "N"
atomInfo[1].colix -32761
atomInfo[1].spacefill 0.3565
atomInfo[1].coord {1.8383527 4.430047 2.0656333}
atomInfo[1].color "[x3050f8]"
atomInfo[1].info "[SUBUNIT]1:A.N1 #1"
atomInfo[1].atomIndex 0
atomInfo[1]._ipt 0
atomInfo[1].formalCharge 0
atomInfo[2].element "carbon"
atomInfo[2].visible true
atomInfo[2].model "1"
atomInfo[2].radius 0.80833334
atomInfo[2].visibilityFlags 13
atomInfo[2].clickabilityFlags 12
atomInfo[2].bondCount 4
atomInfo[2].atomno 1
atomInfo[2].elemno 6
atomInfo[2].z 3.1071622
atomInfo[2].y 4.0599203
atomInfo[2].x 2.781368
atomInfo[2].partialCharge 0.0
atomInfo[2].sym "C"
atomInfo[2].colix -32762
atomInfo[2].spacefill 0.391
atomInfo[2].coord {2.781368 4.0599203 3.1071622}
atomInfo[2].color "[x909090]"
atomInfo[2].info "C1 #1"
atomInfo[2].atomIndex 4
atomInfo[2]._ipt 4
atomInfo[2].formalCharge 0
atomInfo[3].element "hydrogen"
atomInfo[3].visible true
atomInfo[3].model "1"
atomInfo[3].radius 0.525
atomInfo[3].visibilityFlags 13
atomInfo[3].clickabilityFlags 12
atomInfo[3].bondCount 1
atomInfo[3].atomno 6
atomInfo[3].elemno 1
atomInfo[3].z 2.328683
atomInfo[3].y 4.091004
atomInfo[3].x 0.8826309
atomInfo[3].partialCharge 0.0
atomInfo[3].sym "H"
atomInfo[3].colix -32767
atomInfo[3].spacefill 0.253
atomInfo[3].coord {0.8826309 4.091004 2.328683}
atomInfo[3].color "[xffffff]"
atomInfo[3].info "H6 #6"
atomInfo[3].atomIndex 5
atomInfo[3]._ipt 5
atomInfo[3].formalCharge 0
atomInfo[4].element "hydrogen"
atomInfo[4].visible true
atomInfo[4].model "1"
atomInfo[4].radius 0.525
atomInfo[4].visibilityFlags 13
atomInfo[4].clickabilityFlags 12
atomInfo[4].bondCount 1
atomInfo[4].atomno 7
atomInfo[4].elemno 1
atomInfo[4].z 1.9643441
atomInfo[4].y 5.4713883
atomInfo[4].x 1.8170958
atomInfo[4].partialCharge 0.0
atomInfo[4].sym "H"
atomInfo[4].colix -32767
atomInfo[4].spacefill 0.253
atomInfo[4].coord {1.8170958 5.4713883 1.9643441}
atomInfo[4].color "[xffffff]"
atomInfo[4].info "H7 #7"
atomInfo[4].atomIndex 6
atomInfo[4]._ipt 6
atomInfo[4].formalCharge 0
atomInfo[5].element "hydrogen"
atomInfo[5].visible true
atomInfo[5].model "1"
atomInfo[5].radius 0.525
atomInfo[5].visibilityFlags 13
atomInfo[5].clickabilityFlags 12
atomInfo[5].bondCount 1
atomInfo[5].atomno 8
atomInfo[5].elemno 1
atomInfo[5].z 3.105448
atomInfo[5].y 2.9581156
atomInfo[5].x 2.9265578
atomInfo[5].partialCharge 0.0
atomInfo[5].sym "H"
atomInfo[5].colix -32767
atomInfo[5].spacefill 0.253
atomInfo[5].coord {2.9265578 2.9581156 3.105448}
atomInfo[5].color "[xffffff]"
atomInfo[5].info "H8 #8"
atomInfo[5].atomIndex 7
atomInfo[5]._ipt 7
atomInfo[5].formalCharge 0
atomInfo[6].element "hydrogen"
atomInfo[6].visible true
atomInfo[6].model "1"
atomInfo[6].radius 0.525
atomInfo[6].visibilityFlags 13
atomInfo[6].clickabilityFlags 12
atomInfo[6].bondCount 1
atomInfo[6].atomno 9
atomInfo[6].elemno 1
atomInfo[6].z 2.9200146
atomInfo[6].y 4.5493455
atomInfo[6].x 3.761986
atomInfo[6].partialCharge 0.0
atomInfo[6].sym "H"
atomInfo[6].colix -32767
atomInfo[6].spacefill 0.253
atomInfo[6].coord {3.761986 4.5493455 2.9200146}
atomInfo[6].color "[xffffff]"
atomInfo[6].info "H9 #9"
atomInfo[6].atomIndex 8
atomInfo[6]._ipt 8
atomInfo[6].formalCharge 0
atomInfo[7].element "hydrogen"
atomInfo[7].visible true
atomInfo[7].model "1"
atomInfo[7].radius 0.525
atomInfo[7].visibilityFlags 13
atomInfo[7].clickabilityFlags 12
atomInfo[7].bondCount 1
atomInfo[7].atomno 10
atomInfo[7].elemno 1
atomInfo[7].z 4.1035566
atomInfo[7].y 4.3770967
atomInfo[7].x 2.4007251
atomInfo[7].partialCharge 0.0
atomInfo[7].sym "H"
atomInfo[7].colix -32767
atomInfo[7].spacefill 0.253
atomInfo[7].coord {2.4007251 4.3770967 4.1035566}
atomInfo[7].color "[xffffff]"
atomInfo[7].info "H10 #10"
atomInfo[7].atomIndex 9
atomInfo[7]._ipt 9
atomInfo[7].formalCharge 0
atomInfo *Vector[8]
atomInfo[1].element "nitrogen"
atomInfo[1].visible true
atomInfo[1].model "1"
atomInfo[1].radius 0.7416667
atomInfo[1].visibilityFlags 13
atomInfo[1].clickabilityFlags 12
atomInfo[1].bondCount 3
atomInfo[1].atomno 1
atomInfo[1].elemno 7
atomInfo[1].z 2.0905643
atomInfo[1].y 4.4776516
atomInfo[1].x 1.8109182
atomInfo[1].partialCharge -0.3437
atomInfo[1].sym "N"
atomInfo[1].colix -32761
atomInfo[1].spacefill 0.3565
atomInfo[1].coord {1.8109182 4.4776516 2.0905643}
atomInfo[1].color "[x3050f8]"
atomInfo[1].info "[SUBUNIT]1:A.N1 #1"
atomInfo[1].atomIndex 0
atomInfo[1]._ipt 0
atomInfo[1].formalCharge 0
atomInfo[2].element "carbon"
atomInfo[2].visible true
atomInfo[2].model "1"
atomInfo[2].radius 0.80833334
atomInfo[2].visibilityFlags 13
atomInfo[2].clickabilityFlags 12
atomInfo[2].bondCount 4
atomInfo[2].atomno 1
atomInfo[2].elemno 6
atomInfo[2].z 3.111893
atomInfo[2].y 4.06636
atomInfo[2].x 2.7545872
atomInfo[2].partialCharge 0.0
atomInfo[2].sym "C"
atomInfo[2].colix -32762
atomInfo[2].spacefill 0.391
atomInfo[2].coord {2.7545872 4.06636 3.111893}
atomInfo[2].color "[x909090]"
atomInfo[2].info "C1 #1"
atomInfo[2].atomIndex 4
atomInfo[2]._ipt 4
atomInfo[2].formalCharge 0
atomInfo[3].element "carbon"
atomInfo[3].visible true
atomInfo[3].model "1"
atomInfo[3].radius 0.80833334
atomInfo[3].visibilityFlags 5
atomInfo[3].clickabilityFlags 4
atomInfo[3].bondCount 0
atomInfo[3].atomno 1
atomInfo[3].elemno 6
atomInfo[3].z 5.186957
atomInfo[3].y 5.023941
atomInfo[3].x 5.2586737
atomInfo[3].partialCharge 0.0
atomInfo[3].sym "C"
atomInfo[3].colix -32762
atomInfo[3].spacefill 0.391
atomInfo[3].coord {5.2586737 5.023941 5.186957}
atomInfo[3].color "[x909090]"
atomInfo[3].info "C1 #1"
atomInfo[3].atomIndex 10
atomInfo[3]._ipt 10
atomInfo[3].formalCharge 0
atomInfo[4].element "hydrogen"
atomInfo[4].visible true
atomInfo[4].model "1"
atomInfo[4].radius 0.525
atomInfo[4].visibilityFlags 13
atomInfo[4].clickabilityFlags 12
atomInfo[4].bondCount 1
atomInfo[4].atomno 12
atomInfo[4].elemno 1
atomInfo[4].z 2.5826635
atomInfo[4].y 5.0093412
atomInfo[4].x 1.0601625
atomInfo[4].partialCharge 0.0
atomInfo[4].sym "H"
atomInfo[4].colix -32767
atomInfo[4].spacefill 0.253
atomInfo[4].coord {1.0601625 5.0093412 2.5826635}
atomInfo[4].color "[xffffff]"
atomInfo[4].info "H12 #12"
atomInfo[4].atomIndex 11
atomInfo[4]._ipt 11
atomInfo[4].formalCharge 0
atomInfo[5].element "hydrogen"
atomInfo[5].visible true
atomInfo[5].model "1"
atomInfo[5].radius 0.525
atomInfo[5].visibilityFlags 13
atomInfo[5].clickabilityFlags 12
atomInfo[5].bondCount 1
atomInfo[5].atomno 13
atomInfo[5].elemno 1
atomInfo[5].z 2.5826635
atomInfo[5].y 5.0093412
atomInfo[5].x 1.0601625
atomInfo[5].partialCharge 0.0
atomInfo[5].sym "H"
atomInfo[5].colix -32767
atomInfo[5].spacefill 0.253
atomInfo[5].coord {1.0601625 5.0093412 2.5826635}
atomInfo[5].color "[xffffff]"
atomInfo[5].info "H13 #13"
atomInfo[5].atomIndex 12
atomInfo[5]._ipt 12
atomInfo[5].formalCharge 0
atomInfo[6].element "hydrogen"
atomInfo[6].visible true
atomInfo[6].model "1"
atomInfo[6].radius 0.525
atomInfo[6].visibilityFlags 13
atomInfo[6].clickabilityFlags 12
atomInfo[6].bondCount 1
atomInfo[6].atomno 14
atomInfo[6].elemno 1
atomInfo[6].z 2.6336997
atomInfo[6].y 3.5694003
atomInfo[6].x 3.6236215
atomInfo[6].partialCharge 0.0
atomInfo[6].sym "H"
atomInfo[6].colix -32767
atomInfo[6].spacefill 0.253
atomInfo[6].coord {3.6236215 3.5694003 2.6336997}
atomInfo[6].color "[xffffff]"
atomInfo[6].info "H14 #14"
atomInfo[6].atomIndex 13
atomInfo[6]._ipt 13
atomInfo[6].formalCharge 0
atomInfo[7].element "hydrogen"
atomInfo[7].visible true
atomInfo[7].model "1"
atomInfo[7].radius 0.525
atomInfo[7].visibilityFlags 13
atomInfo[7].clickabilityFlags 12
atomInfo[7].bondCount 1
atomInfo[7].atomno 15
atomInfo[7].elemno 1
atomInfo[7].z 3.6665018
atomInfo[7].y 4.965224
atomInfo[7].x 3.093631
atomInfo[7].partialCharge 0.0
atomInfo[7].sym "H"
atomInfo[7].colix -32767
atomInfo[7].spacefill 0.253
atomInfo[7].coord {3.093631 4.965224 3.6665018}
atomInfo[7].color "[xffffff]"
atomInfo[7].info "H15 #15"
atomInfo[7].atomIndex 14
atomInfo[7]._ipt 14
atomInfo[7].formalCharge 0
atomInfo[8].element "hydrogen"
atomInfo[8].visible true
atomInfo[8].model "1"
atomInfo[8].radius 0.525
atomInfo[8].visibilityFlags 13
atomInfo[8].clickabilityFlags 12
atomInfo[8].bondCount 1
atomInfo[8].atomno 16
atomInfo[8].elemno 1
atomInfo[8].z 3.8161242
atomInfo[8].y 3.3569221
atomInfo[8].x 2.269912
atomInfo[8].partialCharge 0.0
atomInfo[8].sym "H"
atomInfo[8].colix -32767
atomInfo[8].spacefill 0.253
atomInfo[8].coord {2.269912 3.3569221 3.8161242}
atomInfo[8].color "[xffffff]"
atomInfo[8].info "H16 #16"
atomInfo[8].atomIndex 15
atomInfo[8]._ipt 15
atomInfo[8].formalCharge 0
--
Otis Rothenberger
http://chemagic.org
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users