I'm trying to write a simple python script to open a mol2 file with a ligand, add hydrogens, add charges and write it into another mol2.
The script is this:
-----------------------------------------
import chimera #1
from chimera import runCommand #2
runCommand('open ligands/lig_in.mol2') #3
runCommand('addh') #4
runCommand('addcharge') #5
runCommand('write format mol2 #0 lig_out.mol2') #6
------------------------------------------
The result mol2 file does no contain any charges.
However, if a run another script that is exactly like this but does not contain the last line (#6), and then
execute the command 'write format mol2 #0 lig_out.mol2' manually, the mol2 file contains charges.
I don't understand why there is a difference with both methods.
best regards.
javier