flowcellar 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flowcellar/__init__.py +9 -0
- flowcellar/__main__.py +4 -0
- flowcellar/_version.py +1 -0
- flowcellar/aggregates/__init__.py +11 -0
- flowcellar/aggregates/build.py +151 -0
- flowcellar/aggregates/derive.py +109 -0
- flowcellar/aggregates/merge.py +362 -0
- flowcellar/catalogue/__init__.py +63 -0
- flowcellar/catalogue/metrics_nanopore.json +1 -0
- flowcellar/cli/__init__.py +97 -0
- flowcellar/cli/_options.py +25 -0
- flowcellar/cli/analysis.py +317 -0
- flowcellar/cli/discover.py +168 -0
- flowcellar/cli/doctor.py +31 -0
- flowcellar/cli/hub.py +47 -0
- flowcellar/cli/init.py +41 -0
- flowcellar/cli/ls.py +94 -0
- flowcellar/cli/recompute.py +52 -0
- flowcellar/cli/rm.py +21 -0
- flowcellar/cli/run.py +333 -0
- flowcellar/cli/scan.py +60 -0
- flowcellar/cli/schema.py +25 -0
- flowcellar/cli/serve.py +46 -0
- flowcellar/cli/show.py +109 -0
- flowcellar/cli/validate.py +44 -0
- flowcellar/config/__init__.py +4 -0
- flowcellar/config/defaults.toml +51 -0
- flowcellar/config/loader.py +369 -0
- flowcellar/contracts.py +159 -0
- flowcellar/discovery/__init__.py +141 -0
- flowcellar/discovery/guard.py +208 -0
- flowcellar/discovery/patterns.py +209 -0
- flowcellar/discovery/walk.py +348 -0
- flowcellar/engine/__init__.py +1 -0
- flowcellar/engine/api.py +119 -0
- flowcellar/engine/assemble.py +363 -0
- flowcellar/engine/baselines.py +128 -0
- flowcellar/engine/card.py +250 -0
- flowcellar/engine/copy_pending.py +110 -0
- flowcellar/engine/flowcell_use.py +85 -0
- flowcellar/engine/identity.py +351 -0
- flowcellar/engine/limits.py +135 -0
- flowcellar/engine/passes.py +213 -0
- flowcellar/engine/status.py +728 -0
- flowcellar/library/__init__.py +4 -0
- flowcellar/library/api.py +61 -0
- flowcellar/library/cards.py +69 -0
- flowcellar/library/draft.py +247 -0
- flowcellar/library/index.py +323 -0
- flowcellar/library/layout.py +69 -0
- flowcellar/library/lease.py +248 -0
- flowcellar/library/maintain.py +347 -0
- flowcellar/library/projects.py +84 -0
- flowcellar/library/query.py +382 -0
- flowcellar/library/scan.py +1770 -0
- flowcellar/library/store.py +225 -0
- flowcellar/library/trash.py +63 -0
- flowcellar/model/__init__.py +1 -0
- flowcellar/model/axes.py +200 -0
- flowcellar/model/bundle.py +143 -0
- flowcellar/model/partial.py +96 -0
- flowcellar/model/runfolder.py +83 -0
- flowcellar/model/runkey.py +98 -0
- flowcellar/model/schema.py +46 -0
- flowcellar/model/schemas/bundle-0.1.1.schema.json +3713 -0
- flowcellar/model/status.py +97 -0
- flowcellar/modules/__init__.py +0 -0
- flowcellar/modules/common.py +73 -0
- flowcellar/modules/dyn.py +124 -0
- flowcellar/modules/fc.py +390 -0
- flowcellar/modules/len_est.py +74 -0
- flowcellar/modules/run.py +88 -0
- flowcellar/modules/yield_.py +120 -0
- flowcellar/readdata/__init__.py +1 -0
- flowcellar/readdata/_pool.py +87 -0
- flowcellar/readdata/acc.py +161 -0
- flowcellar/readdata/alnacc.py +572 -0
- flowcellar/readdata/alnpass.py +85 -0
- flowcellar/readdata/api.py +189 -0
- flowcellar/readdata/bam.py +851 -0
- flowcellar/readdata/bamindex.py +149 -0
- flowcellar/readdata/cards.py +82 -0
- flowcellar/readdata/checks.py +312 -0
- flowcellar/readdata/copy_pending.py +73 -0
- flowcellar/readdata/fate.py +341 -0
- flowcellar/readdata/finder.py +147 -0
- flowcellar/readdata/libprep.py +97 -0
- flowcellar/readdata/link.py +486 -0
- flowcellar/readdata/passes.py +149 -0
- flowcellar/readdata/patterns.py +230 -0
- flowcellar/readdata/pychopper.py +431 -0
- flowcellar/readdata/readtable.py +416 -0
- flowcellar/readdata/record.py +159 -0
- flowcellar/readdata/reference.py +139 -0
- flowcellar/readdata/rnacomp.py +329 -0
- flowcellar/readdata/sample_sheet.py +153 -0
- flowcellar/readdata/saturation.py +110 -0
- flowcellar/readdata/sections.py +892 -0
- flowcellar/readdata/sections_align.py +644 -0
- flowcellar/readdata/tables.py +262 -0
- flowcellar/report/__init__.py +1 -0
- flowcellar/report/api.py +54 -0
- flowcellar/report/html.py +342 -0
- flowcellar/report/hub.py +159 -0
- flowcellar/report/index_one.py +144 -0
- flowcellar/report/served.py +67 -0
- flowcellar/sc/__init__.py +57 -0
- flowcellar/sc/axes.py +211 -0
- flowcellar/sc/catalogue.json +1 -0
- flowcellar/sc/catalogue.py +51 -0
- flowcellar/sc/check.py +57 -0
- flowcellar/sc/collect.py +299 -0
- flowcellar/sc/collect_sr.py +450 -0
- flowcellar/sc/collect_wf.py +479 -0
- flowcellar/sc/detect.py +303 -0
- flowcellar/sc/judge.py +269 -0
- flowcellar/sc/link.py +326 -0
- flowcellar/sc/listing.py +144 -0
- flowcellar/sc/maps.py +181 -0
- flowcellar/sc/readpass.py +416 -0
- flowcellar/sc/report.py +230 -0
- flowcellar/sc/scan.py +176 -0
- flowcellar/sc/spaceranger.py +483 -0
- flowcellar/sc/store.py +537 -0
- flowcellar/sc/wfsc.py +419 -0
- flowcellar/serve/__init__.py +4 -0
- flowcellar/serve/server.py +153 -0
- flowcellar/sources/__init__.py +0 -0
- flowcellar/sources/minknow.py +455 -0
- flowcellar/sources/porescan.py +218 -0
- flowcellar/sources/seqsummary.py +450 -0
- flowcellar/sources/workers.py +244 -0
- flowcellar/testing/__init__.py +1 -0
- flowcellar/testing/demo.py +1217 -0
- flowcellar/testing/demo_spatial.py +370 -0
- flowcellar/testing/fixtures.py +459 -0
- flowcellar/testing/libprep.py +252 -0
- flowcellar/testing/minknow_variants.py +384 -0
- flowcellar/testing/readdata.py +744 -0
- flowcellar/testing/sc.py +817 -0
- flowcellar/testing/trees.py +175 -0
- flowcellar/util/__init__.py +1 -0
- flowcellar/util/atomic.py +112 -0
- flowcellar/util/errors.py +72 -0
- flowcellar/util/fingerprint.py +49 -0
- flowcellar/util/log.py +50 -0
- flowcellar/util/text.py +43 -0
- flowcellar/util/timeutil.py +52 -0
- flowcellar/viewer_dist/favicon.svg +1 -0
- flowcellar/viewer_dist/manifest.json +37 -0
- flowcellar/viewer_dist/template.html +12 -0
- flowcellar/viewer_dist/viewer.core.js +3 -0
- flowcellar/viewer_dist/viewer.css +2151 -0
- flowcellar-0.1.0.dist-info/METADATA +506 -0
- flowcellar-0.1.0.dist-info/RECORD +159 -0
- flowcellar-0.1.0.dist-info/WHEEL +4 -0
- flowcellar-0.1.0.dist-info/entry_points.txt +2 -0
- flowcellar-0.1.0.dist-info/licenses/LICENSE +674 -0
- flowcellar-0.1.0.dist-info/licenses/THIRD_PARTY_NOTICES.md +85 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""The metric catalogue: ids, sections, limits, display copy, the panel registry and the tile order.
|
|
2
|
+
|
|
3
|
+
The source is ``catalogue/metrics_nanopore.yaml`` in the repository; ``tools/build_catalogue.py`` writes the JSON
|
|
4
|
+
beside this file, and only that JSON is read at run time (no YAML parser is a run-time dependency).
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import json
|
|
9
|
+
from functools import lru_cache
|
|
10
|
+
from importlib import resources
|
|
11
|
+
|
|
12
|
+
CATALOGUE_FILE = "metrics_nanopore.json"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@lru_cache(maxsize=1)
|
|
16
|
+
def load() -> dict:
|
|
17
|
+
"""The whole catalogue as one dict (keys: metrics, derived, panels, tiles, limit_text, axes, modules, ...)."""
|
|
18
|
+
return json.loads(resources.files(__name__).joinpath(CATALOGUE_FILE).read_text("utf-8"))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@lru_cache(maxsize=1)
|
|
22
|
+
def metrics() -> dict[str, dict]:
|
|
23
|
+
"""Every metric and derived summary id -> its entry."""
|
|
24
|
+
cat = load()
|
|
25
|
+
out = {m["id"]: m for m in cat["metrics"]}
|
|
26
|
+
out.update({d["id"]: d for d in cat.get("derived", [])})
|
|
27
|
+
return out
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def metric(metric_id: str) -> dict | None:
|
|
31
|
+
return metrics().get(metric_id)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def display(metric_id: str) -> dict:
|
|
35
|
+
"""The display copy of a metric (label, short_label, reading, message, advice, panel); empty when it has none."""
|
|
36
|
+
m = metrics().get(metric_id) or {}
|
|
37
|
+
return m.get("display") or {}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def label(metric_id: str) -> str:
|
|
41
|
+
return display(metric_id).get("label") or metric_id
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def checks(tier: int | None = None) -> list[dict]:
|
|
45
|
+
"""The key and supporting metrics (the ones a status rule exists for), optionally of one tier."""
|
|
46
|
+
return [m for m in load()["metrics"]
|
|
47
|
+
if m.get("verdict_role") in ("key", "supporting") and (tier is None or m.get("tier") == tier)]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def limit_text() -> dict[str, str]:
|
|
51
|
+
return load()["limit_text"]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def panels() -> list[dict]:
|
|
55
|
+
return load()["panels"]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def tiles() -> dict[str, list[str]]:
|
|
59
|
+
return load()["tiles"]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def version() -> str:
|
|
63
|
+
return str(load().get("catalogue_version", "0"))
|