auto_martini icon indicating copy to clipboard operation
auto_martini copied to clipboard

Problem in 'smi2alogps %s" % smiFrag'

Open Snehadixit1994 opened this issue 8 years ago • 20 comments

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.

Snehadixit1994 avatar Feb 03 '17 13:02 Snehadixit1994

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 avatar Feb 06 '17 07:02 tbereau

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

tbereau avatar Feb 09 '17 07:02 tbereau

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<wchar_t>, std::allocator<wchar_t> > from this Python object of type NoneType

Sincerely, Sneha

On Thu, Feb 9, 2017 at 1:10 PM, Tristan Bereau [email protected] 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 .

Snehadixit1994 avatar Feb 09 '17 10:02 Snehadixit1994

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

tbereau avatar Feb 10 '17 08:02 tbereau

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 [email protected] 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 [email protected] 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 .

Snehadixit1994 avatar Feb 13 '17 05:02 Snehadixit1994

Dear Sneha,

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

Best, Tristan

tbereau avatar Feb 13 '17 15:02 tbereau

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 [email protected] 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 .

Snehadixit1994 avatar Feb 13 '17 20:02 Snehadixit1994

Still using the problematic smiles, right? Looks like you're getting a similar output. On Mon, Feb 13, 2017 at 14:24 Snehadixit1994 [email protected] 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 [email protected] 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 .

tbereau avatar Feb 13 '17 23:02 tbereau

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

anukratig avatar Nov 30 '17 13:11 anukratig

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

tbereau avatar Dec 01 '17 07:12 tbereau

Dear Tristan

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

anukratig avatar Dec 01 '17 10:12 anukratig

Does running the code in the browser yield the same?

tbereau avatar Dec 01 '17 11:12 tbereau

Sorry, I meant running the URL.

tbereau avatar Dec 01 '17 11:12 tbereau

Yeah it is working on the browser

Thanks

anukratig avatar Dec 04 '17 10:12 anukratig

What about from the command line using wget?

tbereau avatar Dec 05 '17 08:12 tbereau

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

anukratig avatar Mar 20 '18 12:03 anukratig

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

tbereau avatar Mar 20 '18 12:03 tbereau

Now this error is showing image

anukratig avatar Mar 20 '18 13:03 anukratig

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

tbereau avatar Mar 20 '18 17:03 tbereau

Hi change auto-martini to auto_martini.

david-martini avatar Jun 19 '19 16:06 david-martini