Skill Tracer
Skills › Scientific Agent Skills › pathogen-variant-surveillance › surveillance-caveats.md

surveillance-caveats.md

90 lines · skills/pathogen-variant-surveillance/references/surveillance-caveats.md at 5f2bc03

Open on GitHub
1# Surveillance caveats
2
3Sequence databases reflect testing, specimen selection, sequencing, QC, submission and data-release
4processes. These are not a probability sample of infections. Interpret every number conditional
5on the database, inclusion filters, location, host, date window and lineage assignment system.
6

Surveillance caveats

Sequence databases reflect testing, specimen selection, sequencing, QC, submission and data-release processes. These are not a probability sample of infections. Interpret every number conditional on the database, inclusion filters, location, host, date window and lineage assignment system.

Raw lines 1 to 6
7## Delays do not certify completeness
8
9`reporting_lag.py` groups each monthly collection cohort jointly by collection and submission/release
10date, then computes actual date differences. Measuring from month-end underestimates individual
11collection-to-release delays by up to almost a month; the helper no longer uses that approximation.
12It excludes missing/imprecise collection dates, negative delays and dates after the analysis anchor.
14For each offset the reported CDF denominator is **currently visible, eligible records**, not all
15records that will eventually arrive. Late-arriving records can lengthen the delay distribution.
16Release dates also need not equal the first day a record was indexed by LAPIS. This is a descriptive
17conditional CDF, not nowcasting or measured completeness. No printed date makes a cohort trustworthy.
19Only cohorts with enough elapsed follow-up contribute a given offset. Cohorts receive equal weight;
20small and large cohorts count equally. The mean curve can change its contributing cohort set and
21therefore need not be monotonic, even though each individual cohort CDF is monotonic. Report the
22cohort counts, ranges and exclusion totals. `--until` selects an analysis anchor using the current
23database; it does not recreate a historical database state.
25`lineage_prevalence.py` has a separate heuristic: compare weekly counts to the older half of the
26window, flag zero-count/current partial weeks, and optionally exclude a user-selected `--lag-days`
27horizon. It does not automatically consume the lag script's output. Counts can decline because
28sequencing or incidence changed; neither a low flag nor an `ok` flag establishes actual completeness.

Delays do not certify completeness

reporting_lag.py groups each monthly collection cohort jointly by collection and submission/release date, then computes actual date differences. Measuring from month-end underestimates individual collection-to-release delays by up to almost a month; the helper no longer uses that approximation. It excludes missing/imprecise collection dates, negative delays and dates after the analysis anchor.

For each offset the reported CDF denominator is currently visible, eligible records, not all records that will eventually arrive. Late-arriving records can lengthen the delay distribution. Release dates also need not equal the first day a record was indexed by LAPIS. This is a descriptive conditional CDF, not nowcasting or measured completeness. No printed date makes a cohort trustworthy.

Only cohorts with enough elapsed follow-up contribute a given offset. Cohorts receive equal weight; small and large cohorts count equally. The mean curve can change its contributing cohort set and therefore need not be monotonic, even though each individual cohort CDF is monotonic. Report the cohort counts, ranges and exclusion totals. --until selects an analysis anchor using the current database; it does not recreate a historical database state.

lineage_prevalence.py has a separate heuristic: compare weekly counts to the older half of the window, flag zero-count/current partial weeks, and optionally exclude a user-selected --lag-days horizon. It does not automatically consume the lag script's output. Counts can decline because sequencing or incidence changed; neither a low flag nor an ok flag establishes actual completeness.

Raw lines 7 to 29
30## Date precision and denominators
32- Range-lower and range-upper collection fields must agree before weekly/date-delay binning. A
33 year-only or month-only collection date cannot be assigned to a unique week. Report exclusions;
34 retained exact dates may be a biased subset. Declared date types do not prove metadata accuracy.
35- Range filters can already omit null collection dates. Exclusion counts among returned records
36 are not estimates of all undated records in the source database.
37- On Loculus deployments, default to `versionStatus=LATEST_VERSION` and `isRevocation=false` when
38 available, to avoid counting historical revisions as different specimens. OPEN data defaults
39 impose an additional inclusion condition. The remaining records may still include duplicated
40 specimens across accessions/sources; accession version filtering is not biological deduplication.
41- Exact labels and descendant-inclusive labels answer different questions. Nested lineage queries
42 overlap, and overlapping categories cannot be added to form a prevalence total.
43- Null/empty lineage calls stay in the denominator but are not discovered as named lineages.
44 A literal `unassigned` value is retained as a category. Unknown names returning zero are not
45 evidence of absence, particularly on unindexed fields.
46- A widened ISO-week window changes the requested date boundaries. The output reports the actual
47 window. A future week endpoint is only a bin boundary, not future observations.

Date precision and denominators

  • Range-lower and range-upper collection fields must agree before weekly/date-delay binning. A year-only or month-only collection date cannot be assigned to a unique week. Report exclusions; retained exact dates may be a biased subset. Declared date types do not prove metadata accuracy.
  • Range filters can already omit null collection dates. Exclusion counts among returned records are not estimates of all undated records in the source database.
  • On Loculus deployments, default to versionStatus=LATEST_VERSION and isRevocation=false when available, to avoid counting historical revisions as different specimens. OPEN data defaults impose an additional inclusion condition. The remaining records may still include duplicated specimens across accessions/sources; accession version filtering is not biological deduplication.
  • Exact labels and descendant-inclusive labels answer different questions. Nested lineage queries overlap, and overlapping categories cannot be added to form a prevalence total.
  • Null/empty lineage calls stay in the denominator but are not discovered as named lineages. A literal unassigned value is retained as a category. Unknown names returning zero are not evidence of absence, particularly on unindexed fields.
  • A widened ISO-week window changes the requested date boundaries. The output reports the actual window. A future week endpoint is only a bin boundary, not future observations.
Raw lines 30 to 48
49## Sampling and scientific interpretation
51Sequencing priorities can target travelers, hospitals, outbreaks, unusual assay results or a
52random subset. Capacity and reporting delay vary geographically and institutionally. Host filters
53matter for animal pathogens; pooled human/animal records need an explicit scientific justification.
54QC failures and missing metadata can themselves depend on lineage and assay performance.
56Report "share of selected submitted sequences" rather than "share of infections". Open GenBank,
57Pathoplexus and GISAID-derived datasets can differ in coverage, geography, dates, pipelines and
58terms. Do not assume strict set inclusion or comparable proportions; compare harmonized cohorts
59and document differences before combining sources.
61Wilson intervals quantify binomial sampling uncertainty, not reporting bias, clustering, missingness,
62or lineage-assignment error. Interval overlap alone is not a formal test of a difference.
64The optional growth calculation is weighted least squares of continuity-corrected log odds, with
65weights `n*p*(1-p)`. At least five observations in three nonempty weeks are required. Dispersion
66is floored at one to prevent an unusually straight short series from claiming excess precision.
67It is an approximate descriptive slope among sequenced records, not a mechanistic fitness,
68transmissibility, immune-escape or severity estimate. Changing denominator composition and
69sequencing practice can generate the same pattern.

Sampling and scientific interpretation

Sequencing priorities can target travelers, hospitals, outbreaks, unusual assay results or a random subset. Capacity and reporting delay vary geographically and institutionally. Host filters matter for animal pathogens; pooled human/animal records need an explicit scientific justification. QC failures and missing metadata can themselves depend on lineage and assay performance.

Report "share of selected submitted sequences" rather than "share of infections". Open GenBank, Pathoplexus and GISAID-derived datasets can differ in coverage, geography, dates, pipelines and terms. Do not assume strict set inclusion or comparable proportions; compare harmonized cohorts and document differences before combining sources.

Wilson intervals quantify binomial sampling uncertainty, not reporting bias, clustering, missingness, or lineage-assignment error. Interval overlap alone is not a formal test of a difference.

The optional growth calculation is weighted least squares of continuity-corrected log odds, with weights n*p*(1-p). At least five observations in three nonempty weeks are required. Dispersion is floored at one to prevent an unusually straight short series from claiming excess precision. It is an approximate descriptive slope among sequenced records, not a mechanistic fitness, transmissibility, immune-escape or severity estimate. Changing denominator composition and sequencing practice can generate the same pattern.

Raw lines 49 to 70
71## Mutation interpretation
73A mutation proportion divides by per-site callable sequence coverage, not total matching records
74or read depth. Report both count and coverage. Missing mutation rows cannot supply a zero count
75with known coverage; comparison output preserves missingness. Above/below-threshold status is not
76a demonstrated ancestral gain/loss. Site-wise frequencies do not establish joint haplotypes,
77full assay-binding sequences, phenotypes or experimental sensitivity. Insertions are separate.

Mutation interpretation

A mutation proportion divides by per-site callable sequence coverage, not total matching records or read depth. Report both count and coverage. Missing mutation rows cannot supply a zero count with known coverage; comparison output preserves missingness. Above/below-threshold status is not a demonstrated ancestral gain/loss. Site-wise frequencies do not establish joint haplotypes, full assay-binding sequences, phenotypes or experimental sensitivity. Insertions are separate.

Raw lines 71 to 78
79## Reproducibility
81Compare response `dataVersion` values before combining results; a changing snapshot invalidates the
82run. LAPIS generally keeps only the latest data. Archive responses and request parameters, schemas,
83reference/nomenclature versions, retrieval dates, processing code and inclusion decisions for
84replay. A snapshot identifier alone cannot retrieve an old result.
86Relevant primary documentation:
87[response data versions](https://lapis.cov-spectrum.org/open/v2/docs/concepts/data-versions),
88[mutation filters](https://lapis.cov-spectrum.org/open/v2/docs/concepts/mutation-filters/),
89[Pathoplexus accessions and versions](https://pathoplexus.org/docs/how-to/search-download-seqs-api),
90[WHO variant tracking](https://www.who.int/activities/tracking-SARS-CoV-2-variants).

Reproducibility

Compare response dataVersion values before combining results; a changing snapshot invalidates the run. LAPIS generally keeps only the latest data. Archive responses and request parameters, schemas, reference/nomenclature versions, retrieval dates, processing code and inclusion decisions for replay. A snapshot identifier alone cannot retrieve an old result.

Relevant primary documentation: response data versions, mutation filters, Pathoplexus accessions and versions, WHO variant tracking.

Raw lines 79 to 90