- Notifications
You must be signed in to change notification settings - Fork0
R package to fetch and explore clinical trials data from freely available registries. Fetch data in bulk, customize data and build comprehensive html reports. Currently, it supports the ClinicalTrials.gov registry and CTTI AACT (Access to Aggregate Content of ClinicalTrials.gov).
License
ineelhere/clintrialx
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The goal of{clintrialx} is to fetch clinical trials data from freelyavailable registries. Currently, it supports querying the
ClinicalTrials.gov registry using itsV2 API and
CTTI AACT (Public Access toAggregate Content of ClinicalTrials.gov).
Install the package fromCRAN with:
install.packages("clintrialx")You can install this package fromGitHub with:
you’ll need thedevtools package for this
# install.packages("devtools")devtools::install_github("ineelhere/clintrialx")
library(clintrialx)Sign up and create an account. It’s free.
The
usernameandpasswordwill be needed to fetch data using thispackage.Save it in a
.Renvironfile, for example-user="random_name"password="random_password"
Now that the file is created, load the variable with the command
readRenviron("path/to/.Renviron)You’re all set!
Query theClinicalTrials.gov Registry
Fetch one or multiple trial records based on NCT IDs. You can opt tofetch some specific fields or all fields available at source (default).
library(clintrialx)ctg_get_nct(c("NCT02967965","NCT04000165","NCT01007279","NCT02376244","NCT01179776"),fields= c("NCT Number","Study Title","Study Status","Sponsor"))
Supports filtering by condition, location, title keywords, intervention,and overall status.
ctg_get_fields(condition="Cancer",location="Kolkata",title=NULL,intervention="Drug",status= c("ACTIVE_NOT_RECRUITING","RECRUITING"),page_size=10)
Download all available data for your query. No limits!
Supports filtering by condition, location, title keywords,intervention, and overall status.
df<- ctg_bulk_fetch(location="india")
Query theCTTI AACT
# Set environment variables for database credentials in .Renviron and load it# readRenviron(".Renviron")# Connect to the databasecon <- aact_connection(Sys.getenv('user'), Sys.getenv('password'))# Run a custom queryquery <- "SELECT nct_id, source, enrollment, overall_status FROM studies LIMIT 5;"results <- aact_custom_query(con, query)# Print the resultsprint(results)Currently works for data from ClinicalTrials.Gov
Visit here for an exqample report -https://www.indraneelchakraborty.com/clintrialx/report.html
#first get the data in a R dataframemy_clinical_trial_data<- ctg_bulk_fetch(condition="cancer")#now pass it to the reports functionctg_data_report(ctg_data=my_clinical_trial_data,title="Clinical Trials Analysis",author="Indra",output_file="reports/clinical_trials.html",theme="flatly",color_palette= c("#4E79A7","#F28E2B","#E15759","#76B7B2","#59A14F","#EDC948"),include_data_quality=TRUE,include_interactive_plots=TRUE,custom_footer="Proprietary report generated by SomeGreatOrg Inc.")# Generate a report with static plots and no data quality assessmentctg_data_report(ctg_data=my_clinical_trial_data,title="Quick Clinical Trial Overview",include_data_quality=FALSE,include_interactive_plots=FALSE)
Check the pathreports/clinical_trials.html on your local. It willhave the html report file.
Cool stuff - It also has the codes to the plots!
You can fetch version information directly from the package:
version_info(source="clinicaltrials.gov")
🚀 Ready to contribute? Let’s make clintrialx even better!
- Fork theGitHub repo.
- Check out your development branch from the dev branch.
- Do your work on a feature (ftr) branch.
- Raise a PR against the dev branch of theclintrialx repo.
- Sit back andrelaxwhile I review it!
💬Questions or Feedback? Feel free to open an issue onGitHubIssues page.
🌟Enjoyingclintrialx? Please consider giving it a star onGitHub! Your support helpsthis project grow and improve.
More updates to come. Happy coding! 🎉
About
R package to fetch and explore clinical trials data from freely available registries. Fetch data in bulk, customize data and build comprehensive html reports. Currently, it supports the ClinicalTrials.gov registry and CTTI AACT (Access to Aggregate Content of ClinicalTrials.gov).
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.