Markus,
In newer versions of RDKit there is a handy method:
d = mol.GetPropsAsDict()
which returns a python dictionary of all the sd data by default. It also
has a nice feature that it converts numeric values to proper python
numbers. This can be used as a python dictionary:
for prop,value in d.items():
print(prop,value)
d.get(prop, None)
and so on.
Cheers,
Brian
On Tue, Jul 12, 2016 at 12:20 PM, Paolo Tosco <[email protected]> wrote:
> Dear Markus,
>
> you may check if the key exists before trying to retrieve its value with
> the HasProp() method.
>
> Cheers,
> p.
> On 12/07/2016 17:10, Markus Metz wrote:
>
> Dear all:
>
> I spend some time searching the rdkit website and its mailing list. But I
> was not able to find anything regarding my issue. I am a newbie. So bear
> with me if this is a FAQ.
>
> I am trying to extract the properties for molecules from an sd file.
> This worked fine with the id.
> But not so for other properties. And I assume this has to do with that not
> for all molecules in the data set these properties are defined. Could this
> be the reason for the error?
> If so, how can I get around it? How does rdkit deal with empty data?
>
> This is a very common question and I apologize in advance for this FAQ.
>
> Best regards,
>
> Markus
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports.http://sdm.link/zohodev2dev
>
>
>
> _______________________________________________
> Rdkit-discuss mailing
> [email protected]https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and
> traffic
> patterns at an interface-level. Reveals which users, apps, and protocols
> are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning
> reports.http://sdm.link/zohodev2dev
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss