Skip to content

Commit

Permalink
[UPDATE] pkg details and landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
ineelhere committed Jul 20, 2024
1 parent bffc564 commit 795b4b2
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 21 deletions.
83 changes: 83 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

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

# clintrialx

<!-- badges: start -->
[![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/licenses/Apache-2.0)
[![pkgdown](https://img.shields.io/badge/pkgdown-docs-blue.svg)](https://ineelhere.github.io/clintrialx/)
<!-- badges: end -->

The goal of `{clintrialx}` is to fetch clinical trials data from freely available registries. Currently, it supports the ClinicalTrials.gov registry using its [V2 API](https://clinicaltrials.gov/data-api/api).

## Installation

You can install this package from [GitHub](https://github.com/) with:

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

## Example

This is a basic example that shows how to download data based on NCT ID(s):

```{r example1}
library(clintrialx)
fetch_specific_trial_data("NCT04000165")
```

Fetch only a few/specific fields:

```{r example2}
library(clintrialx)
fetch_specific_trial_data("NCT04000165", fields = c("NCT Number", "Study Title", "Study Status", "Sponsor"))
```

You can also download data for multiple NCT IDs:

```{r example3}
library(clintrialx)
fetch_specific_trial_data(c("NCT02967965", "NCT04000165", "NCT01007279", "NCT02376244", "NCT01179776"))
```

Similarly, you can query only desired fields:

```{r example4}
library(clintrialx)
fetch_specific_trial_data(c("NCT02967965", "NCT04000165", "NCT01007279", "NCT02376244", "NCT01179776"),
fields = c("NCT Number", "Study Title", "Study Status", "Sponsor"))
```

## Data Sources

You can fetch version information directly from the package:

```{r example}
library(clintrialx)
version_info(source = "clinicaltrials.gov")
```

## Get Involved

🚀 **Ready to contribute?** We welcome contributions to make `clintrialx` even better. Check out [contributing guidelines](https://github.com/ineelhere/clintrialx/blob/main/CONTRIBUTING.md) to get started.

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

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

More updates to come. Happy coding! 🎉
122 changes: 101 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
# clintrialx

<!-- badges: start -->

[![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/licenses/Apache-2.0)
[![pkgdown](https://img.shields.io/badge/pkgdown-docs-blue.svg)](https://ineelhere.github.io/clintrialx/)
<!-- badges: end -->

The goal of clintrialx is to …
The goal of `{clintrialx}` is to fetch clinical trials data from freely
available registries. Currently, it supports the ClinicalTrials.gov
registry using its [V2 API](https://clinicaltrials.gov/data-api/api).

## Installation

You can install the development version of clintrialx from
[GitHub](https://github.com/) with:
You can install this package from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
Expand All @@ -20,7 +26,8 @@ devtools::install_github("ineelhere/clintrialx")

## Example

This is a basic example which shows you how to solve a common problem:
This is a basic example that shows how to download data based on NCT
ID(s):

``` r
library(clintrialx)
Expand All @@ -42,29 +49,102 @@ library(clintrialx)
#>
#> intersect, setdiff, setequal, union
#> Loading required package: progress
## basic example code
fetch_specific_trial_data("NCT04000165")
#> # A tibble: 1 × 30
#> `NCT Number` `Study Title` `Study URL` Acronym `Study Status` `Brief Summary`
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 NCT04000165 A Dose-Findin… https://cl… <NA> COMPLETED "Background:\n…
#> # ℹ 24 more variables: `Study Results` <chr>, Conditions <chr>,
#> # Interventions <chr>, `Primary Outcome Measures` <chr>,
#> # `Secondary Outcome Measures` <chr>, `Other Outcome Measures` <chr>,
#> # Sponsor <chr>, Collaborators <chr>, Sex <chr>, Age <chr>, Phases <chr>,
#> # Enrollment <chr>, `Funder Type` <chr>, `Study Type` <chr>,
#> # `Study Design` <chr>, `Other IDs` <chr>, `Start Date` <chr>,
#> # `Primary Completion Date` <chr>, `Completion Date` <chr>, …
```

Fetch only a few/specific fields:

``` r
library(clintrialx)
fetch_specific_trial_data("NCT04000165", fields = c("NCT Number", "Study Title", "Study Status", "Sponsor"))
#> # A tibble: 1 × 4
#> `NCT Number` `Study Title` `Study Status` Sponsor
#> <chr> <chr> <chr> <chr>
#> 1 NCT04000165 A Dose-Finding Study of AG-348 in Sickle … COMPLETED Nation…
```

What is special about using `README.Rmd` instead of just `README.md`?
You can include R chunks like so:
You can also download data for multiple NCT IDs:

``` r
summary(cars)
#> speed dist
#> Min. : 4.0 Min. : 2.00
#> 1st Qu.:12.0 1st Qu.: 26.00
#> Median :15.0 Median : 36.00
#> Mean :15.4 Mean : 42.98
#> 3rd Qu.:19.0 3rd Qu.: 56.00
#> Max. :25.0 Max. :120.00
library(clintrialx)
fetch_specific_trial_data(c("NCT02967965", "NCT04000165", "NCT01007279", "NCT02376244", "NCT01179776"))
#> [=================>--------------------------] 2/5 ( 40%) Fetching
#> NCT04000165[=========================>------------------] 3/5 ( 60%) Fetching
#> NCT01007279[==================================>---------] 4/5 ( 80%) Fetching
#> NCT02376244[============================================] 5/5 (100%) Fetching
#> NCT01179776
#> # A tibble: 5 × 30
#> `NCT Number` `Study Title` `Study URL` Acronym `Study Status` `Brief Summary`
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 NCT02967965 CARdioprotect… https://cl… CARIM ACTIVE_NOT_RE… "CARIM is a pr…
#> 2 NCT04000165 A Dose-Findin… https://cl… <NA> COMPLETED "Background:\n…
#> 3 NCT01007279 Rosuvastatin … https://cl… ROMA COMPLETED "An increase i…
#> 4 NCT02376244 The Health Im… https://cl… <NA> COMPLETED "Cardiac rehab…
#> 5 NCT01179776 Ilomedin Trea… https://cl… <NA> COMPLETED "Acute myocard…
#> # ℹ 24 more variables: `Study Results` <chr>, Conditions <chr>,
#> # Interventions <chr>, `Primary Outcome Measures` <chr>,
#> # `Secondary Outcome Measures` <chr>, `Other Outcome Measures` <chr>,
#> # Sponsor <chr>, Collaborators <chr>, Sex <chr>, Age <chr>, Phases <chr>,
#> # Enrollment <chr>, `Funder Type` <chr>, `Study Type` <chr>,
#> # `Study Design` <chr>, `Other IDs` <chr>, `Start Date` <chr>,
#> # `Primary Completion Date` <chr>, `Completion Date` <chr>, …
```

You’ll still need to render `README.Rmd` regularly, to keep `README.md`
up-to-date. `devtools::build_readme()` is handy for this.
Similarly, you can query only desired fields:

``` r
library(clintrialx)
fetch_specific_trial_data(c("NCT02967965", "NCT04000165", "NCT01007279", "NCT02376244", "NCT01179776"),
fields = c("NCT Number", "Study Title", "Study Status", "Sponsor"))
#> [=================>--------------------------] 2/5 ( 40%) Fetching
#> NCT04000165[=========================>------------------] 3/5 ( 60%) Fetching
#> NCT01007279[==================================>---------] 4/5 ( 80%) Fetching
#> NCT02376244[============================================] 5/5 (100%) Fetching
#> NCT01179776
#> # A tibble: 5 × 4
#> `NCT Number` `Study Title` `Study Status` Sponsor
#> <chr> <chr> <chr> <chr>
#> 1 NCT02967965 CARdioprotection in Myocardial Infarction ACTIVE_NOT_RE… EZUS-L…
#> 2 NCT04000165 A Dose-Finding Study of AG-348 in Sickle … COMPLETED Nation…
#> 3 NCT01007279 Rosuvastatin in Preventing Myonecrosis in… COMPLETED Univer…
#> 4 NCT02376244 The Health Impact of High Intensity Exerc… COMPLETED Liverp…
#> 5 NCT01179776 Ilomedin Treatment for Patients Having Un… COMPLETED Thromb…
```

## Data Sources

You can fetch version information directly from the package:

``` r
library(clintrialx)
version_info(source = "clinicaltrials.gov")
#> Clinicaltrials.gov API version: 2.0.3
#> Timestamp: 2024-07-19 11:12:14
```

## Get Involved

🚀 **Ready to contribute?** We welcome contributions to make
`clintrialx` even better. Check out [contributing
guidelines](https://github.com/ineelhere/clintrialx/blob/main/CONTRIBUTING.md)
to get started.

You can also embed plots, for example:
💬 **Questions or Feedback?** Feel free to open an issue on [GitHub
Issues page](https://github.com/ineelhere/clintrialx/issues).

<img src="man/figures/README-pressure-1.png" width="100%" />
🌟 **Enjoying `clintrialx`?** Please consider giving a star on
[GitHub](https://github.com/ineelhere/clintrialx)! Your support helps
this project grow and improve.

In that case, don’t forget to commit and push the resulting figure
files, so they display on GitHub and CRAN.
More updates to come. Happy coding! 🎉

0 comments on commit 795b4b2

Please sign in to comment.