tbereau / auto_martini

Automatic MARTINI parametrization of small organic molecules
GNU General Public License v2.0
59 stars 22 forks source link

Problem in 'smi2alogps %s" % smiFrag' #7

Open Snehadixit1994 opened 7 years ago

Snehadixit1994 commented 7 years ago

Hi, I wish to use auto-martini for getting CG file for my drug. I tried to use the example given here. However, I am getting following error-

python auto_martini --smi "N1=C(N)N python auto_martini --smi "N1=C(N)NN=C1N" --mol GUA Traceback (most recent call last): File "auto_martini", line 1204, in ringAtomsFlat, True) File "auto_martini", line 835, in printAtoms raise Exception("Problem in smi2alogps %s" % smiFrag) Exception: Problem in smi2alogps Nc1ncnn1

Also, when I was trying to run this script for my molecule, I received this error - Error. Exhaustive enumeration can't handle large molecules. Number of heavy atoms: 41

Please help me in this regard.

tbereau commented 7 years ago

Could you check whether your BeautifulSoup package is working correctly? Try adding the following statement at line 677:

print soup

(It should right beneath soup = doc.prettify()

As for the enumeration issue, auto_martini can't handle large molecules at the moment. That's due to the current exhaustive enumeration of bead mappings--preventing it from working with large molecules. One alternative you have is to break up your molecules into fragments, coarse-grain those, and then connect them yourself.

Best, Tristan

tbereau commented 7 years ago

Any update? Something else that came up is the requirement to have the 'lxml' package. Could you check whether the command

import lxml

returns without an error? If not, try installing it (using pip or equivalent).

Best, Tristan

Snehadixit1994 commented 7 years ago

Respected sir,

I added 'print soup' at line 677 below soup = doc.prettify() as you had suggested. Also, lxml was imported. now I am receiving following error

python auto_martini --sdf gua.sdf --mol gua --verbose ; ring atoms: [[0, 2, 6, 1, 5]] ; Heavy atoms: N N N N N C C ; [0] -43.5137590647 ; [1] -48.8876118299 ; [2] -43.5139391855 ; [5] -45.7019823874 ; [6] -45.7018655559 ; [0, 1] -87.3909378371 ; [0, 6] -87.0065915631 ; [1, 2] -87.3911080548 ; [2, 5] -87.0068963568 ; [5, 6] -89.1948049826 ; CG bead: 5 ; CG bead: 6 ; with energy: -89.1948049826 ; Max. number of attempts: 5 ; Atom partitioning: {0: 0, 1: 0, 2: 1, 3: 0, 4: 1, 5: 0, 6: 1} Traceback (most recent call last): File "auto_martini", line 1205, in ringAtomsFlat, True) File "auto_martini", line 827, in printAtoms molFrag = genMoleculeSMI(smiFrag) File "auto_martini", line 90, in genMoleculeSMI mol = Chem.MolFromSmiles(args.smi) TypeError: No registered converter was able to produce a C++ rvalue of type std::basic_string<wchar_t, std::char_traits, std::allocator > from this Python object of type NoneType

Sincerely, Sneha

On Thu, Feb 9, 2017 at 1:10 PM, Tristan Bereau notifications@github.com wrote:

Any update? Something else that came up is the requirement to have the 'lxml' package. Could you check whether the command

import lxml

returns without an error? If not, try installing it (using pip or equivalent).

Best, Tristan

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tbereau/auto_martini/issues/7#issuecomment-278569002, or mute the thread https://github.com/notifications/unsubscribe-auth/AYWKF-85ruMdKo1YUI1cwKxmtMAYJ0Qyks5rasLdgaJpZM4L2TVN .

tbereau commented 7 years ago

Could you try with the refactor branch? Simply type

git checkout refactor

and then running the code is slightly different:

python auto_martini.py --sdf gua.sdf --mol gua --verbose

Also, I typically run the code with smiles string rather than sdf files. I'd recommend you first convert your sdf file to a smiles string (e.g., using OpenBabel) and then run the code from the smiles string (as you had it in your initial post).

Best, Tristan

Snehadixit1994 commented 7 years ago

Respected sir,

python auto_martini.py --smi "1nc(nc1N)N" --mol gua --verbose

The sanitize.log file says

[11:20:22] SMILES Parse Error: syntax error for input: '1nc(nc1N)N' Traceback (most recent call last): File "auto_martini.py", line 1309, in mol = gen_molecule_smi(args.smi) File "auto_martini.py", line 108, in gen_molecule_smi cp = Chem.Mol(molecule) Boost.Python.ArgumentError: Python argument types in Mol.init(Mol, NoneType) did not match C++ signature: init(_object, RDKit::ROMol, bool, int) init(_object, RDKit::ROMol, bool) init(_object, RDKit::ROMol) init(_object, std::string) init(_object*)

Sincerely, Sneha

On Mon, Feb 13, 2017 at 11:11 AM, sneha dixit dixit.sneha.m@gmail.com wrote:

Respected sir,

python auto_martini.py --smi "N1=C(N)NN=C1N" --mol gua --verbose The sanitize.log file says

[11:10:43] Can't kekulize mol. Unkekulized atoms: 1 2 3 4 5

WARNING:main:Bad smiles format Nc1ncnn1 found [11:10:43] Can't kekulize mol. Unkekulized atoms: 1 2 3 4 5

WARNING:main:Fixed smiles format to Nc1nnc[nH]1 WARNING:main:Error with BeautifulSoup constructor

sincerely, Sneha

On Fri, Feb 10, 2017 at 1:41 PM, Tristan Bereau notifications@github.com wrote:

Could you try with the refactor branch? Simply type

git checkout refactor

and then running the code is slightly different:

python auto_martini.py --sdf gua.sdf --mol gua --verbose

Also, I typically run the code with smiles string rather than sdf files. I'd recommend you first convert your sdf file to a smiles string (e.g., using OpenBabel) and then run the code from the smiles string (as you had it in your initial post).

Best, Tristan

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tbereau/auto_martini/issues/7#issuecomment-278882917, or mute the thread https://github.com/notifications/unsubscribe-auth/AYWKFz2N-YHjb76tr4Uu7oPYMGyG6BN5ks5rbBuqgaJpZM4L2TVN .

tbereau commented 7 years ago

Dear Sneha,

I don't think this is a valide smiles string. Try with "CCCC" instead.

Best, Tristan

Snehadixit1994 commented 7 years ago

Can't kekulize mol. Unkekulized atoms: 1 2 3 4 5

WARNING:main:Bad smiles format Nc1ncnn1 found [01:52:50] Can't kekulize mol. Unkekulized atoms: 1 2 3 4 5

WARNING:main:Fixed smiles format to Nc1nnc[nH]1 WARNING:main:Error with BeautifulSoup constructor

On Mon, Feb 13, 2017 at 8:53 PM, Tristan Bereau notifications@github.com wrote:

Dear Sneha,

I don't think this is a valide smiles string. Try with "CCCC" instead.

Best, Tristan

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tbereau/auto_martini/issues/7#issuecomment-279422533, or mute the thread https://github.com/notifications/unsubscribe-auth/AYWKF3FJmOZu_FfnGJeN9VFmEvWtmUiIks5rcHVXgaJpZM4L2TVN .

tbereau commented 7 years ago

Still using the problematic smiles, right? Looks like you're getting a similar output. On Mon, Feb 13, 2017 at 14:24 Snehadixit1994 notifications@github.com wrote:

Can't kekulize mol. Unkekulized atoms: 1 2 3 4 5

WARNING:main:Bad smiles format Nc1ncnn1 found [01:52:50] Can't kekulize mol. Unkekulized atoms: 1 2 3 4 5

WARNING:main:Fixed smiles format to Nc1nnc[nH]1 WARNING:main:Error with BeautifulSoup constructor

On Mon, Feb 13, 2017 at 8:53 PM, Tristan Bereau notifications@github.com wrote:

Dear Sneha,

I don't think this is a valide smiles string. Try with "CCCC" instead.

Best, Tristan

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/tbereau/auto_martini/issues/7#issuecomment-279422533 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AYWKF3FJmOZu_FfnGJeN9VFmEvWtmUiIks5rcHVXgaJpZM4L2TVN

.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/tbereau/auto_martini/issues/7#issuecomment-279511198, or mute the thread https://github.com/notifications/unsubscribe-auth/AAxNMkoewEdnuokptodv61AK-a2WKkPrks5rcLwEgaJpZM4L2TVN .

anukratig commented 6 years ago

Hi I run the following command: python auto-martini --smi "CCCC" --mol NBUT I am getting the following error-

ALOGPS can't predict fragment: CCCC Traceback (most recent call last): File "auto-martini.py", line 1227, in ringAtomsFlat, True) File "auto-martini.py", line 858, in printAtoms raise Exception("Problem in smi2alogps %s" % smiFrag) Exception: Problem in smi2alogps CCCC python2.7: /usr/include/boost/thread/pthread/mutex.hpp:111: boost::mutex::~mutex(): Assertion `!res' failed. Aborted (core dumped)

I added print(soup) and imported lxml as suggested but still getting same error. Please suggest me. Thanks in advance

tbereau commented 6 years ago

Hi anuktratig,

Try running this python code:

from bs4 import BeautifulSoup
import lxml
import requests
session = requests.session()
req = session.get('http://vcclab.org/web/alogps/calc?SMILES=CCCC')
doc = BeautifulSoup(req.content, "lxml")
soup = doc.prettify()
print soup

You should be getting this:

<html>
 <body>
  mol_N logP logS SMILES
  <br/>
  mol_1 2.81 -1.91 CCCC
  <br/>
 </body>
</html>

Is that the case?

Best, Tristan

anukratig commented 6 years ago

Dear Tristan

I run the pyhton code as suggested. This is what I am getting. screenshot from 2017-12-01 16-12-01

tbereau commented 6 years ago

Does running the code in the browser yield the same?

tbereau commented 6 years ago

Sorry, I meant running the URL.

anukratig commented 6 years ago

Yeah it is working on the browser

Thanks

tbereau commented 6 years ago

What about from the command line using wget?

anukratig commented 6 years ago

All packages are working fine. When i am running the command, it is showing invalid syntax. I am running the following command auto-martini --smi "CCCC" --mol BUT image screenshot from 2018-03-20 18-02-20

tbereau commented 6 years ago

Looks like you're running this from a Python terminal. Run auto-martini from the command line instead.

anukratig commented 6 years ago

Now this error is showing image

tbereau commented 6 years ago

I can't reproduce your error. What branch/commit are you on? Also, did you rename the name of the script? That looks different.

david-martini commented 5 years ago

Hi change auto-martini to auto_martini.