Skip to content

Commit

Permalink
Draft of modified meta-analysis. However, front end doesn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
EstelleDa committed Nov 27, 2024
1 parent c740d6b commit 66140c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/mavedb/lib/experiments.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from typing import Optional

from sqlalchemy import func, or_
from sqlalchemy import func, or_, not_
from sqlalchemy.orm import Session

from mavedb.lib.logging.context import logging_context, save_to_logging_context
Expand Down Expand Up @@ -99,6 +99,17 @@ def search_experiments(
)
)

if search.meta_analysis is not None:
if not search.meta_analysis:
query = query.filter(
or_(
# Keep experiments without any score sets
not_(Experiment.score_sets.any()),
# Keep experiments where score sets exist but have no meta_analyzes_score_sets
Experiment.score_sets.any(not_(ScoreSet.meta_analyzes_score_sets.any()))
)
)

items: list[Experiment] = query.order_by(Experiment.urn, Experiment.title).all()
if not items:
items = []
Expand Down
1 change: 1 addition & 0 deletions src/mavedb/view_models/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ExperimentsSearch(BaseModel):
publication_identifiers: Optional[list[str]]
keywords: Optional[list[str]]
text: Optional[str]
meta_analysis: Optional[bool]


class ScoreSetsSearch(BaseModel):
Expand Down

0 comments on commit 66140c3

Please sign in to comment.