hca-schema-validator 0.2.0__tar.gz

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.
Files changed (55) hide show
  1. hca_schema_validator-0.2.0/NOTICE +15 -0
  2. hca_schema_validator-0.2.0/PKG-INFO +116 -0
  3. hca_schema_validator-0.2.0/README.md +80 -0
  4. hca_schema_validator-0.2.0/pyproject.toml +36 -0
  5. hca_schema_validator-0.2.0/src/hca_schema_validator/__init__.py +11 -0
  6. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/__init__.py +18 -0
  7. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/LICENSE +20 -0
  8. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/__init__.py +1 -0
  9. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/atac_seq.py +675 -0
  10. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/cli.py +206 -0
  11. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/env.py +9 -0
  12. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode.py +163 -0
  13. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/.gitignore +3 -0
  14. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/drosophila_melanogaster_diff.txt +42 -0
  15. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/gene_info.md +29 -0
  16. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/gene_info.yml +51 -0
  17. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_caenorhabditis_elegans.csv.gz +0 -0
  18. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_callithrix_jacchus.csv.gz +0 -0
  19. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_danio_rerio.csv.gz +0 -0
  20. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_drosophila_melanogaster.csv.gz +0 -0
  21. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_ercc.csv.gz +0 -0
  22. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_gorilla_gorilla.csv.gz +0 -0
  23. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_homo_sapiens.csv.gz +0 -0
  24. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_macaca_fascicularis.csv.gz +0 -0
  25. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_macaca_mulatta.csv.gz +0 -0
  26. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_microcebus_murinus.csv.gz +0 -0
  27. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_mus_musculus.csv.gz +0 -0
  28. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_oryctolagus_cuniculus.csv.gz +0 -0
  29. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_pan_troglodytes.csv.gz +0 -0
  30. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_rattus_norvegicus.csv.gz +0 -0
  31. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_sars_cov_2.csv.gz +0 -0
  32. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/genes_sus_scrofa.csv.gz +0 -0
  33. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/homo_sapiens_diff.txt +1237 -0
  34. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/mus_musculus_diff.txt +549 -0
  35. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/gencode_files/rattus_norvegicus_diff.txt +7306 -0
  36. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/map_species.py +40 -0
  37. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/matrix_utils.py +134 -0
  38. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/migrate.py +145 -0
  39. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/migrate_files/automigrate_terms.json +2 -0
  40. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/migrate_files/donor_updates.json +2 -0
  41. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/migrate_files/non_csr_list.txt +54 -0
  42. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/migrate_files/private_non_csr.json +1 -0
  43. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/migrate_files/title_donor_updates.json +2 -0
  44. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/ontology_files/.gitignore +1 -0
  45. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/ontology_parser.py +3 -0
  46. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/remove_labels.py +74 -0
  47. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/schema.py +21 -0
  48. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/schema_definitions/schema_definition.yaml +841 -0
  49. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/utils.py +242 -0
  50. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/validate.py +2389 -0
  51. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/validation_internals/__init__.py +0 -0
  52. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/validation_internals/check_duplicates.py +87 -0
  53. hca_schema_validator-0.2.0/src/hca_schema_validator/_vendored/cellxgene_schema/write_labels.py +403 -0
  54. hca_schema_validator-0.2.0/src/hca_schema_validator/schema_definitions/hca_schema_definition.yaml +839 -0
  55. hca_schema_validator-0.2.0/src/hca_schema_validator/validator.py +47 -0
@@ -0,0 +1,15 @@
1
+ hca-schema-validator
2
+ Copyright (c) 2025 Human Cell Atlas
3
+
4
+ This software contains vendored code from:
5
+
6
+ cellxgene-schema
7
+ Copyright (c) 2021 Chan Zuckerberg Initiative
8
+ Licensed under the MIT License
9
+ Source: https://github.com/chanzuckerberg/single-cell-curation
10
+
11
+ The vendored code has been modified to support HCA-specific validation requirements.
12
+ All modifications are licensed under the same MIT License as the original work.
13
+
14
+ The full license text for the vendored code can be found at:
15
+ src/hca_schema_validator/_vendored/cellxgene_schema/LICENSE
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: hca-schema-validator
3
+ Version: 0.2.0
4
+ Summary: HCA schema validation for single-cell datasets
5
+ License: MIT
6
+ License-File: NOTICE
7
+ Author: Clever Canary
8
+ Author-email: dave@clevercanary.com
9
+ Requires-Python: >=3.10,<4.0
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Requires-Dist: anndata (>=0.11.0,<0.12)
18
+ Requires-Dist: cellxgene-ontology-guide (>=1.9.0,<2.0)
19
+ Requires-Dist: click (<9)
20
+ Requires-Dist: dask[array,dataframe] (>=2024.0.0)
21
+ Requires-Dist: duckdb (>=1.3.0,<1.4)
22
+ Requires-Dist: ibis-framework[duckdb] (>=10.3)
23
+ Requires-Dist: matplotlib (<4)
24
+ Requires-Dist: numpy (<3)
25
+ Requires-Dist: pandas (>2,<3)
26
+ Requires-Dist: pyarrow (>=19)
27
+ Requires-Dist: pysam (>=0.13.0)
28
+ Requires-Dist: pyyaml (<7)
29
+ Requires-Dist: scipy (<1.16)
30
+ Requires-Dist: semver (<4)
31
+ Requires-Dist: sparse (>=0.15.0,<0.16)
32
+ Requires-Dist: xxhash (<4)
33
+ Project-URL: Homepage, https://github.com/clevercanary/hca-validation-tools
34
+ Description-Content-Type: text/markdown
35
+
36
+ # HCA Schema Validator
37
+
38
+ HCA-specific extensions for cellxgene schema validation.
39
+
40
+ ## Installation
41
+
42
+ ### From PyPI (Recommended)
43
+
44
+ ```bash
45
+ pip install hca-schema-validator
46
+ ```
47
+
48
+ ### From Source (Development)
49
+
50
+ ```bash
51
+ # Clone the repository
52
+ git clone https://github.com/clevercanary/hca-validation-tools.git
53
+ cd hca-validation-tools/packages/hca-schema-validator
54
+
55
+ # Install Poetry if you haven't already
56
+ curl -sSL https://install.python-poetry.org | python3 -
57
+
58
+ # Install dependencies and package
59
+ poetry install
60
+
61
+ # Run tests
62
+ poetry run pytest tests/
63
+ ```
64
+
65
+ ## Usage
66
+
67
+ ```python
68
+ from hca_schema_validator import HCAValidator
69
+
70
+ # Create validator instance
71
+ validator = HCAValidator()
72
+
73
+ # Validate an h5ad file
74
+ is_valid = validator.validate_adata("path/to/file.h5ad")
75
+
76
+ # Check results
77
+ if is_valid:
78
+ print("✅ Validation passed!")
79
+ else:
80
+ print("❌ Validation failed:")
81
+ for error in validator.errors:
82
+ print(f" - {error}")
83
+ ```
84
+
85
+ ## Development Status
86
+
87
+ **Current Version: 0.1.0** - Minimal passthrough implementation
88
+
89
+ Currently a passthrough wrapper around cellxgene-schema Validator.
90
+ HCA-specific validation rules will be added incrementally.
91
+
92
+ ## Testing
93
+
94
+ ```bash
95
+ cd hca_schema_validator
96
+ poetry run pytest tests/
97
+ ```
98
+
99
+ ## Project Structure
100
+
101
+ ```
102
+ hca_schema_validator/
103
+ ├── src/
104
+ │ └── hca_schema_validator/
105
+ │ ├── __init__.py # Package exports
106
+ │ └── validator.py # HCAValidator class
107
+ ├── tests/
108
+ │ └── test_validator.py # Unit tests
109
+ ├── pyproject.toml # Poetry configuration & dependencies
110
+ └── README.md # This file
111
+ ```
112
+
113
+ ## License
114
+
115
+ MIT
116
+
@@ -0,0 +1,80 @@
1
+ # HCA Schema Validator
2
+
3
+ HCA-specific extensions for cellxgene schema validation.
4
+
5
+ ## Installation
6
+
7
+ ### From PyPI (Recommended)
8
+
9
+ ```bash
10
+ pip install hca-schema-validator
11
+ ```
12
+
13
+ ### From Source (Development)
14
+
15
+ ```bash
16
+ # Clone the repository
17
+ git clone https://github.com/clevercanary/hca-validation-tools.git
18
+ cd hca-validation-tools/packages/hca-schema-validator
19
+
20
+ # Install Poetry if you haven't already
21
+ curl -sSL https://install.python-poetry.org | python3 -
22
+
23
+ # Install dependencies and package
24
+ poetry install
25
+
26
+ # Run tests
27
+ poetry run pytest tests/
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```python
33
+ from hca_schema_validator import HCAValidator
34
+
35
+ # Create validator instance
36
+ validator = HCAValidator()
37
+
38
+ # Validate an h5ad file
39
+ is_valid = validator.validate_adata("path/to/file.h5ad")
40
+
41
+ # Check results
42
+ if is_valid:
43
+ print("✅ Validation passed!")
44
+ else:
45
+ print("❌ Validation failed:")
46
+ for error in validator.errors:
47
+ print(f" - {error}")
48
+ ```
49
+
50
+ ## Development Status
51
+
52
+ **Current Version: 0.1.0** - Minimal passthrough implementation
53
+
54
+ Currently a passthrough wrapper around cellxgene-schema Validator.
55
+ HCA-specific validation rules will be added incrementally.
56
+
57
+ ## Testing
58
+
59
+ ```bash
60
+ cd hca_schema_validator
61
+ poetry run pytest tests/
62
+ ```
63
+
64
+ ## Project Structure
65
+
66
+ ```
67
+ hca_schema_validator/
68
+ ├── src/
69
+ │ └── hca_schema_validator/
70
+ │ ├── __init__.py # Package exports
71
+ │ └── validator.py # HCAValidator class
72
+ ├── tests/
73
+ │ └── test_validator.py # Unit tests
74
+ ├── pyproject.toml # Poetry configuration & dependencies
75
+ └── README.md # This file
76
+ ```
77
+
78
+ ## License
79
+
80
+ MIT
@@ -0,0 +1,36 @@
1
+ [tool.poetry]
2
+ name = "hca-schema-validator"
3
+ version = "0.2.0"
4
+ description = "HCA schema validation for single-cell datasets"
5
+ authors = ["Clever Canary <dave@clevercanary.com>"]
6
+ license = "MIT"
7
+ readme = "README.md"
8
+ homepage = "https://github.com/clevercanary/hca-validation-tools"
9
+ packages = [{include = "hca_schema_validator", from = "src"}]
10
+
11
+ [tool.poetry.dependencies]
12
+ python = "^3.10"
13
+ # Dependencies for vendored cellxgene_schema code
14
+ anndata = ">=0.11.0,<0.12"
15
+ cellxgene-ontology-guide = ">=1.9.0,<2.0"
16
+ click = "<9"
17
+ dask = {extras = ["array", "dataframe"], version = ">=2024.0.0"}
18
+ duckdb = ">=1.3.0,<1.4" # Pinned for ibis compatibility
19
+ ibis-framework = {extras = ["duckdb"], version = ">=10.3"}
20
+ numpy = "<3"
21
+ pandas = ">2,<3"
22
+ pyarrow = ">=19"
23
+ pyyaml = "<7"
24
+ scipy = "<1.16"
25
+ sparse = ">=0.15.0,<0.16"
26
+ semver = "<4"
27
+ xxhash = "<4"
28
+ matplotlib = "<4"
29
+ pysam = ">=0.13.0"
30
+
31
+ [tool.poetry.group.dev.dependencies]
32
+ pytest = "^8.0"
33
+
34
+ [build-system]
35
+ requires = ["poetry-core"]
36
+ build-backend = "poetry.core.masonry.api"
@@ -0,0 +1,11 @@
1
+ """HCA Schema Validator - HCA-specific extensions for cellxgene schema validation."""
2
+
3
+ # Define constants first (before importing validator to avoid circular import)
4
+ __version__ = "0.2.0"
5
+ __schema_version__ = "1.0.0" # HCA schema version (independent from CELLxGENE)
6
+ __schema_reference_url__ = "https://data.humancellatlas.org/metadata" # Static URL, no version in path
7
+
8
+ # Import after constants are defined
9
+ from .validator import HCAValidator
10
+
11
+ __all__ = ["HCAValidator"]
@@ -0,0 +1,18 @@
1
+ """
2
+ Vendored dependencies for hca-schema-validator.
3
+
4
+ This directory contains vendored copies of third-party code that has been
5
+ modified for HCA-specific use.
6
+
7
+ Vendored packages:
8
+ - cellxgene_schema: Modified version of cellxgene-schema
9
+ Original: https://github.com/chanzuckerberg/single-cell-curation
10
+ Copyright (c) 2020-Present Chan Zuckerberg Initiative
11
+ License: MIT (see cellxgene_schema/LICENSE)
12
+
13
+ This code has been vendored and modified to support HCA-specific validation
14
+ requirements. All modifications are also licensed under MIT.
15
+
16
+ The vendored code is maintained as part of this package and does not require
17
+ external updates.
18
+ """
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020-Present Chan Zuckerberg Initiative
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.