Biological data visualization with explicit units

Practical 12: Genomics, systems biology and multi-omics

Learning objectives

Choose graphics for a defined question; distinguish raw counts, transformed abundance and outcome units; display distributions and design structure.

Biological question and data

Which plots reveal library-panel size, sample variation and possible confounding in a hypothetical experiment?

The shared fixture contains counts, log2 abundances and a response in arbitrary units. The plotted count-panel total includes only the 24 supplied features and is not a whole-library sequencing-depth estimate.

No biological download is required. Numerical inputs are hypothetical, not observed animal data. The runnable examples use base R. Count and abundance units are specified where used.

1. Inspect the design before the measurements

Count independent animals within the crossed diet/batch design.

Show R code
helper_dir <- if (dir.exists("R")) "R" else "../R"
stopifnot(file.exists(file.path(helper_dir,"teaching_data.R")))
source(file.path(helper_dir,"teaching_data.R"))
d <- teaching_data()
meta <- d$metadata
xtabs(~diet+batch,meta)
            batch
diet          A  B
  control    12 12
  supplement 12 12
Show R code
barplot(xtabs(~diet+batch,meta),beside=TRUE,legend.text=TRUE,
 col=c("#86B7A3","#E5A66B"),ylab="Number of animals",xlab="Batch")

A balanced cross-tabulation addresses one aspect of design. It does not eliminate every source of confounding.

2. Compare count and abundance views

Use exposure-adjusted counts on a descriptive log2 scale for one gene, and already-log2 measurements for a protein.

Show R code
normalized <- sweep(d$counts,2,d$exposure,"/")
par(mfrow=c(1,2))
boxplot(log2(normalized[1,]+1)~meta$diet,xlab="Diet",ylab="log2 adjusted count + 1",
 main="gene01",col="#86B7A3")
boxplot(d$protein[1,]~meta$diet,xlab="Diet",ylab="Supplied log2 abundance",
 main="protein01",col="#E5A66B")

Show R code
par(mfrow=c(1,1))

The axes describe different measurement scales. The gene and protein labels are fictional and their plots do not establish a linked biological mechanism.

3. Show outcome distributions and paired measurements

Keep animal alignment explicit and label the outcome units.

Show R code
stopifnot(identical(colnames(d$protein),meta$animal))
plot(d$protein[1,],meta$response,col=as.integer(meta$diet),pch=19,
 xlab="protein01 log2 abundance",ylab="Response (arbitrary units)")
legend("topleft",levels(meta$diet),col=1:2,pch=19,bty="n")

Colour reveals whether pooled association might combine group shifts and within-group variation.

4. Show observations as well as summaries

A group mean can conceal heterogeneity and a small denominator. For these hypothetical values, display every observation beside the group summaries.

Show R code
plot_data <- data.frame(group=factor(rep(c('C','T'),each=5)),
 value=c(8,9,10,11,12,9,10,11,12,20))
boxplot(value~group,plot_data,outline=FALSE,ylim=range(plot_data$value),
 xlab='Group',ylab='Hypothetical response')
stripchart(value~group,plot_data,vertical=TRUE,method='jitter',
 add=TRUE,pch=16,col='#267A67')

The extreme observation is visible rather than compressed into a bar. Its presence should prompt investigation of records and the model, not automatic exclusion.

5. Make comparisons interpretable

Axes should identify units and transformations. A log2 abundance difference, original-scale ratio and raw count describe different quantities. Consistent axes support direct visual comparisons; truncated axes and unequal scales can exaggerate differences.

Use point/interval plots for estimates and uncertainty, sample-level plots for distributions and paired plots when the same animals provide both measurements. Avoid connecting unrelated animals as though they were paired. A figure caption should state the sample unit, subset, transformation and question answered.

Interpretation challenge

A bar plot shows a strong mean difference but gives no sample counts or uncertainty. What would improve it?

Show observations and group denominators, add a justified uncertainty display and identify the units/design. Explain whether the figure is descriptive or displays a fitted contrast.

Interpretation and limits

Plots diagnose patterns; they do not replace a model or prove an effect. Avoid using different transformations without labelling them, selectively hiding outliers or interpreting one unusual point before checking its identity and processing.

Exercises

  1. Why label the response as arbitrary units?
  2. What could a pooled scatterplot hide?
  3. Why is a plot of log2 counts not a differential-expression test?
  1. The fixture defines no physical calibration for the phenotype.
  2. Different relationships within groups, batch shifts or unequal sampling.
  3. It supplies neither the required model-based uncertainty nor multiplicity treatment.

Continue learning

B04 Programming, B06 Transcriptomics and B12 Statistics.

Continue with exploratory multi-omics analysis. Return to the practical index or the unified map.