Skip to content

Retrieve 3D conformers - #24

Open
tmcgrath325 wants to merge 9 commits into
JuliaHealth:masterfrom
tmcgrath325:tmm/conformers
Open

Retrieve 3D conformers#24
tmcgrath325 wants to merge 9 commits into
JuliaHealth:masterfrom
tmcgrath325:tmm/conformers

Conversation

@tmcgrath325

@tmcgrath325 tmcgrath325 commented May 6, 2025

Copy link
Copy Markdown

This adds a way to retrieve conformers (SDF) for a compound via get_conformers_for_cid. Information about these conformers can be found in the documentation for the PubChem3D Project.

To get tests to pass, I've regenerated the BrokenRecord files for all tests, added a new xref entry for cyclic guanosine monophosphate, and tinkered with the CI. I'd be happy to separate out these changes to a separate PR if that's preferable.

There seem to be some kinks that still need ironing out with BrokenRecord before this is ready to be merged, since records generated in my local environment fail tests in CI due to mismatched headers.

@timholy timholy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for contributing this!

Comment thread src/query.jl Outdated
Comment thread src/query.jl Outdated
tmcgrath325 and others added 7 commits July 8, 2026 17:24
Under HTTP/2 all requests to a host multiplex over one shared
connection, so a single wedged connection stalls every subsequent
request. Pin HTTP/1.1, whose independent pooled connections confine a
stall to the one request, and bound the read-inactivity time so a
request cannot hang indefinitely.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Route get_conformers_for_cid through _http_request so conformer
retrieval inherits the HTTP/1.1 and read-timeout defaults, and sleep
between successive per-conformer SDF fetches. Expose sleep_interval and
readtimeout as keyword arguments.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BrokenRecord's `ignore_headers` deletes the named headers from the request
when it records, not just when it compares. Playback reads the recorded
`Host` header to verify that a request targets the expected server, so
ignoring "Host" yields "Expected request to , got pubchem.ncbi.nlm.nih.gov"
on every replay. Drop it from the list and restore the header in the stored
recordings.

Ignore "Cookie" instead: NCBI sets an `ncbi_sid` cookie on the first live
response, which otherwise makes every later playback in the same session
fail the header check. This allows a subset of the recordings to be
regenerated without deleting them all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants