Skip to content

Commit bf58759

Browse files
committed
Refactor tests to not use Firestore emulator
1 parent d09a00d commit bf58759

File tree

9 files changed

+146
-174
lines changed

9 files changed

+146
-174
lines changed

ingest/ingest_pipeline.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,14 @@ def __init__(
7272
subsample=False,
7373
ingest_cell_metadata=False,
7474
ingest_cluster=False,
75-
db=None,
7675
**kwargs,
7776
):
7877
"""Initializes variables in ingest service."""
7978
self.file_id = file_id
8079
self.study_accession = study_accession
8180
self.matrix_file = matrix_file
8281
self.matrix_file_type = matrix_file_type
83-
if db is not None:
84-
self.db = db
85-
else:
86-
self.db = firestore.Client()
82+
self.db = firestore.Client()
8783
self.cluster_file = cluster_file
8884
self.kwargs = kwargs
8985
self.cell_metadata_file = cell_metadata_file

tests/gene_model_0.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{'name': 'RPP25L', 'gene_id': 'ENSG00000164967', 'source_file_type': ('Mtx',), 'cell_names': ['AACGTTGGTTAAAGTG-1'], 'expression_scores': [1.0], 'subdocument': {'cell_names': ['AACGTTGGTTAAAGTG-1'], 'expression_scores': [1.0], 'source_file_type': 'Mtx'}, 'top_level_doc': {'file_id': '1234abc', 'searchable_name': 'rpp25l', 'name': 'RPP25L',
2+
'gene_id': 'ENSG00000164967', 'study_accession': 'SCP1', 'taxon_name': 'Homo sapiens', 'taxon_common_name': 'human', 'ncbi_taxid': '9606', 'genome_assembly_accession': 'GCA_000001405.15', 'genome_annotation': 'Ensembl 94'}}

tests/mock_data/dense_matrix_19_genes_100k_cells_txt/gene_doc_0.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{'name': 'A1BG', 'gene_id': None, 'source_file_type': ('Dense',), 'cell_names': ['"Granuloma10_270"', '"Granuloma10_902"', '"Granuloma5_1043"', '"Granuloma5_316"'], 'expression_scores': [0.602, 1.934, 1.161, 0.82], 'subdocument': {'cell_names': ['"Granuloma10_270"', '"Granuloma10_902"', '"Granuloma5_1043"', '"Granuloma5_316"'], 'expression_scores': [0.602, 1.934, 1.161, 0.82], 'source_file_type': 'Dense'}, 'top_level_doc': {'file_id': '1234abc', 'searchable_name': 'a1bg', 'name': 'A1BG', 'gene_id': None, 'study_accession': 'SCP1', 'taxon_name': 'Homo sapiens', 'taxon_common_name': 'human', 'ncbi_taxid': '9606', 'genome_assembly_accession': 'GCA_000001405.15', 'genome_annotation': 'Ensembl 94'}}

tests/mock_data/loom/gene_doc_0.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{'name': 'A2M', 'gene_id': None, 'source_file_type': ('loom',), 'cell_names': ['BM01_16dpp_AAGCAGTGGTAT', 'BM01_16dpp_TAAGCAGTGGTA', 'BM01_16dpp_CTAAGCAGTGGT', 'BM01_16dpp_CGGTAAACCATT', 'BM01_16dpp_CCGAATTCACCG'], 'expression_scores': [-0.191, -0.191, 2.646, -0.191, -0.191], 'subdocument': {'cell_names': ['BM01_16dpp_AAGCAGTGGTAT', 'BM01_16dpp_TAAGCAGTGGTA', 'BM01_16dpp_CTAAGCAGTGGT', 'BM01_16dpp_CGGTAAACCATT', 'BM01_16dpp_CCGAATTCACCG'], 'expression_scores': [-0.191, -0.191, 2.646, -0.191, -0.191], 'source_file_type': 'loom'}, 'top_level_doc': {'file_id': '1234abc', 'searchable_name': 'a2m', 'name': 'A2M', 'gene_id': None, 'study_accession': 'SCP1', 'taxon_name': 'Homo Sapiens', 'taxon_common_name': 'human', 'ncbi_taxid': '9606', 'genome_assembly_accession': 'GCA_000001405.15', 'genome_annotation': 'Ensemble 94'}}

tests/mock_data/matrix_mtx/gene_doc_0.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{'name': 'RPP25L', 'gene_id': 'ENSG00000164967', 'source_file_type': ('Mtx',), 'cell_names': ['AACGTTGGTTAAAGTG-1'], 'expression_scores': [1.0], 'subdocument': {'cell_names': ['AACGTTGGTTAAAGTG-1'], 'expression_scores': [1.0], 'source_file_type': 'Mtx'}, 'top_level_doc': {'file_id': '1234abc', 'searchable_name': 'rpp25l', 'name': 'RPP25L',
2+
'gene_id': 'ENSG00000164967', 'study_accession': 'SCP1', 'taxon_name': 'Homo sapiens', 'taxon_common_name': 'human', 'ncbi_taxid': '9606', 'genome_assembly_accession': 'GCA_000001405.15', 'genome_annotation': 'Ensembl 94'}}

0 commit comments

Comments
 (0)