Dear Lei,

the best way to build a new molecule is via the builder in the GUI.


The commands "replace" or "attach" are not well documented. I could reproduce your problem and I think PyMOL runs some kind of check routine after you issue a replace or attach command and it will reset the atomic valence and geometry to sensible values based on the atom environment.


For example, if you construct aniline using the builder the nitrogen has geometry=3 and valence=3. If you try to convert it to a sp3-hybridized nitrogen via "replace N, 4, 3" it keeps geometry=3 and valence=3. You can query the geometry and valence by selecting one or several atoms and use the command:

cmd.iterate("sele", "print(name, geom, valence)").

Next you convert the N-conjugated "double bond" of the aromatic system to a single bond using the builder. The nitrogen stays planar and the geometry ist still 3. Now the command "replace N, 4, 3" works as the nitrogen is no longer next to an aromatic system.


Best wishes,


Norbert



Am 06.02.2025 um 17:54 schrieb Lei Qian:
Dear users,
Could I ask a question on geometry option in replace command?
I tried to use Build/Fragment/XXX to replace an atom to a new one, and pymol GUI shows the corresponding replace command.
However, I found the geometry option always equals to 4.
For example,
PyMOL>replace O, 4, 2
PyMOL>replace N, 4, 3
PyMOL>replace C, 4, 4
I tried to replace the atom in different types of bonds: single/double/triple bonds, but the geometry value is always 4.
Could you please help me figure it out? Thank you very much!
Best,
Lei





_______________________________________________
PyMOL-users mailing list
Archives:http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe:https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Reply via email to