public class DesignMatrix extends Object
Baseline levels are initially determined by the order in which factor levels appear. You can re-level using the setBaseline method.
Constructor and Description |
---|
DesignMatrix(Object[] factor,
int start,
String factorName) |
DesignMatrix(ObjectMatrix<String,String,?> sampleInfo,
boolean intercept) |
DesignMatrix(ObjectMatrix<String,String,? extends Object> sampleInfo) |
DesignMatrix(ObjectMatrix<String,String,Object> design,
boolean intercept,
boolean strict) |
DesignMatrix(StringMatrix<String,String> sampleInfo) |
Modifier and Type | Method and Description |
---|---|
void |
add(ObjectMatrix<String,String,Object> sampleInfo)
Append additional factors/covariates to this
|
void |
addInteraction()
Add interaction term; only works if there exactly two factors so this can figure out which interaction to add.
|
void |
addInteraction(String... interactionTerms)
This will not add the interaction unless all of the terms are already part of the design, and interactions that
obviously can't be estimated will be dropped if possible, but otherwise this is fairly brain dead.
|
List<Integer> |
getAssign() |
String |
getBaseline(String factorName) |
cern.colt.matrix.DoubleMatrix2D |
getDoubleMatrix() |
Collection<String[]> |
getInteractionTerms() |
Map<String,List<String>> |
getLevelsForFactors() |
DoubleMatrix<String,String> |
getMatrix() |
List<String> |
getTerms() |
Map<String,List<Object>> |
getValuesForFactors() |
boolean |
hasIntercept() |
boolean |
isHasIntercept() |
cern.colt.matrix.DoubleMatrix2D |
makeContrasts()
In limma, the contrasts are built by referring to the coefficients by name, which isn't what we want.
|
protected void |
rebuild()
Refresh the design matrix, for example after releveling.
|
void |
setBaseline(String factorName,
String baselineFactorValue) |
String |
toString() |
public DesignMatrix(Object[] factor, int start, String factorName)
factor
- in form of Doubles or Strings. Any other types will yield errors.start
- public DesignMatrix(ObjectMatrix<String,String,? extends Object> sampleInfo)
sampleInfo
- in form of Doubles or Strings. Any other types will yield errors.public DesignMatrix(ObjectMatrix<String,String,?> sampleInfo, boolean intercept)
sampleInfo
- in form of Doubles or Strings. Any other types will yield errors.intercept
- public DesignMatrix(StringMatrix<String,String> sampleInfo)
public DesignMatrix(ObjectMatrix<String,String,Object> design, boolean intercept, boolean strict)
design
- intercept
- whether to include an intercept in the modelstrict
- whether to remove columns from the design matrix that are unlikely to be useable. By default
this is "true" for other constructors.public Collection<String[]> getInteractionTerms()
public cern.colt.matrix.DoubleMatrix2D makeContrasts()
public void add(ObjectMatrix<String,String,Object> sampleInfo)
sampleInfo
- public void addInteraction()
public void addInteraction(String... interactionTerms)
interactionTerms
- public cern.colt.matrix.DoubleMatrix2D getDoubleMatrix()
public DoubleMatrix<String,String> getMatrix()
public boolean hasIntercept()
public boolean isHasIntercept()
public void setBaseline(String factorName, String baselineFactorValue)
factorName
- baselineFactorValue
- protected void rebuild()
Copyright © 2003–2022 UBC Michael Smith Laboratories. All rights reserved.