|
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, |
@@ -244,7 +247,14 @@ def ingest_expression(self) -> None: |
244 | 247 | def ingest_cell_metadata(self): |
245 | 248 | """Ingests cell metadata files into Firestore.""" |
246 | 249 | # TODO: Add self.has_valid_metadata_convention() to if statement |
247 | | - if self.cell_metadata.is_valid_file and self.has_valid_metadata_convention(): |
| 250 | + if self.cell_metadata.is_valid_file: |
| 251 | + # Check to see file needs to be check against metadata convention |
| 252 | + if self.kwargs['validate_convention'] is not None: |
| 253 | + if self.kwargs['validate_convention']: |
| 254 | + if self.has_valid_metadata_convention(): |
| 255 | + pass |
| 256 | + else: |
| 257 | + return 1 |
248 | 258 | self.cell_metadata.reset_file(2, open_as="dataframe") |
249 | 259 | self.cell_metadata.preproccess() |
250 | 260 | for metadataModel in self.cell_metadata.transform(): |
@@ -386,7 +396,12 @@ def create_parser(): |
386 | 396 | "--ingest-cell-metadata", |
387 | 397 | required=True, |
388 | 398 | action="store_true", |
389 | | - help="Indicates that subsampliing functionality should be invoked", |
| 399 | + help="Indicates that ingest of cell metadata should be invoked", |
| 400 | + ) |
| 401 | + parser_cell_metadata.add_argument( |
| 402 | + "--validate-convention", |
| 403 | + action="store_true", |
| 404 | + help="Indicates that metadata file should be validated against convention", |
390 | 405 | ) |
391 | 406 |
|
392 | 407 | # Parser ingesting cluster files |
|
0 commit comments