Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix metap ingest #1499

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nmdc_server/data_object_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class WorkflowActivityTypeEnum(Enum):
metabolomics_analysis = "nmdc:MetabolomicsAnalysis"
metagenome_assembly = "nmdc:MetagenomeAssembly"
metagenome_annotation = "nmdc:MetagenomeAnnotation"
metaproteomic_analysis = "nmdc:MetaproteomicAnalysis"
metaproteomic_analysis = "nmdc:MetaproteomicsAnalysis"
metatranscriptome = "nmdc:MetatranscriptomeAnalysis"
metatranscriptome_assembly = "nmdc:MetatranscriptomeAssembly"
metatranscriptome_annotation = "nmdc:MetatranscriptomeAnnotation"
Expand Down
2 changes: 1 addition & 1 deletion nmdc_server/ingest/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def load(db: Session, function_limit=None, skip_annotation=False):
pipeline.load(
db,
mongodb[workflow_set].find(
{"type": "nmdc:MetaproteomicsAnalysis"},
{"type": WorkflowActivityTypeEnum.metaproteomic_analysis.value},
no_cursor_timeout=True,
),
pipeline.load_mp_analysis,
Expand Down
4 changes: 1 addition & 3 deletions nmdc_server/ingest/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ def load_mp_analysis(db: Session, obj: Dict[str, Any], **kwargs) -> LoadObjectRe
"gene_function_id": {
"$regex": gene_regex,
},
"best_protein": True,
},
no_cursor_timeout=True,
projection={
"_id": False,
"was_generated_by": True,
"count": True,
"gene_function_id": True,
"best_protein": True,
},
)
if kwargs.get("function_limit"):
Expand All @@ -116,7 +114,7 @@ def load_mp_analysis(db: Session, obj: Dict[str, Any], **kwargs) -> LoadObjectRe
metaproteomic_analysis_id=pipeline.id,
gene_function_id=function_id,
count=annotation["count"],
best_protein=annotation["best_protein"],
best_protein=True,
)
)
if metap_gene_function_aggregations:
Expand Down
8 changes: 7 additions & 1 deletion nmdc_server/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,13 @@ def query(self, db) -> Query:

# Gene function queries are treated differently because they join
# in three different places (metaT, metaG and metaP).
if table == Table.gene_function:
if table in [
Table.gene_function,
Table.kegg_function,
Table.go_function,
Table.pfam_function,
Table.cog_function,
]:
metag_matches = filter.matches(db, self.table)
metap_conditions = [
SimpleConditionSchema(
Expand Down
Loading