-
Notifications
You must be signed in to change notification settings - Fork 845
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
TypeError: No registered converter was able to produce a C++ rvalue of type class #2994
Comments
You appear to be sending the list into MolFromSmiles:
mol = Chem.MolFromSmiles(smiles_list)
…----
Brian Kelley
On Mar 10, 2020, at 4:07 AM, abuhaby ***@***.***> wrote:
mol = Chem.MolFromSmiles(smiles_list)
|
@abuhaby Brian is right. You are looping on
or, more concisely and efficiently:
|
@ptosco, Thank you Ptosco. It worked after I applied your fix. |
The RDKit blog is a good start: It doesn't talk about databases, but it will give you a head start on some techniques. |
I will try that. Thanks. |
@ptosco Thanks for the fix! Ran into the same issue and realized I had accidentally called the list, not the SMILES string itself :)
|
I had the same issue but later discovered that it was because some rows didn't have the canonical smiles notation but rather NaN. This makes it impossible to iterate through the column successfully while trying to generate descriptors using the for loop. |
Do a data clean up to resolve the issue. In my case, the line of code below solved it df2 = df[df.canonical_smiles.notna()] |
This explains my problem. There's a Nan in the smiles list, which causes my problem. |
Trust you were able to resolve the issue
…On Sun, Feb 27, 2022, 9:17 AM Xiaopeng Xu ***@***.***> wrote:
I had the same issue but later discovered that it was because some rows
didn't have the canonical smiles notation but rather *NaN*. This makes it
impossible to iterate through the column successfully while trying to
generate descriptors using the for loop.
This explains my problem. There's a Nan in the smiles list, which causes
my problem.
—
Reply to this email directly, view it on GitHub
<#2994 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALSATJUMRKJFTG6ONR7SKO3U5HM2XANCNFSM4LEZGZYQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
facing the same issue |
@acchu69 Please do not post on closed issues - post in Discussions if you have a question as it may help others.
If you want a list of SMILES as strings, you need something like:
|
Description:
When I try to below code in jupyter notebook:
smiles_list = ['C(C(=O)O)N' , 'NC@@HC(O)=O']
mol_list = []
for smiles in smiles_list:
mol = Chem.MolFromSmiles(smiles_list)
mol_list.append(mol)
img = Draw.MolsToGridImage(mol_list)
img
I get the following error message:
TypeError: No registered converter was able to produce a C++ rvalue of type class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > from this Python object of type list
KINDLY HELP ME FIX THE ABOVE ERROR.
The text was updated successfully, but these errors were encountered: