Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ source env/bin/activate
pip install -r requirements.txt
source scripts/setup-mongo-dev.sh
```
Note: if you encounter the following error:
```
AttributeError: module 'coverage' has no attribute 'types'
```
You can run the following to address this:
```
pip install --upgrade coverage
```

### Docker

Expand Down
Binary file modified ingest/validation/ontologies/cl.min.tsv.gz
Binary file not shown.
Binary file modified ingest/validation/ontologies/efo.min.tsv.gz
Binary file not shown.
Binary file modified ingest/validation/ontologies/hancestro.min.tsv.gz
Binary file not shown.
Binary file modified ingest/validation/ontologies/mondo.min.tsv.gz
Binary file not shown.
Binary file modified ingest/validation/ontologies/ncbitaxon.min.tsv.gz
Binary file not shown.
Binary file modified ingest/validation/ontologies/uberon.min.tsv.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion ingest/validation/ontologies/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1752088054 # validation cache key
1764096355 # validation cache key
11 changes: 10 additions & 1 deletion ingest/validation/validate_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,17 @@ def retrieve_label_and_synonyms(
:param property_type: attribute type for term (string, array, boolean)
"""
ontology_name = re.split("[_:]", ontology_id)[0].lower()
if ontology_is_local(ontology_name):
# use OLS fallback for taxon IDs since minified version is not authoritative
use_fallback = ontology_name == "ncbitaxon"
if ontology_is_local(ontology_name) and not use_fallback:
return minified_reader.find_ontology_entry(ontology_name, ontology_id, property_name)
elif ontology_is_local(ontology_name) and use_fallback:
try:
return minified_reader.find_ontology_entry(ontology_name, ontology_id, property_name)
except ValueError:
return retriever.retrieve_ontology_term_label_and_synonyms(
ontology_id, property_name, convention, property_type
)
else:
return retriever.retrieve_ontology_term_label_and_synonyms(
ontology_id, property_name, convention, property_type
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cellarium-cas[vis]==1.4.11

# Dev dependencies
pytest==7.2.1
coverage==4.5.3
coverage==7.12.0
pytest-xdist==1.29.0
pre-commit==1.18.1
black==24.3.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NAME cell_type cell_type__ontology_label organism_age disease disease__ontology_label species species__ontology_label geographical_region geographical_region__ontology_label library_preparation_protocol library_preparation_protocol__ontology_label organ organ__ontology_label sex is_living organism_age__unit organism_age__unit_label ethnicity__ontology_label ethnicity race race__ontology_label donor_id biosample_id biosample_type preservation_method
TYPE group group numeric group group group group group group group group group group group group group group group group group group group group group group
BM01_16dpp_AAGCAGTGGTAT CL_0000066 epithelial cell 31 MONDO_0000001 disease NCBITaxon_197152 Cloeon dipterum GAZ_00003181 Boston EFO_0008919 Seq-Well UBERON_0001913 milk female yes UO_0000036 year European ancestry HANCESTRO_0005 NCIT_C43862 Norwegian BM01 BM01_16dpp_r3 PrimaryBioSample_BodyFluid Fresh
BM01_16dpp_TAAGCAGTGGTA CL_0000066 epithelial cell 31 MONDO_0000001 disease NCBITaxon_197152 Cloeon dipterum GAZ_00003181 Boston EFO_0008919 Seq-Well UBERON_0001913 milk female yes UO_0000036 year European ancestry HANCESTRO_0005 NCIT_C43862 Norwegian BM01 BM01_16dpp_r3 PrimaryBioSample_BodyFluid Fresh
BM01_16dpp_CTAAGCAGTGGT CL_0000066 epithelial cell 31 MONDO_0000001 disease NCBITaxon_197152 Cloeon dipterum GAZ_00003181 Boston EFO_0008919 Seq-Well UBERON_0001913 milk female yes UO_0000036 year European ancestry HANCESTRO_0005 NCIT_C126538 Scandinavian BM01 BM01_16dpp_r3 PrimaryBioSample_BodyFluid Fresh
BM01_16dpp_CGGTAAACCATT CL_0000066 epithelial cell 31 MONDO_0000001 disease NCBITaxon_197152 Cloeon dipterum GAZ_00003181 Boston EFO_0008919 Seq-Well UBERON_0001913 milk female yes UO_0000036 year European ancestry HANCESTRO_0005 NCIT_C126538 Scandinavian BM01 BM01_16dpp_r3 PrimaryBioSample_BodyFluid Fresh
BM01_16dpp_CCGAATTCACCG CL_0000066 epithelial cell 31 PATO_0000001 quality NCBITaxon_197152 Cloeon dipterum GAZ_00003181 Boston EFO_0008919 Seq-Well UBERON_0001913 milk female yes UO_0000036 year European ancestry HANCESTRO_0005 NCIT_C126538 Scandinavian BM01 BM01_16dpp_r3 PrimaryBioSample_BodyFluid Fresh
16 changes: 16 additions & 0 deletions tests/test_validate_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,22 @@ def test_minified_reader_validation(self):
self.assertEqual('type 1 diabetes mellitus', entry['label'])
self.assertIn('insulin dependent diabetes', entry['synonyms'])

def test_uses_fallback_validation(self):
"""Non-standard species should use OLS fallback validation"""
args = (
"--convention ../schema/alexandria_convention/alexandria_convention_schema.json "
"../tests/data/annotation/metadata/convention/valid_extended_taxon_v3.0.0.txt"
)
metadata, convention = self.setup_metadata(args)
self.assertTrue(
metadata.validate_format(), "Valid metadata headers should not elicit error"
)
validate_input_metadata(metadata, convention)
self.assertFalse(
report_issues(metadata), "Valid ontology content should not elicit error"
)
self.teardown_metadata(metadata)


if __name__ == "__main__":
unittest.main()
Loading