Skip to content
FlowScript templates

Biology — raincloud plot of single-cell measurements

Raincloud plot of neurite length in three genotypes — half violin, box and every individual neuron — so a bimodal knockout is seen rather than averaged away. Typed FlowScript for laboratory biology. Keywords: experiment, assay, sample, protocol.

Template previewFlowScript
Total neurite length at DIV 14, by genotypeFigure: Total neurite length at DIV 14, by genotype. Violin plot. Horizontal axis: Total neurite length (µm), linear scale, from 0 to 450. 3 series. Wild type (211.95 µm, interval 192.075 to 234.05, n = 36); Knockout (128.7 µm, interval 111.75 to 172.25, n = 36); Knockout + rescue construct (212.7 µm, interval 174.725 to 233.725, n = 36). Observations: n = 108 observations. Uncertainty: the interquartile range. Not stated in the figure data: axes, effect. Wild type: n = 36, median 212 (IQR 192 to 234), mean 217 (SD 42), range 152 to 336, density bandwidth 13.6763 by the silverman rule. Knockout: n = 36, median 129 (IQR 112 to 172), mean 143 (SD 45), range 87 to 274, density bandwidth 19.6602 by the silverman rule. Knockout + rescue construct: n = 36, median 213 (IQR 175 to 234), mean 211 (SD 50), range 133 to 347, density bandwidth 19.2233 by the silverman rule. Wild type: Bandwidth h = 13.68 by the silverman rule. Both rules of thumb are derived for normal data and OVER-SMOOTH a multimodal density: if the violin's shape is the claim, show it at two bandwidths or say which one you chose. Wild type: 2 of 36 observations lie beyond the 1.5×IQR fences. The rule flags about 0.7% of a NORMAL sample at k = 1.5, so 0.3 would be expected here by chance alone. An outlier is a prompt to check the record, never a licence to delete it. Wild type: Quartiles by Hyndman–Fan type 7; the fences use the same definition, so the box and the outlier rule cannot disagree. Knockout: Bandwidth h = 19.66 by the silverman rule. Both rules of thumb are derived for normal data and OVER-SMOOTH a multimodal density: if the violin's shape is the claim, show it at two bandwidths or say which one you chose. Knockout: 1 of 36 observations lie beyond the 1.5×IQR fences. The rule flags about 0.7% of a NORMAL sample at k = 1.5, so 0.3 would be expected here by chance alone. An outlier is a prompt to check the record, never a licence to delete it. Knockout: Quartiles by Hyndman–Fan type 7; the fences use the same definition, so the box and the outlier rule cannot disagree. Knockout + rescue construct: Bandwidth h = 19.22 by the silverman rule. Both rules of thumb are derived for normal data and OVER-SMOOTH a multimodal density: if the violin's shape is the claim, show it at two bandwidths or say which one you chose. Knockout + rescue construct: 1 of 36 observations lie beyond the 1.5×IQR fences. The rule flags about 0.7% of a NORMAL sample at k = 1.5, so 0.3 would be expected here by chance alone. An outlier is a prompt to check the record, never a licence to delete it. Knockout + rescue construct: Quartiles by Hyndman–Fan type 7; the fences use the same definition, so the box and the outlier rule cannot disagree.Total neurite length at DIV 14, by genotypeWild type: kernel density, h = 13.6763 (silverman rule)Wild type: median 212, hinges 192 and 234, whiskers to 152 and 278 (1.5×IQR), mean 217mean 217.067Wild type: all 36 observation(s), jittered vertically by a seeded hash of each value223 µm228 µm267 µm216 µm209 µm226 µm178 µm263 µm165 µm245 µm221 µm240 µm200 µm200 µm207 µm215 µm278 µm261 µm183 µm216 µm194 µm161 µm207 µm266 µm336 µm201 µm306 µm185 µm209 µm152 µm198 µm232 µm180 µm164 µm154 µm231 µmWild typen = 36, median 212 [192–234]Knockout: kernel density, h = 19.6602 (silverman rule)Knockout: median 129, hinges 112 and 172, whiskers to 87 and 232 (1.5×IQR), mean 143mean 143.394Knockout: all 36 observation(s), jittered vertically by a seeded hash of each value171 µm112 µm103 µm129 µm118 µm100 µm116 µm205 µm161 µm176 µm159 µm94 µm96 µm116 µm124 µm111 µm123 µm132 µm190 µm191 µm133 µm87 µm132 µm126 µm163 µm107 µm95 µm215 µm190 µm121 µm232 µm129 µm274 µm199 µm135 µm99 µmKnockoutn = 36, median 129 [112–172]Knockout + rescue construct: kernel density, h = 19.2233 (silverman rule)Knockout + rescue construct: median 213, hinges 175 and 234, whiskers to 133 and 314 (1.5×IQR), mean 211mean 211.306Knockout + rescue construct: all 36 observation(s), jittered vertically by a seeded hash of each value314 µm247 µm233 µm234 µm223 µm214 µm201 µm152 µm176 µm197 µm234 µm347 µm152 µm212 µm262 µm312 µm133 µm137 µm218 µm171 µm157 µm251 µm204 µm251 µm200 µm167 µm219 µm166 µm176 µm221 µm139 µm187 µm208 µm228 µm216 µm253 µmKnockout + rescue constructn = 36, median 213 [175–234]050100150200250300350400450Total neurite length (µm)Raincloud (Allen et al. 2019): half violin = Gaussian kernel density; box = median, hinges and Tukey 1.5×IQR whiskers with the mean as a diamond; points= every individual observation. The points are the data; the cloud and the box are summaries of them.Bandwidth by the silverman rule of thumb: Wild type h = 13.6763; Knockout h = 19.6602; Knockout + rescue construct h = 19.2233. A density's silhouettedepends on its bandwidth as much as on its data, and both rules of thumb are derived for normal data — they OVER-smooth a genuinely multimodaldensity. If the shape is the claim, show it at two bandwidths.Vertical offsets in the rain are a deterministic hash of each observation's own value, its position in the list, and a seed taken from the block and group ids— never a random number. The same document therefore draws the same cloud on every machine and every run, and the offset carries no information.4 observation(s) lie beyond the 1.5×IQR fences and are drawn once, in the rain, like every other observation. The rule flags about 0.7% of a NORMALsample, so an "outlier" here is a prompt to check the record, never a licence to delete it.1 palette colour(s) darkened or lightened to clear 3:1 against the panel.

Make it your own.

// Raincloud plot of neurite length in three genotypes — half violin, box and every individual neuron — so a bimodal knockout is seen rather than averaged away.
//
// Every string below is EXAMPLE text from a fictional experiment: replace it.
//
// One value per neuron: total neurite length (µm) at day 14 in vitro,
// traced blind to genotype, 36 neurons per genotype pooled from three
// independent differentiations (12 per differentiation). Paste your own
// observations into values: — one number per cell, null for a cell that
// could not be traced — and the density, box, quartiles, Tukey fences, n
// and the per-group summaries are recomputed from them.
//
// Why a raincloud and not a bar of means: about a third of the knockout
// neurons grow normally. The mean of the knockout group sits between the
// two populations and describes almost no actual cell; the violin shows the
// second mode and the rain shows how many neurons are in it.
//
// The unit of replication for inference is the differentiation, not the
// neuron. Test the genotype effect on per-differentiation means, or with a
// mixed model with differentiation as a random effect; 36 neurons are not
// 36 independent replicates.

distribution neurite_length {
  label: "Total neurite length"
  title: "Total neurite length at DIV 14, by genotype"
  unit: "µm"
  kind: raincloud
  jitter: true
  group wild_type {
    label: "Wild type"
    values: [
      222.8, 228.1, 266.9, 216.1, 208.6, 225.5, 178, 263.4, 164.5, 244.5, 221.4, 239.9,
      199.5, 200.4, 207.3, 215.3, 277.8, 261.3, 183.1, 216, 194.3, 160.9, 206.5, 265.6,
      336.3, 200.5, 305.8, 185.4, 208.6, 152.4, 197.9, 232.1, 179.7, 163.7, 153.6, 230.7
    ]
  }
  group knockout {
    label: "Knockout"
    values: [
      171, 112, 102.9, 128.8, 118.4, 99.9, 115.8, 204.6, 161.2, 176, 158.6, 94.1,
      96.1, 116.3, 123.7, 111, 122.8, 132.4, 189.7, 191.4, 133.2, 86.5, 131.8, 126.3,
      162.5, 106.7, 95.3, 215, 190.4, 120.8, 232.1, 128.6, 274.2, 198.7, 134.6, 98.8
    ]
  }
  group rescue {
    label: "Knockout + rescue construct"
    values: [
      313.9, 246.7, 232.9, 233.8, 222.5, 213.6, 200.6, 152.4, 176.4, 196.7, 233.7, 347.4,
      151.6, 211.8, 261.6, 311.6, 132.6, 137.3, 218.2, 170.9, 157, 250.5, 203.6, 250.8,
      199.9, 167.2, 218.7, 165.6, 176, 220.6, 139.1, 187.4, 207.6, 228.1, 215.5, 253.2
    ]
  }
}

view neurite_raincloud: raincloud(neurite_length)