Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Clinical trials lookup function #52

Merged
merged 13 commits into from
Aug 28, 2024
Merged

feat: Clinical trials lookup function #52

merged 13 commits into from
Aug 28, 2024

Conversation

mcannon068nw
Copy link
Contributor

addresses #51

Grab clinical trials data for drugs of interest and return into nice dataframe.


for drug in terms:
intr_url = f"&query.intr={drug}"
full_uri = base_url + intr_url # TODO: + cond_url + term_url
Copy link
Member

Choose a reason for hiding this comment

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

what's the story here?

Copy link
Member

Choose a reason for hiding this comment

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

Also, I wonder if we can reduce the size of the response with the fields param in case there's anything that we aren't using

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://clinicaltrials.gov/data-api/api#:~:text=Studies-,Studies,-Returns%20data%20of

ClinicalTrials.gov api allows you to submit a bunch of different parameter types through the Studies API. For this implementation, I just had the Studies API as the base URL then wanted to leave room for constructing more specific queries if needed just by adding strings together basically. So intr_url corresponds to the query.intervention parameter, but I could also see a world where someone is also interested in supplying the query.condition parameter, or maybe just additional terms as a parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, just have the intr_url working.

All this being said, if there is a better way to do this I am all open for it

src/dgipy/dgidb.py Show resolved Hide resolved
src/dgipy/dgidb.py Outdated Show resolved Hide resolved
src/dgipy/dgidb.py Outdated Show resolved Hide resolved
src/dgipy/dgidb.py Outdated Show resolved Hide resolved
) -> pd.DataFrame: # TODO: Better error handling for new_row?, use_pandas=False
"""Perform a look up for clinical trials data for drug or drugs of interest

:param terms: drug or drugs of interest
Copy link
Member

Choose a reason for hiding this comment

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

are there any guarantees about what form a given term takes? are we hoping that the label provided by the normalizer is the term used by the trial? I just tried imatinib vs gleevec and I think they are both returning the same results

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In its current state, yes just essentially hoping that the label the normalizer gives is the correct search term to use. I imagine whether or not it works on clinical trials end (i.e. imatinib vs gleevec) will be determined by how well the clinical trial entries themselves have been tagged/organized for the appropriate interventions? The imatinib and gleevec example I can see someone remembering to associate both of those names with any clinical trial just because its so well studied, but maybe this isn't always the case and maybe some aliases will differ in results.

src/dgipy/dgidb.py Show resolved Hide resolved

for drug in terms:
intr_url = f"&query.intr={drug}"
full_uri = base_url + intr_url # TODO: + cond_url + term_url
Copy link
Member

Choose a reason for hiding this comment

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

Also, I wonder if we can reduce the size of the response with the fields param in case there's anything that we aren't using

src/dgipy/dgidb.py Outdated Show resolved Hide resolved
src/dgipy/dgidb.py Outdated Show resolved Hide resolved
src/dgipy/dgidb.py Show resolved Hide resolved
@mcannon068nw mcannon068nw changed the title Clinical trials lookup function feat: Clinical trials lookup function Aug 28, 2024
@mcannon068nw mcannon068nw merged commit 8ebbc56 into main Aug 28, 2024
12 checks passed
@mcannon068nw mcannon068nw deleted the clinical-trials branch August 28, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:medium Medium priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants