QChASM / SEQCROW

Plug-in for ChimeraX providing features for building and manipulating organic and organometallic molecules as well as displaying output from quantum chemistry computations.
GNU General Public License v3.0
21 stars 6 forks source link

How to build your own ligands to add to your personal library and use them in SEQCROW #16

Closed youcaizhu closed 7 months ago

youcaizhu commented 7 months ago

Hello, I have created a diazo ligand using 2D bulilder and added it to "add to personal libary" in SEQCROW. Afterwards, I selected the two N atoms coordinated to the metal atoms for the "swap ligand" operation, but the following error occurs "LookupError: could not determine best path between 2 N 1.520100 -0.935999 -0.373990 and 1 N -1.422200 -0.283099 0.406010 File "C:\Users\49347\AppData\Local\UCSF\ChimeraX\1.7\Python311\site-packages\AaronTools\geometry.py", line 2083, in shortest_path raise LookupError( See log for complete Python traceback." How do I fix this, thank you very much!

ajs99778 commented 7 months ago

It's possible that this is a bug. I'll put the process for adding ligands to the library and swapping them below, but try the latest update (1.8.4)

To add a ligand to the library, you need to have a structure with the ligand bound to a metal or some other atom. Select the atoms that are coordinated to the metal (or other reaction center) and click "set key atoms to current selection" on the tool image Then, select the entire ligand and click "add current selection to library" image

It sounds like your process for swapping the ligand is correct. Let me know if this still does not work.

youcaizhu commented 7 months ago

Yes, that's what I did, but I still keep getting "LookupError: could not determine best path between 1 P -0.153546 1.201277 0.102495 and 2 P 0.028724 -2.172493 0.212685

File "C:\Users\49347\AppData\Local\UCSF\ChimeraX\1.7\Python311\site-packages\AaronTools\geometry.py", line 2083, in shortest_path raise LookupError(

化工化工 @.***

 

------------------ 原始邮件 ------------------ 发件人: "QChASM/SEQCROW" @.>; 发送时间: 2024年1月23日(星期二) 下午3:49 @.>; @.**@.>; 主题: Re: [QChASM/SEQCROW] How to build your own ligands to add to your personal library and use them in SEQCROW (Issue #16)

It's possible that this is a bug. I'll put the process for adding ligands to the library and swapping them below, but try the latest update (1.8.4)

To add a ligand to the library, you need to have a structure with the ligand bound to a metal or some other atom. Select the atoms that are coordinated to the metal (or other reaction center) and click "set key atoms to current selection" on the tool image.png (view on web) Then, select the entire ligand and click "add current selection to library" image.png (view on web)

It sounds like your process for swapping the ligand is correct. Let me know if this still does not work.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ajs99778 commented 7 months ago

At this point, I would try again with the latest version of seqcrow. If you are not prompted to update when you restart ChimeraX, go to Tools → More Tools... on the ChimeraX menu and click "update" on the seqcrow page.

If that still doesn't work, I'd need more details about the structures to fully understand what's going wrong.

youcaizhu commented 7 months ago

Thanks for the answer, it has run successfully. On the other hand, I would like to ask that the current version does not seem to support batch substitution of multiple ligands, whereas substituents can be batch substituted. He will get this kind of error "RuntimeError: only the first model can be replaced

File "C:\Users\49347\AppData\Local\UCSF\ChimeraX\1.7\Python311\site-packages\SEQCROW\tools\structureediting.py", line 448, in do maplig raise RuntimeError("only the first model can be replaced")

化工化工 @.***

 

------------------ 原始邮件 ------------------ 发件人: "QChASM/SEQCROW" @.>; 发送时间: 2024年1月24日(星期三) 凌晨0:27 @.>; @.**@.>; 主题: Re: [QChASM/SEQCROW] How to build your own ligands to add to your personal library and use them in SEQCROW (Issue #16)

At this point, I would try again with the latest version of seqcrow. If you are not prompted to update when you restart ChimeraX, go to Tools → More Tools... on the ChimeraX menu and click "update" on the seqcrow page.

If that still doesn't work, I'd need more details about the structures to fully understand what's going wrong.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ajs99778 commented 7 months ago

Substituting multiple ligands should still work. Make sure "modify selected structure" is unchecked on the tool window. When this is unchecked, seqcrow will make copies of the selected structure and modify those instead. image

youcaizhu commented 7 months ago

Your answers have helped me tremendously. How do I individually save as xyz file if I generate several structures, because I realized that they are all named the same. Is there any way to use the naming of the replacement ligands as the filename for the final xyz export? Thank you very much!

化工化工 @.***

 

------------------ 原始邮件 ------------------ 发件人: "QChASM/SEQCROW" @.>; 发送时间: 2024年1月24日(星期三) 上午10:18 @.>; @.**@.>; 主题: Re: [QChASM/SEQCROW] How to build your own ligands to add to your personal library and use them in SEQCROW (Issue #16)

Substituting multiple ligands should still work. Make sure "modify selected structure" is unchecked on the tool window. When this is unchecked, seqcrow will make copies of the selected structure and modify those instead. image.png (view on web)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ajs99778 commented 7 months ago

I'm afraid I don't think it's possible to save everything to different xyz files without using some python code. If you want to save everything to a Gaussian, ORCA, etc. input file, the recent update added a "batch export" option to the "Build QM Input" tool. I did find and patch a bug with this feature just this evening, so if you try it and have issues try updating to seqcrow version 1.8.6.

That being said, the python code for saving everything to xyz files isn't too bad. Here's a starting point:

import os
from chimerax.atomic import AtomicStructure
from chimerax.core.commands import run

# folder where files will be saved
destination = os.path.expanduser("~/Desktop/all_structures")
os.makedirs(destination, exist_ok=True)

# save all structures to the destination folder
for m in session.models.list(type=AtomicStructure):
    run(session, "save %s/%s.xyz models %s" % (destination, m.name, m.atomspec))

You can save this code to a .py file, then open the file in ChimeraX to run the script.

youcaizhu commented 7 months ago

Thank you very much for your answer, it helped me immensely!

化工化工 @.***

 

------------------ 原始邮件 ------------------ 发件人: "QChASM/SEQCROW" @.>; 发送时间: 2024年1月24日(星期三) 中午11:56 @.>; @.**@.>; 主题: Re: [QChASM/SEQCROW] How to build your own ligands to add to your personal library and use them in SEQCROW (Issue #16)

I'm afraid I don't think it's possible to save everything to different xyz files without using some python code. If you want to save everything to a Gaussian, ORCA, etc. input file, the recent update added a "batch export" option to the "Build QM Input" tool. I did find and patch a bug with this feature just this evening, so if you try it and have issues try updating to seqcrow version 1.8.6.

That being said, the python code for saving everything to xyz files isn't too bad. Here's a starting point: import os from chimerax.atomic import AtomicStructure from chimerax.core.commands import run # folder where files will be saved destination = os.path.expanduser("~/Desktop/all_structures") os.makedirs(destination, exist_ok=True) # save all structures to the destination folder for m in session.models.list(type=AtomicStructure): run(session, "save %s/%s.xyz models %s" % (destination, m.name, m.atomspec))

You can save this code to a .py file, then open the file in ChimeraX to run the script.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ajs99778 commented 7 months ago

Glad I could help!

youcaizhu commented 7 months ago

Hello, I would like to ask if the fly function of chimerax has an operation corresponding to the molecular structure. Because in the video I found only about biology. If I have a bi-ligand metal compound, can I make a movie about the second molecule ligand ligand to a metal mono-ligand compound (see attachment). Thank you very much!

化工化工 @.***

 

------------------ 原始邮件 ------------------ 发件人: "QChASM/SEQCROW" @.>; 发送时间: 2024年1月24日(星期三) 上午10:18 @.>; @.**@.>; 主题: Re: [QChASM/SEQCROW] How to build your own ligands to add to your personal library and use them in SEQCROW (Issue #16)

Substituting multiple ligands should still work. Make sure "modify selected structure" is unchecked on the tool window. When this is unchecked, seqcrow will make copies of the selected structure and modify those instead. image.png (view on web)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ajs99778 commented 7 months ago

I don't see the attachment.

The fly command basically just moves the camera. You position the camera the way you want and do view name step1. Do that in different positions with different names, then you run the fly command, giving it the views you named, and it will move the camera from one position to the next.

You might want to look into the morph or move commands. ChimeraX also has this page which lists some of the common commands used for making movies.

youcaizhu commented 7 months ago

Thank you very much, I'm going to study!

化工化工 @.***

 

------------------ 原始邮件 ------------------ 发件人: "QChASM/SEQCROW" @.>; 发送时间: 2024年1月27日(星期六) 下午2:50 @.>; @.**@.>; 主题: Re: [QChASM/SEQCROW] How to build your own ligands to add to your personal library and use them in SEQCROW (Issue #16)

I don't see the attachment.

The fly command basically just moves the camera. You position the camera the way you want and do view name step1. Do that in different positions with different names, then you run the fly command, giving it the views you named, and it will move the camera from one position to the next.

You might want to look into the morph or move commands. ChimeraX also has this page which lists some of the common commands used for making movies.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>