Class BaselineSelection
- Author:
- paul
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<ExperimentalFactor, FactorValue> getBaselineConditions(Collection<BioMaterial> samplesUsed, Collection<ExperimentalFactor> factors) static Map<ExperimentalFactor, FactorValue> getBaselineLevels(Collection<ExperimentalFactor> factors) Identify the FactorValue that should be treated as 'Baseline' for each of the given factors.static Map<ExperimentalFactor, FactorValue> getBaselineLevels(Collection<ExperimentalFactor> factors, Collection<BioMaterial> samplesUsed) Identify the FactorValue that should be treated as 'Baseline' for each of the given factors.The control-group terms and URIs themselves, for callers that have to recognise a baseline in SQL rather than over loaded entities.static List<FactorValue> getExplicitBaselines(ExperimentalFactor factor, Collection<BioMaterial> samplesUsed) The factor values a curator has EXPLICITLY marked as baseline on this factor, restricted to those the given samples actually use.static booleanCheck if a given characteristic indicate a baseline condition.static booleanisBaselineCondition(FactorValue factorValue) Check if a given factor value indicates a baseline condition.static booleanCheck if a given statement indicates a baseline condition.static booleanCheck if this factor value is the baseline, overriding other possible baselines.
-
Constructor Details
-
BaselineSelection
public BaselineSelection()
-
-
Method Details
-
getControlGroupTerms
The control-group terms and URIs themselves, for callers that have to recognise a baseline in SQL rather than over loaded entities.Exposed rather than copied so there is one list. The relation harvest needs it because a curated statement whose object is a control-arm marker is not a relation between two concepts —
OBI_0000220 reference subject roleleft in makes every disease that ever had a control arm look implied by it.Both sets are already unmodifiable.
-
getControlGroupUris
-
isBaselineCondition
Check if a given factor value indicates a baseline condition. -
isBaselineCondition
Check if a given statement indicates a baseline condition. -
isBaselineCondition
Check if a given characteristic indicate a baseline condition. -
isForcedBaseline
Check if this factor value is the baseline, overriding other possible baselines.A baseline can be *forced* in two ways: either by setting
FactorValue.setIsBaseline(Boolean)to true or by adding a characteristic with theFORCED_BASELINE_VALUE_URIURI. In practice, this is not much different fromisBaselineCondition(Statement), but there might be cases where you would want to indicate that the baseline was explicitly forced. -
getBaselineLevels
public static Map<ExperimentalFactor, FactorValue> getBaselineLevels(Collection<ExperimentalFactor> factors, @Nullable Collection<BioMaterial> samplesUsed) Identify the FactorValue that should be treated as 'Baseline' for each of the given factors. This is done heuristically, and if all else fails we choose arbitrarily. For continuous factors, the minimum value is treated as baseline.- Parameters:
factors- factorssamplesUsed- These are used to make sure we don't bother using factor values as baselines if they are not used by any of the samples. This is important for subsets. If null, this is ignored.- Returns:
- map of factors to the baseline factorvalue for that factor.
-
getBaselineLevels
public static Map<ExperimentalFactor, FactorValue> getBaselineLevels(Collection<ExperimentalFactor> factors) Identify the FactorValue that should be treated as 'Baseline' for each of the given factors. This is done heuristically, and if all else fails we choose arbitrarily.- Parameters:
factors- factors- Returns:
- map
-
getExplicitBaselines
public static List<FactorValue> getExplicitBaselines(ExperimentalFactor factor, @Nullable Collection<BioMaterial> samplesUsed) The factor values a curator has EXPLICITLY marked as baseline on this factor, restricted to those the given samples actually use.More than one is legitimate: a dataset holding two experiments has a reference level per experiment. It does mean the factor cannot be analyzed as a single contrast, which is why
LinearModelAnalyzerrefuses such a factor unless a subset factor was configured.🛑 Deliberately counts only the explicit flag, NOT
isBaselineCondition(FactorValue). The inference finds two candidates on a great many factors — any design with, say, both "control" and "untreated" levels — and that is ambiguity to be resolved by picking one, not a curator saying "this design has two reference levels". Treating inferred pairs as an error would fail analyses that run correctly today.- Parameters:
samplesUsed- restrict to values used by these samples, or null to consider every value of the factor
-
getBaselineConditions
public static Map<ExperimentalFactor, FactorValue> getBaselineConditions(Collection<BioMaterial> samplesUsed, Collection<ExperimentalFactor> factors)
-