[Chimera-users] Discrepancies Between Running Python Script From Terminal and GUI
Eric Pettersen
pett at cgl.ucsf.edu
Mon Jun 6 18:08:43 PDT 2022
Hi Rafi,
Yes, while a script is running Chimera never gets back to the "event loop" to handle mouse clicks and whatnot, so the system marks the application as "not responding". Chimera is also inefficient in its memory use and therefore will typically slow down in a scenario such as yours as memory usage balloons and your machine has to resort to swapping to disk to handle it. It's less inefficient in nogui mode because things like the Reply Log, which would have thousands of lines of output, simply don't exist and therefore don't use memory.
Chimera uses the antechamber/sqm program from the AmberTools package to compute charges for non-standard residues. The quantum mechanical calculation that sqm uses sometimes fails to converge for some molecular charge geometries. This convergence failure is most frequently seen for systems with highly concentrated negative charge, like phosphates, but can happen for any system. I would be surprised if the failure only occurred in nogui mode. Did the script in gui mode actually reach the file that failed? If you can verify that the file works in nogui mode but not gui mode, perhaps you could use Help→Report A Bug and attach the file and I could look into it.
If you are going to use Chimera for this process, I would recommend breaking your task down to maybe a thousand files at a time and using nogui mode. For your failures, you might have to handle them by hand by charging only the standard residues and then editing in the charges for the non-standard residues, assuming there were other structures where the residue was successfully assigned charges.
In regards to possibly using ChimeraX for this task, I'll respond to your message on the chimerax-users list about that.
--Eric
Eric Pettersen
UCSF Computer Graphics Lab
> On Jun 6, 2022, at 5:34 PM, Rafi Brent via Chimera-users <chimera-users at cgl.ucsf.edu> wrote:
>
> To whom it may concern,
> I have a set of about 20,000 pdb files to which I would like to add Hydrogens, add partial charges, and convert to the mol2 format. I have written a python script to perform these tasks, which it does without issue when opened from the GUI using the "open" option in the top left corner. However, as soon as the script start srunning, I become unable to interact with the Chimera GUI and my computer warns that the application is not responding. While it continues to iterate through the pdb files and convert them to mol2 files, this process slows down drastically over time, from one file per second to over 30 seconds between files, a rate that is prohibitively slow. It is not clear to me why these issues are occurring, as there is nothing about the way my script is written that should increase the computational load over time.
> Based on the unresponsiveness of the Chimera application, I assumed that the slowdown might have something to do with the GUI, so I instead ran my script from the terminal, using chimera -- nogui python_script.py . This resulted in a rate of file conversion that was much faster than the GUI even before its slowdown, but it raised an error that was never a problem in the GUI: Cannot properly run "/Applications/Chimera.app/Contents/Resources/bin/amber18/bin/sqm -O -i sqm.in <http://sqm.in/> -o sqm.out". This only occurred on nonstandard amino acid residues, but the error was not solely determined by the residue's identity, as many carboxylated lysine residues were processed properly before the system encountered one particular file whose KCX residue caused it to crash. However, the error is consistent, meaning that the same KCX residue on that particular file always causes the program to crash. I have had no luck searching for the error online, but I am happy to include the entire error message in context if that would be helpful.
> More generally, I don't understand why running the exact same python script through the GUI and through the terminal window gives such different results. I'm happy to do it either way as long as the operation can be completed successfully within a day or two, and I would be very thankful for any advice you may have.
>
> Sincerely,
> Rafi Brent
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimera-users/attachments/20220606/7576548a/attachment.html>
More information about the Chimera-users
mailing list