Class ExpressionDataMatrixColumnSort
- java.lang.Object
-
- ubic.gemma.core.datastructure.matrix.ExpressionDataMatrixColumnSort
-
public class ExpressionDataMatrixColumnSort extends Object
Methods to organize ExpressionDataMatrices by column (or at least provide the ordering). This works by greedily finding the factor with the fewest categories, sorting the samples by the factor values (measurements are treated as numbers if possible), and recursively repeating this for each block, until there are no more factors with more than one value.- Author:
- paul
-
-
Constructor Summary
Constructors Constructor Description ExpressionDataMatrixColumnSort()
-
Method Summary
-
-
-
Method Detail
-
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
-
getBaselineLevels
public static Map<ExperimentalFactor,FactorValue> getBaselineLevels(List<BioMaterial> samplesUsed, 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. For continuous factors, the minimum value is treated as baseline.- Parameters:
samplesUsed
- 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.factors
- factors- Returns:
- map of factors to the baseline factorvalue for that factor.
-
orderByExperimentalDesign
public static <R> DoubleMatrix<R,BioAssay> orderByExperimentalDesign(DoubleMatrix<R,BioAssay> mat)
-
orderByExperimentalDesign
public static <R> DoubleMatrix<R,BioAssay> orderByExperimentalDesign(DoubleMatrix<R,BioAssay> mat, @Nullable ExperimentalFactor primaryFactor)
-
orderByExperimentalDesign
public static List<BioMaterial> orderByExperimentalDesign(ExpressionDataMatrix<?> mat)
-
orderByExperimentalDesign
public static List<BioMaterial> orderByExperimentalDesign(ExpressionDataMatrix<?> mat, @Nullable ExperimentalFactor primaryFactor)
- Parameters:
mat
- matrix- Returns:
- bio materials
-
orderByExperimentalDesign
public static List<BioMaterial> orderByExperimentalDesign(List<BioMaterial> start, Collection<ExperimentalFactor> factors)
- Parameters:
start
- BioMaterials to sort- Returns:
- bio materials
-
orderByExperimentalDesign
public static List<BioMaterial> orderByExperimentalDesign(List<BioMaterial> start, @Nullable Collection<ExperimentalFactor> factors, @Nullable ExperimentalFactor primaryFactor)
- Parameters:
start
- BioMaterials to sortfactors
- , can be nullprimaryFactor
- to start with, can be null- Returns:
- bio materials
-
-