Guide count quality
A count table can have adequate total depth while losing individual guides. This page examines the complete deposited guide set before the main filter. It counts zero observations, measures count inequality, and compares profiles on the same log2 count scale.
Examine representation and culture agreement
Section titled “Examine representation and culture agreement”The Gini coefficient summarizes count inequality within one profile. Zero means equal counts; larger values mean more concentration in fewer guides. It is a descriptive statistic here, not an automatic culture exclusion rule. Selection itself can change representation.
Pearson correlations use log2(count + 1) across every guide. A large correlation can coexist with a biologically important subset of changed guides. The two DMSO and two drug profiles must be assessed within their intended groups, rather than selecting cultures because their removal improves a result.
The heat map also contains baseline and day-seven profiles. These profiles
supply context without becoming extra day-14 replicates. The unresolved
Brunello Library material keeps its deposited label.
library(ggplot2)library(jsonlite)dir.create("outputs", showWarnings = FALSE)input <- gzfile("/fixtures/all_counts.tsv.gz", open = "rt")source_names <- strsplit(readLines(input, n = 1), "\t", fixed = TRUE)[[1]]counts <- read.delim(input, header = FALSE, col.names = source_names, check.names = FALSE)close(input)metadata <- read.delim("/fixtures/samples.tsv")values <- as.matrix(counts[, metadata$source_label])summary <- data.frame(sample = metadata$sample, total = colSums(values), zeros = colSums(values == 0), zero_fraction = colMeans(values == 0), gini = rep(0, ncol(values)))for (i in seq_len(ncol(values))) { ordered <- sort(as.double(values[, i])) n <- length(ordered) summary$gini[i] <- sum((2 * seq_len(n) - n - 1) * ordered) / (n * sum(ordered))}stopifnot(all(is.finite(summary$gini)))correlations <- cor(log2(values + 1), method = "pearson")colnames(correlations) <- rownames(correlations) <- metadata$samplecorrelation_table <- as.data.frame(as.table(correlations))names(correlation_table) <- c("sample_a", "sample_b", "correlation")write.table(summary, "outputs/summary_r.tsv", sep = "\t", quote = FALSE, row.names = FALSE)write.table(correlation_table, "outputs/correlations_r.tsv", sep = "\t", quote = FALSE, row.names = FALSE)metrics <- list(total = sum(values), zeros = sum(values == 0), mean_gini = mean(summary$gini), dmso_correlation = correlations["C1D14", "C2D14"], drug_correlation = correlations["P1D14", "P2D14"])write_json(metrics, "outputs/metrics_r.json", auto_unbox = TRUE, digits = 16)print(summary, row.names = FALSE, digits = 5)cat(sprintf("Day-14 DMSO correlation: %.6f\n", metrics$dmso_correlation))cat(sprintf("Day-14 drug correlation: %.6f\n", metrics$drug_correlation))figure <- ggplot(summary, aes(sample, 100 * zero_fraction)) + geom_col(fill = "#176B87") + coord_flip() + theme_bw(base_size = 12) + labs(x = "Deposited profile", y = "Guides with zero counts, percent")ggsave("outputs/zero_counts_r.png", figure, width = 7, height = 4.6, dpi = 160)figure <- ggplot(correlation_table, aes(sample_a, sample_b, fill = correlation)) + geom_tile() + scale_fill_viridis_c(limits = c(0, 1)) + coord_equal() + theme_bw(base_size = 10) + theme(axis.text.x = element_text(angle = 60, hjust = 1)) + labs(x = NULL, y = NULL, fill = "Pearson r")ggsave("outputs/correlations_r.png", figure, width = 7.5, height = 6, dpi = 160) sample total zeros zero_fraction gini Brunello_Library 47494107 17 0.00021952 0.30752 D0 43454275 325 0.00419674 0.38444 C1D7 36129429 661 0.00853553 0.45097 C2D7 30593199 677 0.00874214 0.44791 P1D7 26921192 353 0.00455831 0.40892 P2D7 29348316 435 0.00561718 0.41024 C1D14 28923093 936 0.01208662 0.50235 C2D14 27101092 824 0.01064036 0.49974 P1D14 34152512 801 0.01034336 0.70973 P2D14 35371217 900 0.01162175 0.75292Day-14 DMSO correlation: 0.868073Day-14 drug correlation: 0.706593

import jsonfrom pathlib import Path
import matplotlib.pyplot as pltimport numpy as npimport pandas as pd
output = Path("outputs")output.mkdir(exist_ok=True)counts = pd.read_csv("/fixtures/all_counts.tsv.gz", sep="\t")metadata = pd.read_csv("/fixtures/samples.tsv", sep="\t")values = counts[metadata["source_label"]].to_numpy()ordered = np.sort(values, axis=0)n = len(ordered)gini = ((2 * np.arange(1, n + 1) - n - 1)[:, None] * ordered).sum(0)gini = gini / (n * ordered.sum(0))summary = pd.DataFrame({"sample": metadata["sample"], "total": values.sum(0), "zeros": (values == 0).sum(0), "zero_fraction": (values == 0).mean(0), "gini": gini})correlations = np.corrcoef(np.log2(values + 1).T)correlation_table = pd.DataFrame({ "sample_a": np.tile(metadata["sample"].to_numpy(), len(metadata)), "sample_b": np.repeat(metadata["sample"].to_numpy(), len(metadata)), "correlation": correlations.flatten(order="F"),})reference = pd.read_csv(output / "summary_r.tsv", sep="\t")pd.testing.assert_frame_equal(summary, reference, check_dtype=False, atol=1e-8, rtol=0)reference = pd.read_csv(output / "correlations_r.tsv", sep="\t")pd.testing.assert_frame_equal(correlation_table, reference, check_dtype=False, atol=1e-8, rtol=0)summary.to_csv(output / "summary_python.tsv", sep="\t", index=False)correlation_table.to_csv(output / "correlations_python.tsv", sep="\t", index=False)metrics = {"total": int(values.sum()), "zeros": int((values == 0).sum()), "mean_gini": float(gini.mean()), "dmso_correlation": float(correlations[6, 7]), "drug_correlation": float(correlations[8, 9])}(output / "metrics_python.json").write_text(json.dumps(metrics))print(summary.to_string(index=False, float_format="%.5f"))print(f"Day-14 DMSO correlation: {metrics['dmso_correlation']:.6f}")print(f"Day-14 drug correlation: {metrics['drug_correlation']:.6f}")fig, ax = plt.subplots(figsize=(7, 4.6))ax.barh(summary["sample"], 100 * summary["zero_fraction"], color="#176B87")ax.set(xlabel="Guides with zero counts, percent", ylabel="Deposited profile")fig.tight_layout()fig.savefig(output / "zero_counts_python.png", dpi=160)plt.close(fig)fig, ax = plt.subplots(figsize=(7.5, 6))image = ax.imshow(correlations, vmin=0, vmax=1, cmap="viridis")ax.set_xticks(range(10), metadata["sample"], rotation=60, ha="right")ax.set_yticks(range(10), metadata["sample"])fig.colorbar(image, ax=ax, label="Pearson r")fig.tight_layout()fig.savefig(output / "correlations_python.png", dpi=160)plt.close(fig) sample total zeros zero_fraction giniBrunello_Library 47494107 17 0.00022 0.30752 D0 43454275 325 0.00420 0.38444 C1D7 36129429 661 0.00854 0.45097 C2D7 30593199 677 0.00874 0.44791 P1D7 26921192 353 0.00456 0.40892 P2D7 29348316 435 0.00562 0.41024 C1D14 28923093 936 0.01209 0.50235 C2D14 27101092 824 0.01064 0.49974 P1D14 34152512 801 0.01034 0.70973 P2D14 35371217 900 0.01162 0.75292Day-14 DMSO correlation: 0.868073Day-14 drug correlation: 0.706593

The drug cultures show lower guide-wise agreement than the DMSO cultures and more concentrated counts. Selection and population bottlenecks can both produce that pattern; these archived counts do not separate them. All four cultures remain in the declared comparison, and the result retains the shared transduction limit. These checks do not estimate editing efficiency or prove that no bottleneck occurred. The normalization lesson uses controls that pass the prespecified comparator count filter.
Scientific references
Section titled “Scientific references”Goh et al. 2021 describe the source screen. The version 2 deposit supplies the archived counts under CC BY 4.0.
Further reading
Section titled “Further reading”The version 2 count deposit supplies the complete workbook behind the zero-count and correlation summaries. Read the methods in Goh and colleagues’ study alongside the profile labels to distinguish treatment cultures, collection times, and the shared transduction.