|
18 | 18 | # Ingest Cell Metadata file |
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 | +# 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 |
| 23 | +
|
21 | 24 | # Ingest dense file |
22 | 25 | 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 |
23 | 26 |
|
|
58 | 61 |
|
59 | 62 | class IngestPipeline(object): |
60 | 63 | # File location for metadata json convention |
61 | | - JSON_CONVENTION = 'DoNotTouch/AMC_v1.1.1.json' |
| 64 | + JSON_CONVENTION = 'DoNotTouch/AMC_v0.8.json' |
62 | 65 |
|
63 | 66 | def __init__( |
64 | 67 | self, |
@@ -270,7 +273,14 @@ def ingest_expression(self) -> None: |
270 | 273 | def ingest_cell_metadata(self): |
271 | 274 | """Ingests cell metadata files into Firestore.""" |
272 | 275 | # TODO: Add self.has_valid_metadata_convention() to if statement |
273 | | - if self.cell_metadata.is_valid_file and self.has_valid_metadata_convention(): |
| 276 | + if self.cell_metadata.is_valid_file: |
| 277 | + # Check to see file needs to be check against metadata convention |
| 278 | + if self.kwargs['validate_convention'] is not None: |
| 279 | + if self.kwargs['validate_convention']: |
| 280 | + if self.has_valid_metadata_convention(): |
| 281 | + pass |
| 282 | + else: |
| 283 | + return 1 |
274 | 284 | self.cell_metadata.reset_file(2, open_as="dataframe") |
275 | 285 | self.cell_metadata.preproccess() |
276 | 286 | for metadataModel in self.cell_metadata.transform(): |
@@ -418,7 +428,12 @@ def create_parser(): |
418 | 428 | "--ingest-cell-metadata", |
419 | 429 | required=True, |
420 | 430 | action="store_true", |
421 | | - help="Indicates that subsampliing functionality should be invoked", |
| 431 | + help="Indicates that ingest of cell metadata should be invoked", |
| 432 | + ) |
| 433 | + parser_cell_metadata.add_argument( |
| 434 | + "--validate-convention", |
| 435 | + action="store_true", |
| 436 | + help="Indicates that metadata file should be validated against convention", |
422 | 437 | ) |
423 | 438 |
|
424 | 439 | # Parser ingesting cluster files |
|
0 commit comments