strsc 0.4.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.
- strsc/__init__.py +15 -0
- strsc/__main__.py +30 -0
- strsc/api.py +1232 -0
- strsc/cell_biology.py +241 -0
- strsc/cell_core.py +420 -0
- strsc/cell_prepare.py +223 -0
- strsc/cell_rna.py +274 -0
- strsc/cell_score.py +361 -0
- strsc/evaluation_export.py +288 -0
- strsc/example.py +69 -0
- strsc/export.py +119 -0
- strsc/files.py +757 -0
- strsc/fourier.py +271 -0
- strsc/her2.py +303 -0
- strsc/her2_core.py +958 -0
- strsc/hest.py +246 -0
- strsc/hest_core.py +289 -0
- strsc/rsc_cli.py +101 -0
- strsc/training/__init__.py +5 -0
- strsc/training/adapters/__init__.py +0 -0
- strsc/training/adapters/deepspot2cell/__init__.py +40 -0
- strsc/training/adapters/deepspot2cell/engineering_gate.py +239 -0
- strsc/training/adapters/deepspot2cell/formal_runner.py +254 -0
- strsc/training/adapters/deepspot2cell/graph.py +228 -0
- strsc/training/adapters/deepspot2cell/initialization.py +36 -0
- strsc/training/adapters/deepspot2cell/objective.py +212 -0
- strsc/training/adapters/deepspot2cell/overlay.py +79 -0
- strsc/training/adapters/deepspot2cell/paired_data.py +229 -0
- strsc/training/adapters/hest_deephis2exp/__init__.py +48 -0
- strsc/training/adapters/hest_deephis2exp/batching.py +730 -0
- strsc/training/adapters/hest_deephis2exp/data.py +448 -0
- strsc/training/adapters/hest_deephis2exp/engineering_gate.py +312 -0
- strsc/training/adapters/hest_deephis2exp/export.py +173 -0
- strsc/training/adapters/hest_deephis2exp/formal_runner.py +480 -0
- strsc/training/adapters/hest_deephis2exp/models.py +95 -0
- strsc/training/adapters/hest_deephis2exp/objective.py +492 -0
- strsc/training/adapters/hest_deephis2exp/overlay.py +141 -0
- strsc/training/adapters/hest_deephis2exp/split.py +80 -0
- strsc/training/adapters/hest_deepspot_hist/__init__.py +62 -0
- strsc/training/adapters/hest_deepspot_hist/contract.py +136 -0
- strsc/training/adapters/hest_deepspot_hist/data.py +746 -0
- strsc/training/adapters/hest_deepspot_hist/deepspot.py +162 -0
- strsc/training/adapters/hest_deepspot_hist/engineering_gate.py +498 -0
- strsc/training/adapters/hest_deepspot_hist/formal_runner.py +1003 -0
- strsc/training/adapters/hest_deepspot_hist/hist.py +164 -0
- strsc/training/adapters/hest_deepspot_hist/manifest.py +108 -0
- strsc/training/adapters/hest_deepspot_hist/objective.py +94 -0
- strsc/training/adapters/hest_deepspot_hist/outputs.py +154 -0
- strsc/training/adapters/hest_deepspot_hist/paired.py +54 -0
- strsc/training/adapters/hest_egn_tcgn/__init__.py +27 -0
- strsc/training/adapters/hest_egn_tcgn/contracts.py +124 -0
- strsc/training/adapters/hest_egn_tcgn/engineering_gate.py +729 -0
- strsc/training/adapters/hest_egn_tcgn/exemplars.py +241 -0
- strsc/training/adapters/hest_egn_tcgn/hest_data.py +448 -0
- strsc/training/adapters/hest_egn_tcgn/model_inputs.py +139 -0
- strsc/training/adapters/hest_egn_tcgn/outputs.py +137 -0
- strsc/training/adapters/hest_egn_tcgn/overlay.py +388 -0
- strsc/training/adapters/hest_egn_tcgn/pairing.py +66 -0
- strsc/training/adapters/hest_egn_tcgn/train_pair.py +458 -0
- strsc/training/adapters/hest_egn_tcgn/training.py +750 -0
- strsc/training/adapters/hest_egn_tcgn/upstream.py +345 -0
- strsc/training/adapters/hest_thitogene/__init__.py +15 -0
- strsc/training/adapters/hest_thitogene/engineering_gate.py +270 -0
- strsc/training/adapters/hest_thitogene/hest_data.py +396 -0
- strsc/training/adapters/hest_thitogene/overlay.py +260 -0
- strsc/training/adapters/hest_thitogene/train_pair.py +584 -0
- strsc/training/adapters/hest_thitogene/upstream.py +336 -0
- strsc/training/adapters/ridge_mlp/__init__.py +6 -0
- strsc/training/adapters/ridge_mlp/hest_contract.py +135 -0
- strsc/training/adapters/ridge_mlp/model.py +23 -0
- strsc/training/adapters/ridge_mlp/ridge.py +55 -0
- strsc/training/adapters/ridge_mlp/train_pair.py +621 -0
- strsc/training/adapters/scellst/__init__.py +42 -0
- strsc/training/adapters/scellst/data.py +279 -0
- strsc/training/adapters/scellst/engineering_gate.py +148 -0
- strsc/training/adapters/scellst/formal_runner.py +311 -0
- strsc/training/adapters/scellst/lightning_overlay.py +148 -0
- strsc/training/adapters/scellst/objective.py +87 -0
- strsc/training/adapters/scellst/runtime.py +416 -0
- strsc/training/adapters/scellst/split.py +232 -0
- strsc/training/hest_data.py +413 -0
- strsc/training/non_neighbours.py +256 -0
- strsc/training/shared/__init__.py +25 -0
- strsc/training/shared/adjacency.py +169 -0
- strsc/training/shared/losses.py +92 -0
- strsc/training/shared/noop.py +102 -0
- strsc-0.4.0.dist-info/METADATA +173 -0
- strsc-0.4.0.dist-info/RECORD +93 -0
- strsc-0.4.0.dist-info/WHEEL +5 -0
- strsc-0.4.0.dist-info/entry_points.txt +2 -0
- strsc-0.4.0.dist-info/licenses/LICENSE +21 -0
- strsc-0.4.0.dist-info/licenses/NOTICE.md +13 -0
- strsc-0.4.0.dist-info/top_level.txt +1 -0
strsc/__init__.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Reproducible-signal correlation (RSC) for spatial transcriptomics predicted from histology.
|
|
2
|
+
|
|
3
|
+
import strsc
|
|
4
|
+
counts = strsc.read_counts("sample.h5ad")
|
|
5
|
+
result = strsc.rsc(counts, {"my_model": "predictions.csv"}, layout="spots")
|
|
6
|
+
print(result.scales)
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = "0.4.0"
|
|
10
|
+
|
|
11
|
+
from .files import Counts, InputError, Prediction, read_counts, read_files, read_predictions # noqa: E402
|
|
12
|
+
from .api import Result, ideal_check, regions, rsc # noqa: E402
|
|
13
|
+
|
|
14
|
+
__all__ = ["Counts", "InputError", "Prediction", "Result", "ideal_check", "read_counts", "read_files",
|
|
15
|
+
"read_predictions", "regions", "rsc", "__version__"]
|
strsc/__main__.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""Command-line entry point."""
|
|
2
|
+
import argparse
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
parser = argparse.ArgumentParser(prog="strsc")
|
|
8
|
+
parser.add_argument("command", choices=["rsc", "hest", "her2", "fourier", "export", "export-results", "example"])
|
|
9
|
+
args = parser.parse_args(sys.argv[1:2])
|
|
10
|
+
remaining = sys.argv[2:]
|
|
11
|
+
sys.argv = [f"strsc {args.command}", *remaining]
|
|
12
|
+
if args.command == "rsc":
|
|
13
|
+
from .rsc_cli import main as run
|
|
14
|
+
elif args.command == "hest":
|
|
15
|
+
from .hest import main as run
|
|
16
|
+
elif args.command == "export":
|
|
17
|
+
from .export import main as run
|
|
18
|
+
elif args.command == "export-results":
|
|
19
|
+
from .evaluation_export import main as run
|
|
20
|
+
elif args.command == "her2":
|
|
21
|
+
from .her2 import main as run
|
|
22
|
+
elif args.command == "fourier":
|
|
23
|
+
from .fourier import main as run
|
|
24
|
+
else:
|
|
25
|
+
from .example import main as run
|
|
26
|
+
return run()
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if __name__ == "__main__":
|
|
30
|
+
raise SystemExit(main())
|