Skip to content

Commit

Permalink
Merge pull request #1433 from microbiomedata/1431-update-annotation-i…
Browse files Browse the repository at this point in the history
…ngest

Use correct slot when querying gene aggregations
  • Loading branch information
naglepuff authored Nov 14, 2024
2 parents 02ca10d + 9aa5e09 commit 887530c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion nmdc_server/ingest/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def load(db: Session, function_limit=None, skip_annotation=False):
),
pipeline.load_mp_analysis,
WorkflowActivityTypeEnum.metaproteomic_analysis.value,
annotations=mongodb["metap_gene_function_aggregation"],
annotations=mongodb["functional_annotation_agg"],
function_limit=function_limit,
)
db.commit()
Expand Down
12 changes: 6 additions & 6 deletions nmdc_server/ingest/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ def load_mg_annotation(db: Session, obj: Dict[str, Any], **kwargs) -> LoadObject

query = annotations.find(
{
"metagenome_annotation_id": pipeline.id,
"was_generated_by": pipeline.id,
"gene_function_id": {
"$regex": gene_regex,
},
},
no_cursor_timeout=True,
projection={
"_id": False,
"metagenome_annotation_id": True,
"was_generated_by": True,
"count": True,
"gene_function_id": True,
},
Expand Down Expand Up @@ -88,7 +88,7 @@ def load_mp_analysis(db: Session, obj: Dict[str, Any], **kwargs) -> LoadObjectRe

query = annotations.find(
{
"metaproteomic_analysis_id": pipeline.id,
"was_generated_by": pipeline.id,
"gene_function_id": {
"$regex": gene_regex,
},
Expand All @@ -97,7 +97,7 @@ def load_mp_analysis(db: Session, obj: Dict[str, Any], **kwargs) -> LoadObjectRe
no_cursor_timeout=True,
projection={
"_id": False,
"metaproteomic_analysis_id": True,
"was_generated_by": True,
"count": True,
"gene_function_id": True,
"best_protein": True,
Expand Down Expand Up @@ -139,15 +139,15 @@ def load_mt_annotation(db: Session, obj: Dict[str, Any], **kwargs) -> LoadObject
# Query gene function annotations from mongo and build the appropriate objects
query = annotations.find(
{
"metagenome_annotation_id": pipeline.id,
"was_generated_by": pipeline.id,
"gene_function_id": {
"$regex": gene_regex,
},
},
no_cursor_timeout=True,
projection={
"_id": False,
"metatranscriptome_annotation_id": True,
"was_generated_by": True,
"count": True,
"gene_function_id": True,
},
Expand Down

0 comments on commit 887530c

Please sign in to comment.