Skip to content

Commit

Permalink
Merge pull request #185 from jr-leary7/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jr-leary7 authored Feb 19, 2024
2 parents 09e6daf + 44ab8f3 commit 9456413
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 32 deletions.
4 changes: 4 additions & 0 deletions R/geneProgramSignificance.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#' @param pt A vector of pseudotime values for each cell. May contain NAs, which are handled internally. Defaults to NULL.
#' @param program.labels (Optional) A character vector specifying a label for each gene cluster. Defaults to NULL.
#' @param p.adj.method (Optional) The method used to adjust \emph{p}-values for multiple hypothesis testing. Defaults to "holm".
#' @details
#' \itemize{
#' \item This function assumes that the gene program scores have been min-max normalized to (0, 1) i.e., \emph{not} including the values 0 or 1. This is necessary to fit the Beta distribution additive model. This normalization can be easily generated by setting the argument \code{minmax.norm = TRUE} in the \code{\link{geneProgramScoring}} function.
#' }
#' @return A table of statistical output showing the significance of the association between pseudotime and program scores.
#' @seealso \code{\link{geneProgramScoring}}
#' @export
Expand Down
3 changes: 2 additions & 1 deletion R/theme_scLANE.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ theme_scLANE <- function(base.size = 12,
base_line_size = base.lwd,
base_rect_size = base.lwd) +
ggplot2::theme(strip.clip = "off",
strip.background = ggplot2::element_rect(linewidth = base.lwd))
strip.background = ggplot2::element_rect(linewidth = base.lwd),
axis.line = ggplot2::element_line(lineend = "square"))
if (umap) {
scLANE_theme <- scLANE_theme +
ggplot2::theme(axis.ticks = ggplot2::element_blank(),
Expand Down
9 changes: 4 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ knitr::opts_chunk$set(warning = FALSE,
![last commit](https://img.shields.io/github/last-commit/jr-leary7/scLANE/main?color=darkgreen)
[![codecov](https://codecov.io/gh/jr-leary7/scLANE/branch/main/graph/badge.svg?token=U2U5RTF2VW)](https://codecov.io/gh/jr-leary7/scLANE)
[![CodeFactor](https://www.codefactor.io/repository/github/jr-leary7/sclane/badge)](https://www.codefactor.io/repository/github/jr-leary7/sclane)
[![DOI](https://img.shields.io/static/v1?label=DOI&message=10.5281/zenodo.10182497&color=blue)](https://doi.org/10.5281/zenodo.10182497)
[![DOI](https://img.shields.io/static/v1?label=DOI&message=10.1101/2023.12.19.572477&color=blue)](https://doi.org/10.1101/2023.12.19.572477)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
<!-- badges: end -->

Expand Down Expand Up @@ -115,7 +115,7 @@ scLANE_models_glm <- testDynamic(sim_data,
pt = order_df,
genes = gene_sample,
size.factor.offset = cell_offset,
n.cores = 4,
n.cores = 4L,
verbose = FALSE)
```

Expand All @@ -142,7 +142,7 @@ scLANE_models_gee <- testDynamic(sim_data,
is.gee = TRUE,
id.vec = sim_data$subject,
cor.structure = "ar1",
n.cores = 4,
n.cores = 4L,
verbose = FALSE)
```

Expand All @@ -168,9 +168,8 @@ scLANE_models_glmm <- testDynamic(sim_data,
size.factor.offset = cell_offset,
n.potential.basis.fns = 3,
is.glmm = TRUE,
glmm.adaptive = TRUE,
id.vec = sim_data$subject,
n.cores = 4,
n.cores = 4L,
verbose = FALSE)
```

Expand Down
51 changes: 25 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
commit](https://img.shields.io/github/last-commit/jr-leary7/scLANE/main?color=darkgreen)
[![codecov](https://codecov.io/gh/jr-leary7/scLANE/branch/main/graph/badge.svg?token=U2U5RTF2VW)](https://codecov.io/gh/jr-leary7/scLANE)
[![CodeFactor](https://www.codefactor.io/repository/github/jr-leary7/sclane/badge)](https://www.codefactor.io/repository/github/jr-leary7/sclane)
[![DOI](https://img.shields.io/static/v1?label=DOI&message=10.5281/zenodo.10182497&color=blue)](https://doi.org/10.5281/zenodo.10182497)
[![DOI](https://img.shields.io/static/v1?label=DOI&message=10.1101/2023.12.19.572477&color=blue)](https://doi.org/10.1101/2023.12.19.572477)
[![License:
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
<!-- badges: end -->
Expand Down Expand Up @@ -172,12 +172,12 @@ scLANE_models_glm <- testDynamic(sim_data,
pt = order_df,
genes = gene_sample,
size.factor.offset = cell_offset,
n.cores = 4,
n.cores = 4L,
verbose = FALSE)
#> Registered S3 method overwritten by 'bit':
#> method from
#> print.ri gamlss
#> scLANE testing completed for 100 genes across 1 lineage in 45.702 secs
#> scLANE testing completed for 100 genes across 1 lineage in 35.37 secs
```

After the function finishes running, we use `getResultsDE()` to generate
Expand All @@ -195,13 +195,13 @@ select(scLANE_res_glm, Gene, Lineage, Test_Stat, P_Val, P_Val_Adj, Gene_Dynamic_
col.names = c("Gene", "Lineage", "LRT stat.", "P-value", "Adj. p-value", "Predicted dynamic status"))
```

| Gene | Lineage | LRT stat. | P-value | Adj. p-value | Predicted dynamic status |
|:---------|:--------|----------:|--------:|-------------:|-------------------------:|
| MFSD2B | A | 216.750 | 0.000 | 0.000 | 1 |
| RPL29 | A | 5.632 | 0.018 | 0.353 | 0 |
| UAP1L1 | A | 9.880 | 0.007 | 0.157 | 0 |
| TMCO3 | A | 167.709 | 0.000 | 0.000 | 1 |
| GOLGA8EP | A | 4.359 | 0.037 | 0.487 | 0 |
| Gene | Lineage | LRT stat. | P-value | Adj. p-value | Predicted dynamic status |
|:-----------|:--------|----------:|--------:|-------------:|-------------------------:|
| RAB1B | A | 219.950 | 0.000 | 0.000 | 1 |
| LY75.CD302 | A | 4.858 | 0.028 | 0.541 | 0 |
| UAP1L1 | A | 9.894 | 0.007 | 0.163 | 0 |
| TMCO3 | A | 167.311 | 0.000 | 0.000 | 1 |
| GOLGA8EP | A | 4.201 | 0.040 | 0.567 | 0 |

### GEE mode

Expand All @@ -222,9 +222,9 @@ scLANE_models_gee <- testDynamic(sim_data,
is.gee = TRUE,
id.vec = sim_data$subject,
cor.structure = "ar1",
n.cores = 4,
n.cores = 4L,
verbose = FALSE)
#> scLANE testing completed for 100 genes across 1 lineage in 2.201 mins
#> scLANE testing completed for 100 genes across 1 lineage in 1.525 mins
```

We again generate the table of DE test results. The variance of the
Expand All @@ -242,11 +242,11 @@ select(scLANE_res_gee, Gene, Lineage, Test_Stat, P_Val, P_Val_Adj, Gene_Dynamic_

| Gene | Lineage | Wald stat. | P-value | Adj. p-value | Predicted dynamic status |
|:---------|:--------|-----------:|--------:|-------------:|-------------------------:|
| DGUOK | A | 64351.893 | 0 | 0 | 1 |
| TBCC | A | 32.151 | 0 | 0 | 1 |
| DGUOK | A | 200675.460 | 0 | 0 | 1 |
| TBCC | A | 40.399 | 0 | 0 | 1 |
| GOLGA8EP | A | NA | NA | NA | 0 |
| TMC6 | A | 5052.168 | 0 | 0 | 1 |
| JARID2 | A | 1512.240 | 0 | 0 | 1 |
| EMC3 | A | 8397.337 | 0 | 0 | 1 |
| DDX41 | A | 3486.998 | 0 | 0 | 1 |

### GLMM mode

Expand All @@ -267,11 +267,10 @@ scLANE_models_glmm <- testDynamic(sim_data,
size.factor.offset = cell_offset,
n.potential.basis.fns = 3,
is.glmm = TRUE,
glmm.adaptive = TRUE,
id.vec = sim_data$subject,
n.cores = 4,
n.cores = 4L,
verbose = FALSE)
#> scLANE testing completed for 100 genes across 1 lineage in 2.968 mins
#> scLANE testing completed for 100 genes across 1 lineage in 3.133 mins
```

**Note:** The GLMM mode is still under development, as we are working on
Expand All @@ -291,13 +290,13 @@ select(scLANE_res_glmm, Gene, Lineage, Test_Stat, P_Val, P_Val_Adj, Gene_Dynamic
col.names = c("Gene", "Lineage", "LRT stat.", "P-value", "Adj. p-value", "Predicted dynamic status"))
```

| Gene | Lineage | LRT stat. | P-value | Adj. p-value | Predicted dynamic status |
|:--------|:--------|----------:|--------:|-------------:|-------------------------:|
| DDX1 | A | 132.422 | 0.000 | 0 | 1 |
| GGNBP2 | A | 73.683 | 0.000 | 0 | 1 |
| WDSUB1 | A | NA | NA | NA | 0 |
| FAM135B | A | NA | NA | NA | 0 |
| DAB1 | A | 9.217 | 0.684 | 1 | 0 |
| Gene | Lineage | LRT stat. | P-value | Adj. p-value | Predicted dynamic status |
|:-------|:--------|----------:|--------:|-------------:|-------------------------:|
| VDAC1 | A | 205.644 | 0.000 | 0 | 1 |
| CKAP4 | A | 139.246 | 0.000 | 0 | 1 |
| MRTO4 | A | 5.048 | 0.998 | 1 | 0 |
| FOXD3 | A | 2.586 | 1.000 | 1 | 0 |
| UBE2Q1 | A | 94.077 | 0.000 | 0 | 1 |

## Downstream analysis & visualization

Expand Down
Binary file modified man/figures/README-plot-knot-dist-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-plot-models-glm-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-plot-models-glmm-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions man/geneProgramSignificance.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9456413

Please sign in to comment.