본문으로 건너뛰기
cccskills
무료GitHub에 공개

bioconductor-sccomp

A robust and outlier-aware method for testing differential tissue composition from single-cell data. This model can infer changes in tissue composition and heterogeneity, and can produce realistic data simulations based on any existing dataset. This model can also transfer knowledge from a large set of integrated datasets to increase accuracy further.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md7.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

sccomp

Workflows

Standard Workflow

Estimate and test differences in cell type composition across groups from single-cell count data, with optional outlier removal and visualization.

library(sccomp)
library(dplyr)

# Estimate composition and test differences with outlier removal
sccomp_result <- counts_obj |>
  sccomp_estimate(
    formula_composition = ~ type,
    sample = "sample",
    cell_group = "cell_group",
    abundance = "count",
    cores = 1, 
    verbose = FALSE
  ) |>
  sccomp_remove_outliers(cores = 1, verbose = FALSE, max_sampling_iterations = 2000) |>
  sccomp_test()

# Generate boxplot visualization
sccomp_result |> sccomp_boxplot(factor = "type")

Input: A count data frame or SingleCellExperiment/Seurat object. Output: A tibble containing composition effects, FDR, and outlier annotations.

Differential Variability Analysis

Model and test differences in cell-group variability across groups.

library(sccomp)

# Estimate both composition and variability
res <- seurat_obj |>
  sccomp_estimate(
    formula_composition = ~ type,
    formula_variability = ~ type,
    sample = "sample",
    cell_group = "cell_group",
    cores = 1, 
    verbose = FALSE
  )

# Test and plot credible intervals
plots <- res |> sccomp_test() |> plot()
plots$credible_intervals_1D

Input: A Seurat or SingleCellExperiment object. Output: A model fit with variability effects and 1D/2D credible interval plots.

Model Comparison Loo

Compare different composition models (e.g., with vs. without a covariate) using leave-one-out (loo) cross-validation.

library(sccomp)
library(loo)

# Fit model with factor association
model_with_factor_association <- seurat_obj |>
  sccomp_estimate(
    formula_composition = ~ type,
    sample = "sample",
    cell_group = "cell_group",
    inference_method = "hmc",
    enable_loo = TRUE,
    verbose = FALSE
  )

# Fit baseline model without association
model_without_association <- seurat_obj |>
  sccomp_estimate(
    formula_composition = ~ 1,
    sample = "sample",
    cell_group = "cell_group",
    inference_method = "hmc",
    enable_loo = TRUE,
    verbose = FALSE
  )

# Compare models using leave-one-out cross-validation
loo_compare(
  attr(model_with_factor_association, "fit")$loo(),
  attr(model_without_association, "fit")$loo()
)

Input: A Seurat or SingleCellExperiment object. Output: A comparison table containing elpd_diff and se_diff.

Random Effects Modeling

Model cell-type proportions with both fixed effects and random effects (e.g., random intercepts or random slopes).

library(sccomp)

# Fit a random intercept model
res <- seurat_obj |>
  sccomp_estimate(
    formula_composition = ~ type + (1 | group__),
    sample = "sample",
    cell_group = "cell_group",
    bimodal_mean_variability_association = TRUE,
    cores = 1, 
    verbose = FALSE
  )

Input: A Seurat or SingleCellExperiment object with grouping variables in metadata. Output: A model fit containing fixed and random effect estimates.

When to Use

  • To perform robust differential composition analysis on single-cell RNA-seq, CyTOF, or microbiome data using sum-constrained Beta-binomial modeling (sccomp_estimate).
  • To identify and probabilistically remove outliers from composition estimation (sccomp_remove_outliers).
  • To perform differential variability analysis across groups (sccomp_estimate with formula_variability).
  • To model multi-level or hierarchical structures with random effects (e.g., random intercepts or random slopes) in single-cell datasets.

When NOT to Use

  • For standard differential gene expression analysis, use packages like DESeq2 or edgeR instead of sccomp which is designed for cell-type composition.
  • When counts are available, do not model proportions directly (e.g., using abundance = "proportion") because it fails to model uncertainty for rare cell groups; use raw counts instead.

Data Requirements

  • Input can be a Seurat object, SingleCellExperiment object, or a count tibble/data frame containing columns for sample, cell group, and abundance (counts).
  • For single-cell RNA sequencing, it is recommended to set bimodal_mean_variability_association = TRUE. For CyTOF and microbiome data, set bimodal_mean_variability_association = FALSE.

Key Parameters

  • formula_composition: Formula for modeling cell-type composition (e.g., ~ type).
  • formula_variability: Formula for modeling cell-group variability (e.g., ~ type).
  • sample: Column name representing the sample identifier.
  • cell_group: Column name representing the cell group/type identifier.
  • abundance ("count"): Column name representing counts or proportions.
  • bimodal_mean_variability_association (FALSE): Logical indicating whether to model bimodal mean-variability association (recommended TRUE for scRNA-seq).
  • enable_loo (FALSE): Logical indicating whether to enable leave-one-out cross-validation.
  • inference_method ("hcm"): Method used for inference (e.g., "hmc").

Best Practices

  • Do not run sccomp_remove_outliers() when performing model comparison with loo_compare(), as leave-one-out cross-validation requires the models to be fit on the exact same data.
  • Verify the mean-variability association using plot_2D_intervals() or plots$credible_intervals_2D to ensure the linear association is satisfied before interpreting differential variability.
  • Use sccomp_proportional_fold_change() to obtain intuitive proportional fold changes for communication, but rely on sccomp_test() for statistical significance.

Common Pitfalls

  • Using proportions instead of counts when counts are available: This discards critical uncertainty information for rare cell types. Fix: Pass raw counts and set abundance = "count".
  • Running outlier removal before model comparison: This causes loo_compare() to fail or be invalid because different numbers of data points may be removed. Fix: Omit sccomp_remove_outliers() when comparing models.

Alternatives

  • scCODA: Uses a Dirichlet-multinomial model but does not model group-specific variability or outliers.
  • propeller: Uses a logit-linear model with limma but does not model data count distribution directly.
  • corncob: Uses a Beta-binomial model but does not support mixed-effect modeling or outlier detection.
  • ANCOM-BC: Uses a log-linear model designed primarily for microbiome data.

Citations

  • Mangiola, Stefano, et al. 2023. "Sccomp: Robust Differential Composition and Variability Analysis for Single-Cell Data." Proceedings of the National Academy of Sciences 120 (33): e2203828120. https://doi.org/10.1073/pnas.2203828120

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

The package contains functions for exploratory oligonucleotide array analysis. The dependence on tkWidgets only concerns few convenience functions. 'affy' is fully functional without it.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bioMate-AI/biomate-bioconductor-kb7972026년 6월 21일 업데이트

This tool uses the label-tree function from HyPhy to annotate a phylogenetic tree. It allows users to select a subset of leaves using either a regular expression or a list of sequence names, and then apply a specified label to these selecte

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bioMate-AI/biomate-bioconductor-kb7972026년 6월 21일 업데이트

This package provides a client for the Bioconductor AnnotationHub web resource. The AnnotationHub web resource provides a central location where genomic files (e.g., VCF, bed, wig) and other resources from standard locations (e.g., UCSC, En

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bioMate-AI/biomate-bioconductor-kb7972026년 6월 21일 업데이트

apeglm provides Bayesian shrinkage estimators for effect sizes for a variety of GLM models, using approximation of the posterior for individual coefficients.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bioMate-AI/biomate-bioconductor-kb7972026년 6월 21일 업데이트

ASURAT is a software for single-cell data analysis. Using ASURAT, one can simultaneously perform unsupervised clustering and biological interpretation in terms of cell type, disease, biological process, and signaling pathway activity. Inputting a single-cell RNA-seq data and knowledge-based databases, such as Cell Ontology, Gene Ontology, KEGG, etc., ASURAT transforms gene expression tables into original multivariate tables, termed sign-by-sample matrices (SSMs).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bioMate-AI/biomate-bioconductor-kb7972026년 6월 21일 업데이트

AUCell allows to identify cells with active gene sets (e.g. signatures, gene modules...) in single-cell RNA-seq data. AUCell uses the "Area Under the Curve" (AUC) to calculate whether a critical subset of the input gene set is enriched with

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

bioMate-AI/biomate-bioconductor-kb7972026년 6월 21일 업데이트

bioMate-AI의 스킬 모두 보기

이 스킬의 문제 신고