<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p>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.<br>
The script is this:<br>
-----------------------------------------<br>
<span style="font-family:courier new,courier,monospace;">import chimera #1<br>
from chimera import runCommand #2<br>
runCommand('open ligands/lig_in.mol2') #3<br>
runCommand('addh') #4<br>
runCommand('addcharge') #5<br>
runCommand('write format mol2 #0 lig_out.mol2') #6</span><br>
------------------------------------------<br>
The result mol2 file does no contain any charges.<br>
However, if a run another script that is exactly like this but does not contain the last line (#6), and then<br>
execute the command '<span style="font-family:courier new,courier,monospace;">write format mol2 #0 lig_out.mol2'</span> manually, the mol2 file contains charges.<br>
I don't understand why there is a difference with both methods.<br>
best regards.<br>
javier<br>
<br></p>
</body>
</html>