clintrialx

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).

https://github.com/ineelhere/clintrialx

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.2%) to scientific vocabulary

Keywords

aact bioinformatics clinical-data clinical-trials clinicaltrialsgov ctti data data-management medical-informatics r-language r-package trials
Last synced: 6 months ago · JSON representation

Repository

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).

Basic Info
Statistics
  • Stars: 17
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 4
Topics
aact bioinformatics clinical-data clinical-trials clinicaltrialsgov ctti data data-management medical-informatics r-language r-package trials
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License Code of conduct

README.Rmd

---
output: github_document
editor_options: 
  markdown: 
    wrap: 72
---



```{r include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# `ClinTrialX`


[![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)
[![License:
Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://opensource.org/license/apache-2-0)
[![pkgdown](https://img.shields.io/badge/pkgdown-docs-blue.svg)](https://www.indraneelchakraborty.com/clintrialx/)
[![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fineelhere%2Fclintrialx&label=Visitors&labelColor=%23f47373&countColor=%2337d67a&style=flat&labelStyle=upper)](https://github.com/ineelhere/clintrialx)
[![CRAN
status](https://www.r-pkg.org/badges/version/clintrialx)](https://CRAN.R-project.org/package=clintrialx)
[![CRAN
downloads](https://cranlogs.r-pkg.org/badges/clintrialx)](https://CRAN.R-project.org/package=clintrialx)

[![Data Sources:
ClinicalTrials.gov](https://img.shields.io/badge/Data_Sources-ClinicalTrials.gov-blue)](https://clinicaltrials.gov/data-api/api)
[![Data Sources: CTTI
AACT](https://img.shields.io/badge/Data_Sources-CTTI%20AACT%20-purple)](https://aact.ctti-clinicaltrials.org/)



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

-   [ClinicalTrials.gov](https://clinicaltrials.gov/) registry using its
    [V2 API](https://clinicaltrials.gov/data-api/api) and

-   [CTTI AACT](https://aact.ctti-clinicaltrials.org/) (Public Access to
    Aggregate Content of ClinicalTrials.gov).

## Installation

Install the package from [CRAN](https://CRAN.R-project.org/package=clintrialx) with:
```r
install.packages("clintrialx")
```
You can install this package from
[GitHub](https://github.com/ineelhere/clintrialx) with:

*you'll need the `devtools` package for this*

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

### Check installation

``` r
library(clintrialx)
```

## Setup AACT account

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

-   Visit 

-   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-

    ``` r
    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](https://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).

```{r example1, eval = FALSE}
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.

```{r example2, eval = FALSE}
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.*

```{r example5, eval = FALSE}
df <- ctg_bulk_fetch(location="india")
```

## Query the [CTTI AACT](https://aact.ctti-clinicaltrials.org/)

#### 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 -


```{r example6, eval = FALSE}
#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:

```{r example3, eval = FALSE}
version_info(source = "clinicaltrials.gov")


```

## Get Involved

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

-   Fork the [GitHub](https://github.com/ineelhere/clintrialx) 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](https://github.com/ineelhere/clintrialx) repo.
-   Sit back and [relax](https://www.youtube.com/watch?v=Uffjii1hXzU) while I review it!

💬 **Questions or Feedback?** Feel free to open an issue on [GitHub
Issues page](https://github.com/ineelhere/clintrialx/issues).

🌟 **Enjoying `clintrialx`?** Please consider giving it a star on
[GitHub](https://github.com/ineelhere/clintrialx)! Your support helps
this project grow and improve.

More updates to come. Happy coding! 🎉

Owner

  • Name: Indraneel Chakraborty
  • Login: ineelhere
  • Kind: user
  • Location: India
  • Company: @Appsilon

Solving problems using code-first and data centric approaches on cloud with devOps principles!

GitHub Events

Total
  • Watch event: 2
  • Delete event: 1
  • Push event: 7
  • Pull request event: 2
  • Create event: 1
Last Year
  • Watch event: 2
  • Delete event: 1
  • Push event: 7
  • Pull request event: 2
  • Create event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 19
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 minutes
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • ineelhere (38)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 205 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: clintrialx

Connect and Work with Clinical Trials Data Sources

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 205 Last month
Rankings
Dependent packages count: 28.3%
Dependent repos count: 34.9%
Average: 50.0%
Downloads: 86.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 4.0.0 depends
  • httr * depends
  • lubridate * depends