Download Pubchem Chemical Compunds fingerprint
1
0
Entering edit mode
3.5 years ago

I want to download fingerprint of pubchem compound with CID I used the Pubchem api: https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/42628049/property/Fingerprint2D/xml

but I have a huge list that I need its corresponding fingerprint Is there any way to download as bulk or any way to speed up retrieving data ?

fingerprint pubchem • 3.1k views
ADD COMMENT
0
Entering edit mode

Hello emanismail.92!

It appears that your post has been cross-posted to another site: https://bioinformatics.stackexchange.com/questions/4788

This is typically not recommended as it runs the risk of annoying people in both communities.

ADD REPLY
0
Entering edit mode
3.5 years ago
h.mon 33k

Not elegant, but works:

cat CIDs.txt | \
while read CID; do
    curl -L https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/${CID}/property/Fingerprint2D/xml -o ${CID}.xml
done

Where CIDs.txt is a file with the CIDs of interest, one per line.

edit: pay attention to NCBI limits:

Request Volume Limitations

All PubChem web pages (or requests to NCBI in general) have a policy that users should throttle their web page requests, which includes web-based programmatic services. Violation of usage policies may result in the user being temporarily blocked from accessing PubChem (or NCBI) resources. The current request volume limits are:

No more than 5 requests per second.

No more than 400 requests per minute.

No longer than 300 second running time per minute.

ADD COMMENT

Login before adding your answer.

Traffic: 2547 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6