English 中文(简体)
利用rdkit或其他假装模块将SMILES改为化学名称或国际化联名称
原标题:Converting SMILES to chemical name or IUPAC name using rdkit or other python module

利用RDKit或其他假装单元将SMILES改为化学名称或国际化联名称吗?

我觉得在其他职位上没有什么帮助。

非常感谢!

最佳回答

As far as I am aware this is not possible using rdkit, and I do not know of any python modules with this ability. If you are ok with using a web service you could use the NCI resolver.

这里是轻率地履行一项职能,从《标准手册》中检索国际独立会计协会的识别特征:

import requests


CACTUS = "https://cactus.nci.nih.gov/chemical/structure/{0}/{1}"


def smiles_to_iupac(smiles):
    rep = "iupac_name"
    url = CACTUS.format(smiles, rep)
    response = requests.get(url)
    response.raise_for_status()
    return response.text


print(smiles_to_iupac( c1ccccc1 ))
print(smiles_to_iupac( CC(=O)OC1=CC=CC=C1C(=O)O ))

[Out]:
BENZENE
2-acetyloxybenzoic acid

您可以很容易地将其扩大到多种不同格式的转换,尽管其功能确实很快......

另一种解决办法是使用PobChem。 您可使用该软件包pubchempy。 考虑到这一点,可能会归还多个化合物。

import pubchempy


# Use the SMILES you provided
smiles =  O=C(NCc1ccc(C(F)(F)F)cc1)[C@@H]1Cc2[nH]cnc2CN1Cc1ccc([N+](=O)[O-])cc1 
compounds = pubchempy.get_compounds(smiles, namespace= smiles )
match = compounds[0]
print(match.iupac_name)

[Out]:
(6S)-5-[(4-nitrophenyl)methyl]-N-[[4-(trifluoromethyl)phenyl]methyl]-3,4,6,7-tetrahydroimidazo[4,5-c]pyridine-6-carboxamide
问题回答

最近,我利用pub管理这一转变。 这里是审判守则。


filename = open("inif.txt", "r")

for line in filename :
    event = line
    compounds = pcp.get_compounds(event, namespace= smiles ) 
    match = compounds[0]
    print(i, $$$ , the CID is ,compounds, $$$ , The IUPAC name is ,match.iupac_name, $$$ , for the SMILE ,event)
    i+=1```




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签