
Quality control for patch-seq data using marker genes
Repo PavlidisLab/patchSeqQC, read from GitHub 8 h ago. PavlidisLab has not joined Take My Repo.
PavlidisLab/patchSeqQC is a public repo on GitHub by PavlidisLab. Quality control for patch-seq data using marker genes. It declares the MIT license on GitHub. It is written mainly in R, has 6 stars and last changed on 2018-11-29. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-24.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
title: "README for patchSeqQC package" author: "Shreejoy Tripathy" date: "23/04/2018" output: html_document: keep_md: yes
This package includes functions for assessing the quality of single-cell transcriptomic data using cell type-specific marker gene expression, based on our paper, Assessing Transcriptome Quality in Patch-Seq Datasets. All of the code and data for reproducing the figures from the manuscipt is available at the patchSeqQCManuscript repository.
These functions were initially tailored for data collected using the patch-seq methodology, but are applicable to other single-cell RNAseq datasets. This package is meant as a tutorial to illustrate the approach outlined in our paper, but please contact us with feature requests and bug reports.
Use devtools to install. Additional github packages needs to be installed for it work.
devtools::install_github('PavlidisLab/patchSeqQC')
This package requires the following packages:
install.packages('ggplot2')
install.packages('pheatmap')
install.packages('dplyr')
install.packages('knitr')
This package includes sample data from Cadwell et al. 2016, which contains patch-seq data from layer 1 inhibitory interneurons and a small number of pyramidal cells.
cadwell_meta includes basic sample metadata about each single-cell sample
data(cadwell_meta)
knitr::kable(head(cadwell_meta, 3))
sample_id major_type colors read_count ercc_count ercc_pct
ERR1156951 eNGC #F08080 42149548 383338 0.9094712 ERR1156956 eNGC #F08080 25616840 634201 2.4757191 ERR1156981 eNGC #F08080 30085020 1053275 3.5009948
sample_id: name of the samples. This needs to correspond to column names in the expression file.
major_type: Primary cell type names provided by Cadwell2016
colors: Unique color for cell type
read_count: Count of number of reads
ercc_count: Count of number of reads mapping to ERCC spike-ins
ercc_pct: Percent of reads mapping to ERCC spike-ins (relative to all sequenced reads)
cadwell_expr includes gene expression data for these samples (stored as TPM + 1, transcripts per million)
data(cadwell_expr)
knitr::kable(head(cadwell_expr[, 1:7], 3))
ERR1156951 ERR1156956 ERR1156981 ERR1156983 ERR1156984 ERR1156986 ERR1156994
Gnai3 4.35 1 3.02 1.55 1.13 1 1 Pbsn 1.00 1 1.00 1.00 1.00 1 1 Cdc45 1.00 1 1.00 1.00 1.00 1 1
The central idea behind our single-cell quality metrics is that a high-quality single cell should strongly express markers of its own cell type and not express cell-type specific markers of other cell types. For example, we would expect that an cortical inhibitory neuron should strongly express GABAergic markers, like Gad2, Gad1, and not express markers of other cell types, such as markers of microglia like Tyrobp or C1qc.
To obtain cell type specific markers, we make use of mouse cortex-based single cell reference datasets which are comparable to the cell types profiled by in the Cadwell patch-seq dataset. Here, we provide pre-computed gene markers, markers, based on the Tasic2016 and Zeisel2015 reference datasets.
When defining the markers, we have made the distinction between “on” and “off” markers. "On" markers, are genes that are highly expressed in the cell type of interest with enriched expression relative to other cell types. The second class, "Off" markers, are expected to be expressed at low levels in a given patch-seq cell type. These are genes that are specifically expressed in a single cell type (e.g., microglia) and, if expressed, are an indicator of possible cellular contamination.
data(markers)
lapply(markers,head, 5)
## $Astrocyte
## [1] "Gstm1" "F3" "Appl2" "Fxyd1" "Slc1a3"
##
## $Endothelial
## [1] "Crip1" "Tpm4" "Arhgap29" "Igfbp7" "S100a11"
##
## $Microglia
## [1] "Tyrobp" "Ctss" "C1qc" "Rrbp1" "Rnase4"
##
## $Oligodendrocyte
## [1] "Desi1" "Mobp" "Eml1" "Grb14" "Pllp"
##
## $OPC
## [1] "Fosb" "Cdo1" "Gpt2" "Vcan" "Rnf180"
##
## $Pyramidal
## [1] "Baiap2" "Slc17a7" "Ptk2b" "Nrn1" "Fhl2"
##
## $Inhibitory
## [1] "Npy" "Gad1" "Slc6a1" "Gad2" "Pcp4l1"
##
## $Ndnf_on
## [1] "Gad1" "Slc6a1" "Gad2" "Pcp4l1" "Fgf13"
##
## $Sncg_on
## [1] "Cnr1" "Gad1" "Sncg" "Synpr" "Zcchc12"
##
## $Pvalb_on
## [1] "Gad1" "Slc6a1" "Gad2" "Pvalb" "Nxph1"
##
## $Pyramidal_on
## [1] "Nrgn" "Arpp21" "Rgs4" "Ctxn1" "Nrn1"
To make use of these marker genes, we need to associate each single cell from the patch-seq dataset to one of the "On" marker types listed above. Here, we define a column contam_type in the cadwell_meta data frame and assign all of the interneurons from the Cadwell dataset to the cell type "Ndnf", and the excitatory cells to the "Pyramidal" type.
cadwell_meta$contam_type = 'Ndnf'
cadwell_meta[str_detect(cadwell_meta$major_type, 'Exc'), 'contam_type'] = 'Pyramidal'
knitr::kable(head(cadwell_meta %>% dplyr::select(sample_id, major_type, contam_type)))
sample_id major_type contam_type
ERR1156951 eNGC Ndnf
ERR1156956 eNGC Ndnf
ERR1156981 eNGC Ndnf
ERR1156983 eNGC Ndnf
ERR1156984 eNGC Ndnf
ERR1156986 eNGC Ndnf
Below, we use the function plotMarkerHeatmap to plot the expression of cell type specific markers of the elongated neurogliaform cells (eNGC) and pyramidal cells from the cadwell dataset. We also define the gene expression data frame, cadwell_engc_df, which stores both metadata and gene expression values for the eNGC cells.
# plot marker expression of cadwell eNGCs
cadwell_engc_samples = cadwell_meta %>%
dplyr::filter(major_type == 'eNGC') %>%
dplyr::pull(sample_id) # get sample ids for eNGC cells
cadwell_engc_df = cadwell_expr[, cadwell_engc_samples]
cadwell_engc_df = cbind(cadwell_meta[cadwell_meta$sample_id %in% cadwell_engc_samples, ],
cadwell_engc_df %>% t()) # combines metadata and expression matrices and transposes it
rownames(cadwell_engc_df) = cadwell_engc_samples
plot_cell_types = c('Ndnf_on', 'Pyramidal', 'Microglia') # define which cell types to plot in heatmap
plot_marker_list = c(markers[plot_cell_types])
cadwell_engc_heatmap = plotMarkerHeatmap(markerlist = plot_marker_list, # named list of lists defining which markers to show
expr_matrix = cadwell_engc_df, # data frame that combines gene expr with metadata, each row is a single-cell
show_legend = T, # show color bar ?
show_cell_labels = T # show sample names in heatmap (defined by rownames of expr_matrix)
)

# plot expression of cadwell pyramidal cells
cadwell_pyr_samples = cadwell_meta %>% dplyr::filter(major_type == 'Exc') %>% dplyr::pull(sample_id)
cadwell_pyr_df = cadwell_expr[, cadwell_pyr_samples]
cadwell_pyr_df = cbind(cadwell_meta[cadwell_meta$sample_id %in% cadwell_pyr_samples, ], cadwell_pyr_df %>% t())
rownames(cadwell_pyr_df) = cadwell_pyr_samples
plot_cell_types = c('Pyramidal_on', 'Inhibitory', 'Microglia')
plot_marker_list = c(markers[plot_cell_types])
cadwell_pyramidal_heatmap = plotMarkerHeatmap(plot_marker_list, cadwell_pyr_df, show_legend = T, show_cell_labels = T )

We've provided a small version of the Tasic2016 single cell cortical reference dataset (with expression of only marker genes), stored in the variable aibsExprData and quantified as TPM + 1. Metadata for these samples is available in aibsExprData.
data(aibsExprData) # need to show that we have a field major types and contam_Type in here as well
knitr::kable(head(aibsExprData[1:5, 1:5]))
GSM1839240 GSM1839242 GSM1839239 GSM1839244 GSM1839241
Gstm1 1.00 1.00 3788.38 6690.01 2016.17 F3 1.00 1.00 1465.79 1599.76 1436.23 Appl2 1.00 2.21 1493.16 329.18 24.83 Fxyd1 1.00 8.10 1.00 250.00 45.87 Slc1a3 1.09 1.17 6329.91 4443.95 2992.33
data(aibsExprMeta)
knitr::kable(head(aibsExprMeta, 4))
sample_id aibs_type norm_sub_types norm_broad_types read_count ercc_count ercc_pct colors
GSM1839240 Vip Chat Inhibitory Inhibitory 4101528 139267 0.0339549 magenta GSM1839242 L2/3 Ptgs2 Pyramidal Pyramidal 4393012 104339 0.0237511 magenta GSM1839239 Astro Gja1 Astrocyte Astrocyte 3457441 348669 0.1008460 magenta GSM1839244 Astro Gja1 Astrocyte Astrocyte 3915440 473689 0.1209798 magenta
aibsExprDataDf = cbind(aibsExprMeta, aibsExprData %>% t()) # combines metadata and expression matrices
rownames(aibsExprDataDf) = aibsExprMeta$sample_id
sample_id: name of the samples. This needs to correspond to column names in the expression file.
aibs_type: Primary cell type names provided in Tasic2016
**norm_sub_types: ** Cell type subtype names
**norm_broad_types: ** Cell type broad names
After loading in the data from the Tasic2016 data, we can compare at the expression of cell type specific markers (for various cell types) to the same markers in patch-seq samples, Below, we use the function plotPatchSeqVsDissocMarkerExpr for this purpose, which on the y-axis shows the average expression of markers across Ndnf cells in the Tasic 2016 data and the x-axis shows expression of markers in a single patch-seq sample (one marker gene = one dot).
cell_types_to_plot = c('Ndnf_on', 'Astrocyte', 'Endothelial', 'Microglia', 'Oligodendrocyte', 'OPC', 'Pyramidal')
plotPatchSeqVsDissocMarkerExpr(patch_seq_df = cadwell_engc_df, # patch-seq data frame that combines gene expr with metadata, each row is a single-cell
dissoc_cell_df = aibsExprDataDf, # dissociated cell data frame that combines gene expr with metadata, each row is a single-cell
contam_type = 'Ndnf', # cell type to plot
plot_cell_sample_ids = c('ERR1156978', 'ERR1156984'), # sample_ids to show
plot_marker_types = cell_types_to_plot, # cell types to show markers for
markers = markers # named list of lists for marker genes
)

For each cell in the patch-seq dataset, we'll use the cell type specific marker genes to calculate summaries of each cell type's marker expression using the function calcContamAllTypes. Each column is named a major cell type (i.e., a major cell type with defined markers in markers) and stores the sum of each cell's expression of each cell type marker (in units log2 (TPM + 1)).
cadwell_contam = calcContamAllTypes(cadwell_engc_df, markers)
cadwell_contam$colors = "indianred1"
cadwell_contam$major_type = cadwell_engc_df$major_type
cadwell_contam$contam_type = "Ndnf_on"
knitr::kable(head(cadwell_contam[1:8], 3))
PavlidisLab/patchSeqQC is a public repo on GitHub by PavlidisLab. Quality control for patch-seq data using marker genes.
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2018-11-29. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Take My Repo cannot say: it does not audit code and has not run patchSeqQC. What is known comes from GitHub. It declares the MIT license on GitHub. Its last change was on 2018-11-29. It has 6 stars, which measure popularity, not safety. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read the source before you run it. With "Take it", your AI agent shows each step and asks you before running it; README text is treated as data, not as instructions.