|
19 | 19 | python ingest_pipeline.py --study-accession SCP1 --file-id 123abc ingest_cell_metadata --cell-metadata-file ../tests/data/metadata_valid.tsv --ingest-cell-metadata |
20 | 20 |
|
21 | 21 | # Ingest Cell Metadata file against convention |
22 | | -python ingest_pipeline.py --study-accession SCP1 --file-id 123abc ingest_cell_metadata --cell-metadata-file ../tests/data/metadata_valid.tsv --ingest-cell-metadata --validate-convention |
| 22 | +!! Please note that you must have permission to the SCP bucket |
| 23 | +python ingest_pipeline.py --study-accession SCP1 --file-id 123abc ingest_cell_metadata --cell-metadata-file ../tests/data/valid_array_v1.1.3.tsv --ingest-cell-metadata --validate-convention |
23 | 24 |
|
24 | 25 | # Ingest dense file |
25 | 26 | python ingest_pipeline.py --study-accession SCP1 --file-id 123abc ingest_expression --taxon-name 'Homo sapiens' --taxon-common-name human --ncbi-taxid 9606 --matrix-file ../tests/data/dense_matrix_19_genes_100k_cells.txt --matrix-file-type dense |
|
47 | 48 | from google.api_core import exceptions |
48 | 49 | from google.cloud import firestore |
49 | 50 | from mtx import Mtx |
| 51 | +from ingest_files import IngestFiles |
50 | 52 | from subsample import SubSample |
51 | 53 | from loom import Loom |
52 | 54 | from validation.validate_metadata import ( |
|
61 | 63 |
|
62 | 64 | class IngestPipeline(object): |
63 | 65 | # File location for metadata json convention |
64 | | - JSON_CONVENTION = 'DoNotTouch/AMC_v0.8.json' |
| 66 | + JSON_CONVENTION = 'gs://fc-bcc55e6c-bec3-4b2e-9fb2-5e1526ddfcd2/metadata_conventions/AMC_v1.1.1.json' |
65 | 67 |
|
66 | 68 | def __init__( |
67 | 69 | self, |
@@ -232,8 +234,8 @@ def load_subsample(self, doc): |
232 | 234 |
|
233 | 235 | def has_valid_metadata_convention(self): |
234 | 236 | """ Determines if cell metadata file follows metadata convention""" |
235 | | - with open(self.JSON_CONVENTION, 'r') as f: |
236 | | - convention = json.load(f) |
| 237 | + json_file = IngestFiles(self.JSON_CONVENTION, ['application/json']) |
| 238 | + convention = json.load(json_file.file) |
237 | 239 |
|
238 | 240 | collect_jsonschema_errors(self.cell_metadata, convention) |
239 | 241 | validate_collected_ontology_data(self.cell_metadata, convention) |
@@ -278,6 +280,7 @@ def ingest_cell_metadata(self): |
278 | 280 | if self.kwargs['validate_convention'] is not None: |
279 | 281 | if self.kwargs['validate_convention']: |
280 | 282 | if self.has_valid_metadata_convention(): |
| 283 | + print("it works!") |
281 | 284 | pass |
282 | 285 | else: |
283 | 286 | return 1 |
|
0 commit comments