rdkit-blog-fastpages icon indicating copy to clipboard operation
rdkit-blog-fastpages copied to clipboard

Demonstrating using chembl_downloader to get SDF path

Open cthoyt opened this issue 3 years ago • 1 comments
trafficstars

As a follow-up to this twitter discussion

this PR makes a small change to automate the download of the ChEMBL SDF file using the lightweight chembl_downloader package. It chooses a file path that's deterministic on all systems so it can abstract away the need for a local file path for the ChEMBL SDF file.

It would also be possible to replace the whole line with gzip.open(sdf_path) as gz, Chem.ForwardSDMolSupplier(gz) as suppl: with with chembl_downloader.supplier(version="29") as suppl:, but I think that would be a bit too esoteric.

cthoyt avatar Dec 21 '21 13:12 cthoyt

Hi @cthoyt, sorry I'm so slow to reply to this one; I missed the notification and am just now seeing it.

I'd be happy to mention using the chembl_downloader here (and agree that it could be useful to people who don't already have a local copy of the file downloaded), but would prefer to have that pulled out into a separate code block/section.

greglandrum avatar Feb 23 '22 05:02 greglandrum