Portfolio repository with R helpers for downstream single-cell / single-nucleus RNA-seq analysis using Seurat. The code is adapted from applied research notebooks and organized to show practical bioinformatics workflow design for CV and technical review.
Core areas:
- Seurat-based QC, filtering, integration, clustering, and UMAP workflow design
- metadata-aware analysis across samples, groups, and covariates
- Harmony integration
- scType-assisted annotation
- cell type proportions, MAST differential expression, and marker-positive cell analysis
This repository is intended for downstream analysis after Cell Ranger or an equivalent count-generation step. It includes helper code for:
- loading 10x filtered feature-barcode matrices
- adding sample metadata and QC metrics
- applying QC filters
- cell-cycle scoring
- sample integration with Harmony
- graph clustering and UMAP visualization
- optional scType-assisted cell type annotation
- cell type proportion summaries
- cell type-level differential expression with MAST
- gene-positive / gene-negative proportion analysis for senescence-style marker questions
R/seurat_workflow_helpers.R: reusable Seurat workflow helpers extracted from the main notebook logicR/sctype_annotation.R: portable scType annotation wrapper without local hard-coded pathsR/senescence_helpers.R: gene-positive proportion utilities based on the senescence notebookscTypeasFunction.R: compatibility wrapper for older code that calledrunsctype()examples/metadata_template.csv: minimal sample metadata templatedocs/portfolio_skills.md: CV-oriented skills matrixdocs/workflow.md: workflow outline and expected inputsdocs/source_validation.md: notes on how the local notebooks map to this repotests/smoke_parse.R: parser smoke test for the public helper filestests/test_workflow_helpers.R: lightweight Seurat-free tests for metadata and proportion helperstests/test_senescence_helpers.R: lightweight Seurat-free tests for senescence helpers
The helper files are organized around these package families:
- Seurat workflow:
Seurat,SeuratObject - integration:
harmony - data wrangling:
dplyr,tidyr,readr,tibble - statistical modeling: optional
betareg,MAST - visualization and output: optional
ggplot2,readr - annotation: scType helper functions and an explicit scType database path or URL
Minimal local checks use dplyr, tidyr, and readr:
install.packages(c("dplyr", "tidyr", "readr", "tibble", "ggplot2"))Full workflow execution additionally requires packages such as Seurat, SeuratObject, harmony, and Bioconductor MAST.
Rscript --vanilla tests/smoke_parse.R
Rscript --vanilla tests/test_workflow_helpers.R
Rscript --vanilla tests/test_senescence_helpers.RThese tests validate parser integrity and Seurat-free helper behavior. Full Seurat, Harmony, Cell Ranger, scType, and MAST execution requires real input data and the relevant R packages.
source("R/seurat_workflow_helpers.R")
source("R/sctype_annotation.R")
metadata <- read_sample_metadata(
"examples/metadata_template.csv",
count_col = "SEQ_ID",
sample_col = "SAMPLE"
)
samples <- load_cellranger_samples(
metadata = metadata,
counts_dir = "cellranger_mRNA_premRNA",
project = "example_project"
)
seurat_obj <- merge_seurat_samples(
samples = samples,
sample_ids = metadata$SEQ_ID,
project = "example_project"
)
seurat_obj <- add_sample_metadata(
seurat_obj = seurat_obj,
metadata = metadata,
count_col = "SEQ_ID"
)
seurat_obj <- add_qc_metrics(seurat_obj)
seurat_obj <- filter_seurat_qc(seurat_obj)The earlier scType helper used local RDS inputs and local database paths. The current helper accepts an in-memory Seurat object and an explicit database path or URL:
Remote scType helper sourcing is disabled by default. Use allow_remote_source = TRUE only as an explicit convenience option, or load/pin the scType helper functions separately and pass them through gene_sets_prepare_fun and sctype_score_fun.
source("R/sctype_annotation.R")
annotated <- run_sctype_annotation(
seurat_obj = seurat_obj,
gene_set_db = "https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/ScTypeDB_full.xlsx",
tissue = "Brain",
output_dir = "sctype_figures",
figure_prefix = "example",
allow_remote_source = TRUE
)Portfolio-quality analysis-helper repository. The reusable logic is separated into functions and documented; it is not packaged as a formal R library.
- Hao Y et al. Integrated analysis of multimodal single-cell data
- Korsunsky I et al. Fast, sensitive and accurate integration of single-cell data with Harmony
- Ianevski A et al. Fully-automated and ultra-fast cell-type identification using specific marker combinations from single-cell transcriptomic data