File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11import logging
22from typing import Optional
33
4- from sqlalchemy import func , or_
4+ from sqlalchemy import func , or_ , not_
55from sqlalchemy .orm import Session
66
77from mavedb .lib .logging .context import logging_context , save_to_logging_context
@@ -99,6 +99,17 @@ def search_experiments(
9999 )
100100 )
101101
102+ if search .meta_analysis is not None :
103+ if not search .meta_analysis :
104+ query = query .filter (
105+ or_ (
106+ # Keep experiments without any score sets
107+ not_ (Experiment .score_sets .any ()),
108+ # Keep experiments where score sets exist but have no meta_analyzes_score_sets
109+ Experiment .score_sets .any (not_ (ScoreSet .meta_analyzes_score_sets .any ()))
110+ )
111+ )
112+
102113 items : list [Experiment ] = query .order_by (Experiment .urn , Experiment .title ).all ()
103114 if not items :
104115 items = []
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class ExperimentsSearch(BaseModel):
1111 publication_identifiers : Optional [list [str ]]
1212 keywords : Optional [list [str ]]
1313 text : Optional [str ]
14+ meta_analysis : Optional [bool ]
1415
1516
1617class ScoreSetsSearch (BaseModel ):
You can’t perform that action at this time.
0 commit comments