So I have been looking through the documentation but couldn't find anything relevant. In the SDF file, Chembl name is empty but I do have entry on the chembl ID which I want. Here'
15 12 2 0
16 13 1 0
17 10 1 0
18 16 2 0
19 16 1 0
20 19 2 0
21 18 1 0
22 20 1 0
4 5 2 0
10 9 2 0
21 22 2 0
M END
> <chembl_id> (4)
CHEMBL6226
> <chembl_pref_name> (4)
None
$$$$
But
for idx, mol in enumerate(self.hits):
print(mol.GetProp("_Name"))
throws me whitespace. I need the chembl ID in this case.
The properties in your SDF are added to the molecules. You can access them in a few different ways:
The _Name property is added from the title line of the SD file i.e. in this example the _Name property will be '6602966' (PubChem id):