MyNixOS website logo
Description

Connect and Work with Clinical Trials Data Sources.

Are you spending too much time fetching and managing clinical trial data? Struggling with complex queries and bulk data extraction? What if you could simplify this process with just a few lines of code? Introducing 'clintrialx' - Fetch clinical trial data from sources like 'ClinicalTrials.gov' <https://clinicaltrials.gov/> and the 'Clinical Trials Transformation Initiative - Access to Aggregate Content of ClinicalTrials.gov' database <https://aact.ctti-clinicaltrials.org/>, supporting pagination and bulk downloads. Also, you can generate HTML reports based on the data obtained from the sources!

ClinTrialX

R-CMD-check License:Apache-2.0 pkgdown Visitors

Data Sources:ClinicalTrials.gov Data Sources: CTTIAACT

The goal of {clintrialx} is to fetch clinical trials data from freely available registries. Currently, it supports querying the

Installation

You can install this package from GitHub with:

# install.packages("devtools")
devtools::install_github("ineelhere/clintrialx")

Check installation

library(clintrialx)

Setup AACT account

Only if you wish to use AACT as a source for the data

  • Visit https://aact.ctti-clinicaltrials.org/users/sign_up

  • Sign up and create an account. It’s free.

  • The username and password will be needed to fetch data using this package.

  • Save it in a .Renviron file, 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 the ClinicalTrials.gov Registry

Based on NCT IDs

Fetch one or multiple trial records based on NCT IDs. You can opt to fetch 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"))

Based on fileds

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
)

Based on fields - Bulk download

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 the CTTI AACT

Run Custom Queries

# Set environment variables for database credentials in .Renviron and load it
# readRenviron(".Renviron")

# Connect to the database
con <- aact_connection(Sys.getenv('user'), Sys.getenv('password'))

# Run a custom query
query <- "SELECT nct_id, source, enrollment, overall_status FROM studies LIMIT 5;"
results <- aact_custom_query(con, query)

# Print the results
print(results)

Trial Data HTML Reports

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 dataframe
my_clinical_trial_data <- ctg_bulk_fetch(condition="cancer")
#now pass it to the reports function
ctg_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 assessment
ctg_data_report(
  ctg_data = my_clinical_trial_data,
  title = "Quick Clinical Trial Overview",
  include_data_quality = FALSE,
  include_interactive_plots = FALSE
)

Check the path reports/clinical_trials.html on your local. It will have the html report file.

Cool stuff - It also has the codes to the plots!

Data Sources

You can fetch version information directly from the package:

version_info(source = "clinicaltrials.gov")

Get Involved

🚀 Ready to contribute? Let’s make clintrialx even better!

  • Fork the GitHub 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 the clintrialx repo.
  • Sit back and relax while I review it!

💬 Questions or Feedback? Feel free to open an issue on GitHub Issues page.

🌟 Enjoying clintrialx? Please consider giving it a star on GitHub! Your support helps this project grow and improve.

More updates to come. Happy coding! 🎉

Metadata

Version

0.1.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows