{"id":25316075,"url":"https://github.com/ineelhere/clintrialx","last_synced_at":"2025-10-28T20:31:22.799Z","repository":{"id":249337412,"uuid":"830543679","full_name":"ineelhere/clintrialx","owner":"ineelhere","description":"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).","archived":false,"fork":false,"pushed_at":"2024-08-28T16:04:20.000Z","size":9603,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-28T17:47:52.627Z","etag":null,"topics":["aact","bioinformatics","clinical-data","clinical-trials","clinicaltrialsgov","ctti","data","data-management","medical-informatics","r-language","r-package","trials"],"latest_commit_sha":null,"homepage":"https://ineelhere.github.io/clintrialx/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ineelhere.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-18T13:29:15.000Z","updated_at":"2024-08-23T17:00:13.000Z","dependencies_parsed_at":"2024-08-28T17:36:24.279Z","dependency_job_id":null,"html_url":"https://github.com/ineelhere/clintrialx","commit_stats":null,"previous_names":["ineelhere/clintrialx"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ineelhere%2Fclintrialx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ineelhere%2Fclintrialx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ineelhere%2Fclintrialx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ineelhere%2Fclintrialx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ineelhere","download_url":"https://codeload.github.com/ineelhere/clintrialx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238715948,"owners_count":19518549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aact","bioinformatics","clinical-data","clinical-trials","clinicaltrialsgov","ctti","data","data-management","medical-informatics","r-language","r-package","trials"],"created_at":"2025-02-13T18:54:07.825Z","updated_at":"2025-10-28T20:31:17.425Z","avatar_url":"https://github.com/ineelhere.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options: \n  markdown: \n    wrap: 72\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# `ClinTrialX`\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/ineelhere/clintrialx/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ineelhere/clintrialx/actions/workflows/R-CMD-check.yaml)\n[![License:\nApache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://opensource.org/license/apache-2-0)\n[![pkgdown](https://img.shields.io/badge/pkgdown-docs-blue.svg)](https://www.indraneelchakraborty.com/clintrialx/)\n[![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fineelhere%2Fclintrialx\u0026label=Visitors\u0026labelColor=%23f47373\u0026countColor=%2337d67a\u0026style=flat\u0026labelStyle=upper)](https://github.com/ineelhere/clintrialx)\n[![CRAN\nstatus](https://www.r-pkg.org/badges/version/clintrialx)](https://CRAN.R-project.org/package=clintrialx)\n[![CRAN\ndownloads](https://cranlogs.r-pkg.org/badges/clintrialx)](https://CRAN.R-project.org/package=clintrialx)\n\n[![Data Sources:\nClinicalTrials.gov](https://img.shields.io/badge/Data_Sources-ClinicalTrials.gov-blue)](https://clinicaltrials.gov/data-api/api)\n[![Data Sources: CTTI\nAACT](https://img.shields.io/badge/Data_Sources-CTTI%20AACT%20-purple)](https://aact.ctti-clinicaltrials.org/)\n\n\u003c!-- badges: end --\u003e\n\nThe goal of `{clintrialx}` is to fetch clinical trials data from freely\navailable registries. Currently, it supports querying the\n\n-   [ClinicalTrials.gov](https://clinicaltrials.gov/) registry using its\n    [V2 API](https://clinicaltrials.gov/data-api/api) and\n\n-   [CTTI AACT](https://aact.ctti-clinicaltrials.org/) (Public Access to\n    Aggregate Content of ClinicalTrials.gov).\n\n## Installation\n\nInstall the package from [CRAN](https://CRAN.R-project.org/package=clintrialx) with:\n```r\ninstall.packages(\"clintrialx\")\n```\nYou can install this package from\n[GitHub](https://github.com/ineelhere/clintrialx) with:\n\n*you'll need the `devtools` package for this*\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"ineelhere/clintrialx\")\n```\n\n### Check installation\n\n``` r\nlibrary(clintrialx)\n```\n\n## Setup AACT account\n\n#### `Only if you wish to use AACT as a source for the data`\n\n-   Visit \u003chttps://aact.ctti-clinicaltrials.org/users/sign_up\u003e\n\n-   Sign up and create an account. It's free.\n\n-   The `username` and `password` will be needed to fetch data using\n    this package.\n\n-   Save it in a `.Renviron` file, for example-\n\n    ``` r\n    user =  \"random_name\"\n    password = \"random_password\"\n    ```\n\n-   Now that the file is created, load the variable with the command\n    `readRenviron(\"path/to/.Renviron)`\n\n-   You're all set!\n\n## Query the [ClinicalTrials.gov](https://clinicaltrials.gov/) Registry\n\n#### Based on NCT IDs\n\nFetch one or multiple trial records based on NCT IDs. You can opt to\nfetch some specific fields or all fields available at source (default).\n\n```{r example1, eval = FALSE}\nlibrary(clintrialx)\nctg_get_nct(c(\"NCT02967965\", \"NCT04000165\", \"NCT01007279\", \"NCT02376244\", \"NCT01179776\"),\n                          fields = c(\"NCT Number\", \"Study Title\", \"Study Status\", \"Sponsor\"))\n\n\n```\n\n#### Based on fileds\n\nSupports filtering by condition, location, title keywords, intervention,\nand overall status.\n\n```{r example2, eval = FALSE}\nctg_get_fields(\n     condition = \"Cancer\",\n     location = \"Kolkata\",\n     title = NULL,\n     intervention = \"Drug\",\n     status = c(\"ACTIVE_NOT_RECRUITING\", \"RECRUITING\"),\n     page_size = 10\n)\n\n```\n\n#### Based on fields - Bulk download\n\nDownload all available data for your query. No limits!\n\n*Supports filtering by condition, location, title keywords,\nintervention, and overall status.*\n\n```{r example5, eval = FALSE}\ndf \u003c- ctg_bulk_fetch(location=\"india\")\n```\n\n## Query the [CTTI AACT](https://aact.ctti-clinicaltrials.org/)\n\n#### Run Custom Queries\n\n```{r example4, eval = FALSE}\n# Set environment variables for database credentials in .Renviron and load it\n# readRenviron(\".Renviron\")\n\n# Connect to the database\ncon \u003c- aact_connection(Sys.getenv('user'), Sys.getenv('password'))\n\n# Run a custom query\nquery \u003c- \"SELECT nct_id, source, enrollment, overall_status FROM studies LIMIT 5;\"\nresults \u003c- aact_custom_query(con, query)\n\n# Print the results\nprint(results)\n```\n\n## Trial Data HTML Reports\n\n*Currently works for data from ClinicalTrials.Gov*\n\nVisit here for an exqample report -\n\u003chttps://www.indraneelchakraborty.com/clintrialx/report.html\u003e\n\n```{r example6, eval = FALSE}\n#first get the data in a R dataframe\nmy_clinical_trial_data \u003c- ctg_bulk_fetch(condition=\"cancer\")\n#now pass it to the reports function\nctg_data_report(\n  ctg_data = my_clinical_trial_data,\n  title = \"Clinical Trials Analysis\",\n  author = \"Indra\",\n  output_file = \"reports/clinical_trials.html\",\n  theme = \"flatly\",\n  color_palette = c(\"#4E79A7\", \"#F28E2B\", \"#E15759\", \"#76B7B2\", \"#59A14F\", \"#EDC948\"),\n  include_data_quality = TRUE,\n  include_interactive_plots = TRUE,\n  custom_footer = \"Proprietary report generated by SomeGreatOrg Inc.\"\n)\n\n# Generate a report with static plots and no data quality assessment\nctg_data_report(\n  ctg_data = my_clinical_trial_data,\n  title = \"Quick Clinical Trial Overview\",\n  include_data_quality = FALSE,\n  include_interactive_plots = FALSE\n)\n\n```\n\nCheck the path `reports/clinical_trials.html` on your local. It will\nhave the html report file.\n\nCool stuff - It also has the codes to the plots!\n\n## Data Sources\n\nYou can fetch version information directly from the package:\n\n```{r example3, eval = FALSE}\nversion_info(source = \"clinicaltrials.gov\")\n\n\n```\n\n## Get Involved\n\n🚀 Ready to contribute? Let's make clintrialx even better!\n\n-   Fork the [GitHub](https://github.com/ineelhere/clintrialx) repo.\n-   Check out your development branch from the dev branch.\n-   Do your work on a feature (ftr) branch.\n-   Raise a PR against the dev branch of the [clintrialx](https://github.com/ineelhere/clintrialx) repo.\n-   Sit back and [relax](https://www.youtube.com/watch?v=Uffjii1hXzU) while I review it!\n\n💬 **Questions or Feedback?** Feel free to open an issue on [GitHub\nIssues page](https://github.com/ineelhere/clintrialx/issues).\n\n🌟 **Enjoying `clintrialx`?** Please consider giving it a star on\n[GitHub](https://github.com/ineelhere/clintrialx)! Your support helps\nthis project grow and improve.\n\nMore updates to come. Happy coding! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fineelhere%2Fclintrialx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fineelhere%2Fclintrialx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fineelhere%2Fclintrialx/lists"}