Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in the results format ? #20

Open
DrDreher opened this issue Aug 22, 2019 · 5 comments
Open

Changes in the results format ? #20

DrDreher opened this issue Aug 22, 2019 · 5 comments

Comments

@DrDreher
Copy link

Hi,

Trying to recover Chemspider ID using search method, it usually worked, giving me a list of as described in documentation

however since today, i receive :

Results(Complete)

the success method gives me False, however sdf() gives me information on the compound

It's like the search worked but ended with an error.

I tried with different compounds and different keys.

Has there been any change during the last month ?

@m-rivera
Copy link

I'm having a similar problem today. Has there been a new change recently?

The example cs.search('O=C(OCC)C') from the documentation returns Results(Created) and then Results([]).

@sharped-rsc
Copy link

Hi @m-rivera ,
Have you successfully been able to use the package prior to today?
Which version of ChemSpiPy are you using?

Dave

@m-rivera
Copy link

Hi @sharped-rsc ,

I tried it last mid-February with no issue.
I tried it with versions 2.0.0 and 1.0.5.

Just doing some more exploration now, I found out that cs.search('benzene') does find Results([Compound(236)]), however no luck for cs.search('O=C(OCC)C').

I also tried different search methods which are not working for me. cs.search_by_formula('C44H30N4Zn') returns 'ChemSpider' object has no attribute 'search_by_formula'.

Miguel

@sharped-rsc
Copy link

Hi @m-rivera,

Version 1.05 used the old ChemSpider APIs that are now deprecated, so you will need to use 2.0.0.

Looking at the two issues that you raise I think I can see the cause(s) and I think that the issue is that some of the examples show methods that were part of the V1 series of releases but do not exist in V2 (I may have missed something in the code, @mcs07 might be able to confirm or correct me)

In the new RSC APIs looking up smiles or InChIs is handled by different APIs, changing the scope of the search function. A work around for this that I have found would be:

c1 = cs.filter_results(cs.filter_smiles('O=C(OCC)C'))
c2 = cs.get_compounds(c1)

In terms of the formula search, as the error that you provided indicates, the ChemSpider class no-longer has a function called search by formula, an alternative way to achieve the same results would be:

c1 = cs.filter_results(cs.filter_formula('C44H30N4Zn'))
c2 = cs.get_compounds(c1)

I hope that this helps you.

Dave

@m-rivera
Copy link

These are perfect alternate syntaxes, I can now do everything I wanted to!

You're right, I was misguided by the examples, doubled by the fact that the Chemspider website was down for some time yesterday.

Thanks for your help and promptness!

Miguel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants