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

DeconvoBuddies

Codecov test coverage R-CMD-check-bioc

The goal of DeconvoBuddies is to provide helper functions for the deconvolution process

Installation instructions

Get the latest stable R release from CRAN. Then install DeconvoBuddies using from Bioconductor the following code:

if (!requireNamespace("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
}

BiocManager::install("DeconvoBuddies")

And the development version from GitHub with:

BiocManager::install("LieberInstitute/DeconvoBuddies")

Example

library("DeconvoBuddies")
library("dplyr")
library("ggplot2")
library("SingleCellExperiment")

Get mean ratios for each gene x cell type

ratios <- get_mean_ratio2(sce.test)
fc <- findMarkers_1vAll(sce.test)

(marker_stats <- left_join(ratios, fc, by = c("gene", "cellType.target")))

Extablish Color Scheme

cell_types <- levels(sce.test$cellType)
cell_colors <- create_cell_colors(cell_types = cell_types, pallet = "classic", split = "\\.", preview = TRUE)

Plot Expression of Specified Genes

sce_symbol <- sce.test
rownames(sce_symbol) <- rowData(sce.test)$Symbol
plot_gene_express(sce = sce_symbol, genes = c("RNF220", "CSF3R"))

Plot Expression of Marker Genes

plot_marker_express(sce.test,
    marker_stats,
    "Astro",
    n_genes = 5,
    rank_col = "rank_ratio",
    anno_col = "anno_ratio",
    color_pal = cell_colors
)

Create Composition Bar Plot

pd <- SummarizedExperiment::colData(rse_bulk_test) %>%
    as.data.frame()

est_prop_long <- est_prop %>%
    tibble::rownames_to_column("RNum") %>%
    tidyr::pivot_longer(!RNum, names_to = "cell_type", values_to = "prop") %>%
    dplyr::left_join(pd %>% dplyr::select(RNum, Dx)) %>%
    dplyr::mutate(a = "a")

plot_composition_bar(est_prop_long)
plot_composition_bar(est_prop_long, x_col = "Dx")
plot_composition_bar(est_prop_long, x_col = "Dx", min_prop_text = 0.1)

Citation

Below is the citation output from using citation('DeconvoBuddies') in R. Please run this yourself to check for any updates on how to cite DeconvoBuddies.

print(citation("DeconvoBuddies"), bibtex = TRUE)

Please note that the DeconvoBuddies was only made possible thanks to many other R and bioinformatics software authors, which are cited either in the vignettes and/or the paper(s) describing this package.

Code of Conduct

Please note that the DeconvoBuddies project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Development tools

For more details, check the dev directory.

This package was developed using r BiocStyle::Biocpkg('biocthis').



lahuuki/DeconvoBuddies documentation built on May 5, 2024, 9:35 a.m.