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 (16.0%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
Statistics
  • Stars: 1
  • Watchers: 4
  • Forks: 0
  • Open Issues: 26
  • Releases: 0
Created over 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
---
 

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


 
The goal of CohortSymmetry is to carry out the necessary calculations for Sequence Symmetry Analysis (SSA). It is highly recommended that this method is tested beforehand against well-known positive and negative controls. Such controls could be found using Pratt et al (2015). 
 
## Installation
 
You can install the development version of CohortSymmetry from [GitHub](https://github.com/) with:
 
``` r
# install.packages("devtools")
devtools::install_github("OHDSI/CohortSymmetry")
```
 
## Example
### Create a reference to data in the OMOP CDM format 
The CohortSymmetry package is designed to work with data in the OMOP CDM (Common Data Model) format, so our first step is to create a reference to the data using the `CDMConnector` package.
 
As an example, we will be using Eunomia data set.
```{r, message=FALSE, eval=TRUE, warning=FALSE}
library(CDMConnector)
library(dplyr)
library(DBI)
library(duckdb)
 
db <- DBI::dbConnect(duckdb::duckdb(), 
                     dbdir = CDMConnector::eunomiaDir())
cdm <- cdmFromCon(
  con = db,
  cdmSchema = "main",
  writeSchema = "main"
)
```
 
### Step 0: Instantiate two cohorts in the cdm reference
This will be entirely user's choice on how to generate such cohorts. Minimally, this package requires two cohort tables in the cdm reference, namely the index_cohort and the marker_cohort.
 
If one wants to generate two drugs cohorts in cdm, DrugUtilisation is recommended. For merely illustration purposes, we will carry out PSSA on aspirin (index_cohort) against amoxicillin (marker_cohort)
 
```{r Example - Step 0: Using DrugUtilisation, eval=TRUE, warning=FALSE}
library(dplyr)
library(DrugUtilisation)
cdm <- DrugUtilisation::generateIngredientCohortSet(
  cdm = cdm, 
  name = "aspirin",
  ingredient = "aspirin")

cdm <- DrugUtilisation::generateIngredientCohortSet(
  cdm = cdm,
  name = "amoxicillin",
  ingredient = "amoxicillin")
```
 
### Step 1: generateSequenceCohortSet
 
In order to initiate the calculations, the two cohorts tables need to be intersected using `generateSequenceCohortSet()`. This process will output all the individuals who appeared on both tables according to a user-specified parameters. This includes `timeGap`, `washoutWindow`, `indexMarkerGap` and `daysPriorObservation`. Details on these parameters could be found on the vignette.
 
```{r Step 1: generateSequenceCohortSet, eval=TRUE, warning=FALSE}
library(CohortSymmetry)
 
cdm <- generateSequenceCohortSet(
  cdm = cdm,
  indexTable = "aspirin",
  markerTable = "amoxicillin",
  name = "aspirin_amoxicillin"
)

cdm$aspirin_amoxicillin %>% 
  dplyr::glimpse()
```

### Step 2: summariseSequenceRatios
 
To get the sequence ratios, we would need the output of the generateSequenceCohortSet() function to be fed into `summariseSequenceRatios()` 
The output of this process contains cSR(crude sequence ratio), aSR(adjusted sequence ratio) and confidence intervals.

```{r Step 2: summariseSequenceRatios, eval=TRUE, warning=FALSE}
res <- summariseSequenceRatios(cohort = cdm$aspirin_amoxicillin)
 
res %>% glimpse()
```

### Step 3: visualise the results
 
The user could then visualise their results using a wide array of provided tools.

For example, the following produces a gt table.

```{r Step 3: visualise the results - tables, eval=FALSE, warning=FALSE}
gt_results <- tableSequenceRatios(result = res)

gt_results
```

![](./man/figures/README-gt_table.png)
Note that flextable is also an option, users may specify this by using the `type` argument.

One could also visualise the plot, for example, the following is the plot of the adjusted sequence ratio.

```{r Step 3: visualise the results - plots, eval=FALSE, warning=FALSE}
plotSequenceRatios(result = res,
                  onlyaSR = T,
                  colours = "black")
```
![](./man/figures/plotSR.png)

The user also has the freedom to plot temporal trend like so:

```{r Step 3: visualise the results - plot temporal, eval=FALSE, warning=FALSE}
plotTemporalSymmetry(cdm = cdm, sequenceTable = "aspirin_amoxicillin")
```
![](./man/figures/plot_temporal.png)

### Disconnect from the cdm database connection
```{r Disconnect from the cdm database connection, eval=TRUE, warning=FALSE}
CDMConnector::cdmDisconnect(cdm = cdm)
```

Owner

  • Name: Observational Health Data Sciences and Informatics
  • Login: OHDSI
  • Kind: organization

GitHub Events

Total
  • Issues event: 35
  • Watch event: 1
  • Delete event: 44
  • Issue comment event: 13
  • Push event: 88
  • Pull request event: 43
  • Create event: 20
Last Year
  • Issues event: 35
  • Watch event: 1
  • Delete event: 44
  • Issue comment event: 13
  • Push event: 88
  • Pull request event: 43
  • Create event: 20

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 45
  • Total pull requests: 62
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 22 hours
  • Total issue authors: 8
  • Total pull request authors: 3
  • Average comments per issue: 0.49
  • Average comments per pull request: 0.03
  • Merged pull requests: 51
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 17
  • Pull requests: 30
  • Average time to close issues: 15 days
  • Average time to close pull requests: 1 day
  • Issue authors: 6
  • Pull request authors: 1
  • Average comments per issue: 0.12
  • Average comments per pull request: 0.0
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • edward-burn (13)
  • daniellenewby (10)
  • xihang-chen (9)
  • Braventos (8)
  • catalamarti (2)
  • nmercadeb (1)
  • ablack3 (1)
  • abduazizR (1)
Pull Request Authors
  • xihang-chen (59)
  • edward-burn (2)
  • Braventos (1)
Top Labels
Issue Labels
enhancement (2) bug (2) help wanted (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 278 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 10
  • Total maintainers: 1
cran.r-project.org: CohortSymmetry

Sequence Symmetry Analysis Using the Observational Medical Outcomes Partnership Common Data Model

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 278 Last month
Rankings
Dependent packages count: 28.8%
Dependent repos count: 35.4%
Average: 49.9%
Downloads: 85.6%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 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
  • CDMConnector * imports
  • CodelistGenerator * imports
  • DrugUtilisation * imports
  • IncidencePrevalence * imports
  • dplyr * imports
  • ggplot2 * imports
  • lubridate * imports
  • magrittr * imports
  • plyr * imports
  • rlang * imports
  • tibble * imports
  • tidyr * imports
.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