Grilled Cheese

ExploreLog inSign up
Terms of UsePrivacy PolicyCommunity StandardsHelpGet the app

Grilled Cheese is a product of Village Compute

Version devBuilt at: 2026-12-03 22:42:33 EST

PhotosVideosAllPeople
LatestRanked
Figure titled “Within-Cohort Gene-Wise Feature Scaling.” Five density panels (Cohorts A–E) show reference z-score distributions concentrated near zero, with dashed vertical lines at zero. These plots illustrate within-cohort scaling for reference/QC, not validation-ready preprocessing.

Feature Scaling Is Not Harmonization—and It Can Leak Information

At this stage of our melanoma workflow, a seemingly minor preprocessing decision could have made later model evaluation overly optimistic.

It would have been easy to z-score each cohort once, save the standardized expression matrix, and then use it for predictive modeling. The distributions in this figure appear centered near zero, but a visually standardized matrix is not necessarily appropriate for validation.

If each gene's mean and standard deviation are estimated from an entire cohort before splitting it, future test or validation samples contribute to the preprocessing parameters. Their outcomes need not be involved: information about held-out feature distributions has already entered the workflow.

Our protocol therefore established a boundary: full-cohort scaling was for reference and QC only. For modeling, centering and scaling parameters must be estimated within each training split and applied unchanged to held-out data. They should not be refitted on the test set.

Scaling is also not the same as cross-cohort harmonization. Centering genes and adjusting their variance does not automatically remove platform effects, differences in sample composition, or other dataset-specific variation.

The lesson: a clean-looking expression matrix does not guarantee leakage-free evaluation. Preprocessing must respect the validation design.

Many thanks to Mohanna Abbasi for creating this visualization.

#FeatureScaling #DataLeakage #MachineLearning #ZScore #ModelValidation #Transcriptomics #Bioinformatics
Illustrative workflow for gene identifier harmonization across microarray and RNA-seq cohorts. Source identifiers, including Ensembl IDs, current gene symbols, and historical aliases, are checked against reference annotations. Unique mappings are retained, ambiguous or unresolved identifiers are excluded and logged, and multiple identifiers referring to the same gene are consolidated into a shared gene universe. All identifiers shown are illustrative.

Before Comparing Cohorts, Define What a Gene Means Across Platforms

One challenge in cross-cohort transcriptomics is that expression-matrix row names may look like genes without representing the same identifiers across datasets.

In our team's melanoma research, older microarray cohorts used Gene Symbols, while RNA-seq data included Ensembl IDs. Some symbols were historical aliases rather than current approved names.

A historical alias that maps uniquely to one current gene symbol can be resolved using reference annotations.

The more difficult cases arise when one alias maps to multiple genes. Choosing a mapping arbitrarily would introduce uncertainty rather than achieve genuine harmonization.

We therefore accepted only unique, traceable mappings. Ambiguous and unresolved identifiers were excluded from the shared feature space, while their identities and exclusion reasons were retained for auditing.

The reverse problem also occurred: multiple source identifiers could map to the same biological gene. These relationships required documented consolidation rules so the final gene-level universe would not count the same gene more than once.

This distinction matters because simply intersecting row names across expression matrices does not establish biological comparability.

The central question was not just “How many genes overlap?” but “Do these identifiers actually refer to the same biological genes?”
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Photo, no description
Figure titled “PCA Assessment and Batch-Correction Eligibility.” Six cohort rows (A–F) display before-correction PCA plots on the left, with samples colored by annotated sample type. Each corresponding After panel states that batch correction was not performed. PC1 and PC2 summarize the leading directions of expression variation; visible sample structure does not, by itself, establish a technical batch effect.

When PCA Suggests Structure, but Metadata Cannot Explain It

Sometimes PCA reveals visible structure in expression data while the available metadata do not explain what produced it.

During a team QC assessment of our melanoma cohorts, we examined PCA plots and their accompanying metadata. Although patterns were visible across several cohorts, no documented, reliable technical variable was available to define batches.

This matters because batch correction requires a defensible understanding of the technical variation being adjusted. Assigning batches solely from PCA clusters could remove genuine biological differences. Sample type or phenotype should not be repurposed as a technical batch variable simply because batch information is missing.

For this assessment, we did not apply ComBat. The empty After panels document that decision rather than an incomplete analysis.

Importantly, this does not prove that technical effects are absent. It means the available metadata did not support a justified correction at this stage.

The main lesson for me was that uncertainty should be documented rather than hidden behind an unsupported correction procedure.

In multi-cohort research, methodological restraint can help protect biological signals and analytical transparency.

Many thanks to Mohanna Abbasi for preparing this batch-correction assessment figure.

#BatchEffect #PCA #ComBat #DataQC #Bioinformatics #ComputationalOncology
Photo, no description
Photo, no description
Scatter plot titled “Cohort B | PCA by sample condition.” PC1 and PC2 show the main directions of expression variation in a representative melanoma microarray cohort. Primary samples are blue and metastatic samples orange. Several distant observations are labeled “candidate” for further QC review.

PCA, Correlation, and Distance: Three Views of Sample Structure

When examining sample structure in my melanoma project, I found that what looks unusual depends on the metric used for comparison.

A sample that appeared distant in PCA did not necessarily look equally unusual in the correlation or distance heatmaps.

These visualizations measure different aspects of expression data.

PCA summarizes the main directions of variation across samples. A sample can therefore appear isolated along PC1 or PC2 without being equally different under other measures of similarity.

Pearson correlation focuses on expression-pattern similarity: whether gene expression values tend to vary together across two samples.

Euclidean distance instead measures the overall magnitude of differences between their expression profiles.

During QC, I followed the same flagged samples across these complementary visualizations to examine whether unusual patterns were supported by multiple perspectives.

An isolated point in PCA is not automatically evidence of a technical failure. Its relationship to other samples needs further examination.

My main lesson: outlier assessment is not simply about identifying the most distant point. It requires understanding which definition of similarity makes the difference visible.

#PCA #Correlation #EuclideanDistance #DataQC #Bioinformatics #ComputationalOncology
Multi-panel figure titled “Expression Quality Control” across six cohorts (A–F). Panel A shows per-sample expression density curves; panel B shows sample median-expression distributions. Panel C reports 0% maximum expression missingness across the six cohorts. Panel D shows Cohort F raw library sizes with dashed review boundaries, and panel E shows Cohort E detection P-value QC. Blue marks PASS and orange marks REVIEW; dashed lines indicate review thresholds, not automatic exclusions.

Expression QC: Why One Plot Is Not Enough

During expression quality control, I encountered samples that appeared unusual according to individual metrics. Some had lower median expression, others fell outside the typical library-size range, and a few showed lower detection rates.

But the question was not just “Which samples look different?” It was “Does this provide enough evidence to exclude them?”

To avoid drawing conclusions from a single plot, I evaluated several complementary dimensions: expression density, per-sample median expression, missingness, raw library size, and detection evidence. Each describes a different aspect of the data, and an unusual value in one metric does not necessarily establish a technical failure.

I therefore kept REVIEW separate from technical exclusion. Samples with warning signals were flagged for further assessment rather than automatically discarded. The review flags were carried forward for additional checks, where multiple sources of evidence could inform any outlier decision. Only hard technical failures were eligible for exclusion at the QC-clean handoff.

For me, the key lesson is simple: QC flags are prompts for investigation, not automatic removal rules. Retaining that distinction helps avoid unnecessary sample loss and supports transparent decisions.

#ExpressionQC #DataQC #GeneExpression #Bioinformatics #Transcriptomics #ComputationalOncology
Figure titled “TMM normalization factors by sample type” for a representative RNA-seq cohort. Boxplots and individual points compare primary (blue) and metastatic (orange) melanoma samples. A dashed line marks TMM factor = 1. Values vary within both groups; distance from 1 alone does not indicate poor sample quality.

From STAR Counts to an RNA-seq Matrix You Can Actually Analyze

In RNA-seq, having a count matrix does not mean the data are ready for comparison.

In my melanoma project, some genes had very low expression and contributed little useful information. Before normalization, I filtered low-information features without removing samples from the cohort.

I then applied trimmed mean of M-values (TMM) normalization to account for differences in library composition between samples.

The plot illustrates a distinction I found important: TMM factor = 1 is not a “good score,” and a factor farther from 1 does not, by itself, mean that a sample is poor quality or an outlier. It reflects the relative scaling adjustment estimated for that library.

Normalization and quality control are different tasks. TMM does not diagnose outliers or batch effects. Its purpose is to adjust for composition-related differences so that downstream comparisons can be carried out on a more appropriate statistical basis.

For me, the count matrix is the starting point. Preparing it for analysis requires thoughtful feature filtering and normalization—not treating every detected feature or every raw library as immediately comparable.

#RNASeq #TMM #edgeR #GeneExpression #Transcriptomics #Bioinformatics #ComputationalOncology
Infographic titled “Dataset Registry: Defining What Each Cohort Can Do Before Analysis.” An anonymized table summarizes 10 cohorts across bulk, multi-omics, survival, and single-cell data, with sample sizes, identifiers, limitations, and proposed roles. A diagram explains role locking.

Dataset Registry: Defining What Each Cohort Can Do Before Analysis

By the end of data acquisition, my melanoma project included 10 cohorts with different structures: bulk transcriptomics, multi-omics, clinical data, and single-cell data. But having 10 datasets did not answer a crucial question: what can each cohort legitimately contribute to the study?

I built a Dataset Summary Registry beyond a file inventory. For each cohort, I recorded data type, platform, sample and patient counts, identifier status, available metadata, QC and acquisition status, and limitations.

I also specified analytical roles, permitted and prohibited uses, the appropriate unit of inference, and conditions for entering a given analysis.

These distinctions matter. A cohort reserved for external validation should not enter feature selection, model fitting, or retuning. A replication cohort should not be reassigned to discovery because its results look useful. In single-cell studies, inference should reflect the biological unit—sample, tumor, or patient—rather than treating cells as independent patients.

The roles of all 10 cohorts were documented in a role table marked LOCKED_INTERNAL_PRE_ANALYSIS. Defining boundaries in advance helps limit result-driven reassignment and protects validation integrity.

The registry became a map of three questions: What do we have? What can it support? What is it allowed to do?

Data readiness means more than having expression matrices and metadata. Every cohort needs a defensible place in the study architecture and clear constraints on its use.

#DataGovernance #DatasetRegistry #ResearchDesign #Bioinformatics #ComputationalOncology
Photo, no description
Load more