Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
sweepLink documentation
Light Logo Dark Logo

Getting Started

  • Installation
  • Tutorial
    • Step 1: Preparing the Input
    • Step 2: Inference
    • Step 3: Results
    • Step 4: Refining
  • Using your own data

User Manual

  • How it works
  • sweepLink tasks
    • Inference
    • Simulation
    • Likelihood surfaces
  • Companion scripts
    • sweeplink-vcf2input
    • sweeplink-extract
    • sweeplink-plot
    • sweeplink-plot-posteriors
  • File formats
  • FAQ
Back to top

sweeplink-plot-posteriors¶

Violin plot of the posterior of the effective population size, and optionally of the other global parameters.

$ sweeplink-plot-posteriors --prefix doc

Writes doc_posteriors.png. A single number can only say so much about a skewed distribution; this shows the whole shape, which is the quickest way to see how much the data actually pin N down.

Input¶

--prefix / --dirs + --run-name

The run(s) to read. See combining several runs. Every MCMC sample from every run goes into one pooled bucket.

What to plot¶

--params <name> [<name> ...]

Extra parameters to show alongside N, one panel each. Choose from kappa, nu, mu, betaMean, betaESS. Off by default — most analyses only want N.

A parameter the run held fixed is skipped automatically with a note saying why: kappa, nu and mu are the linkage model’s own transition parameters and mean nothing under --linkage false; betaMean and betaESS only exist if --forwardPrior or --newMutPrior was beta.

--linear

Plot N on a linear scale. The default is log10, which is what the chain actually samples and the scale on which the posterior is roughly symmetric — on a linear axis the long right tail makes the bulk unreadable.

--per-chromosome

Also draw each run’s own violin beside the pooled one. Default is the pooled bucket alone. With one run per chromosome this is a quick check of whether they agree — genuine disagreement shows up as violins that do not overlap.

Output¶

--out <file>

Where to write. Default <prefix>_posteriors.png.

--theme <light|dark>, --title <text>, --dpi <n>

As for sweeplink-plot.

Reading it¶

Each violin carries a boxplot inside it, so the shape and the numbers are in one place:

Mark

Meaning

Horizontal line

median

Open circle

mean

Shaded box

interquartile range (25th–75th)

Thin vertical line

central 95% (2.5th–97.5th)

The violin itself spans the full range of the samples, tails included, so a long spike upward is real and not a rendering artefact.

The printed summary¶

The same numbers are printed, which is usually what ends up quoted:

$ sweeplink-plot-posteriors --prefix doc
  N:
    Pop1         82,899  [10**mean(log10 N)]
      median 58,653   IQR 27,781 - 175,700   95% 10,884 - 3,816,212
      range  4,821 - 265,842,000   sd 0.6618 (on log10)   n = 10,000

N is summarised on the linear scale even though it is sampled and drawn on log10, because that is the scale it is reported on. The headline figure is 10^mean(log10 N) — the same value sweeplink-extract fixes the second round at, so the two always agree. The standard deviation stays on the log10 scale, where it is meaningful.

The gap between the mean and the median here is the skew made concrete: 82,899 against 58,653, with a tail reaching 265 million.

Note

The median shown here and the N that sweeplink-extract suggests for round 2 are different summaries and will not match exactly — the latter is 10^mean(log10N). Both describe where the bulk of the mass sits; neither is the arithmetic mean of N, which sits far out in the tail.

Next
File formats
Previous
sweeplink-plot
Copyright © 2024, Ekaterina Noskova
Made with Sphinx and @pradyunsg's Furo
On this page
  • sweeplink-plot-posteriors
    • Input
    • What to plot
    • Output
    • Reading it
    • The printed summary