|
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 validate_input_metadata, report_issues |
|
57 | 59 |
|
58 | 60 | class IngestPipeline(object): |
59 | 61 | # File location for metadata json convention |
60 | | - JSON_CONVENTION = 'DoNotTouch/AMC_v0.8.json' |
| 62 | + JSON_CONVENTION = 'gs://fc-bcc55e6c-bec3-4b2e-9fb2-5e1526ddfcd2/metadata_conventions/AMC_v1.1.3/AMC_v1.1.3.json' |
61 | 63 |
|
62 | 64 | def __init__( |
63 | 65 | self, |
@@ -229,8 +231,11 @@ def load_subsample(self, doc): |
229 | 231 | def has_valid_metadata_convention(self): |
230 | 232 | """ Determines if cell metadata file follows metadata convention""" |
231 | 233 | with open(self.JSON_CONVENTION, 'r') as f: |
232 | | - convention = json.load(f) |
| 234 | + json_file = IngestFiles(self.JSON_CONVENTION, ['application/json']) |
| 235 | + convention = json.load(json_file.file) |
233 | 236 | validate_input_metadata(self.cell_metadata, convention) |
| 237 | + |
| 238 | + f.close() |
234 | 239 | return not report_issues(self.cell_metadata) |
235 | 240 |
|
236 | 241 | def ingest_expression(self) -> None: |
@@ -272,6 +277,7 @@ def ingest_cell_metadata(self): |
272 | 277 | if self.kwargs['validate_convention'] is not None: |
273 | 278 | if self.kwargs['validate_convention']: |
274 | 279 | if self.has_valid_metadata_convention(): |
| 280 | + print("it works!") |
275 | 281 | pass |
276 | 282 | else: |
277 | 283 | return 1 |
|
0 commit comments