use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method getPreferredQuantitationTypes.
public static Collection<QuantitationType> getPreferredQuantitationTypes(ExpressionExperiment expressionExperiment) {
Collection<QuantitationType> neededQtTypes = new HashSet<>();
Collection<QuantitationType> eeQtTypes = expressionExperiment.getQuantitationTypes();
if (eeQtTypes.size() == 0)
throw new IllegalArgumentException("No quantitation types for " + expressionExperiment);
ExpressionDataMatrixBuilder.log.debug("Experiment has " + eeQtTypes.size() + " quantitation types");
for (QuantitationType qType : eeQtTypes) {
if (qType.getIsPreferred()) {
ExpressionDataMatrixBuilder.log.debug("Preferred=" + qType);
neededQtTypes.add(qType);
}
}
return neededQtTypes;
}
use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method getRanksByMean.
public Map<CompositeSequence, Double> getRanksByMean() {
Collection<QuantitationType> qtypes = this.getPreferredQTypes();
Map<CompositeSequence, Double> ranks = new HashMap<>();
for (DesignElementDataVector v : this.vectors) {
if (qtypes.contains(v.getQuantitationType()) && v instanceof ProcessedExpressionDataVector) {
ranks.put(v.getDesignElement(), ((ProcessedExpressionDataVector) v).getRankByMean());
}
}
return ranks;
}
use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method getSignalChannelB.
public ExpressionDataDoubleMatrix getSignalChannelB() {
if (dat == null)
dat = this.getQuantitationTypesNeeded();
List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
List<QuantitationType> qTypes = new ArrayList<>();
for (BioAssayDimension dimension : dimensions) {
QuantitationType qType = dat.getSignalChannelB(dimension);
if (qType != null)
qTypes.add(qType);
}
if (qTypes.size() != 0) {
return this.makeMatrix(qTypes);
}
return null;
}
use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method getSignalChannelA.
public ExpressionDataDoubleMatrix getSignalChannelA() {
if (dat == null)
dat = this.getQuantitationTypesNeeded();
List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
List<QuantitationType> qTypes = new ArrayList<>();
for (BioAssayDimension dimension : dimensions) {
QuantitationType signalChannelA = dat.getSignalChannelA(dimension);
QuantitationType signalChannelB = dat.getSignalChannelB(dimension);
QuantitationType backgroundChannelA = dat.getBackgroundChannelA(dimension);
QuantitationType bkgSubChannelA = dat.getBkgSubChannelA(dimension);
boolean channelANeedsReconstruction = this.checkChannelA(signalChannelA, signalChannelB, backgroundChannelA, bkgSubChannelA);
if (channelANeedsReconstruction) {
return this.getSignalChannelAFancy(dimension);
}
if (signalChannelA != null)
qTypes.add(signalChannelA);
}
if (qTypes.size() != 0) {
return this.makeMatrix(qTypes);
}
return null;
}
use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method getSignalChannelAFancy.
private ExpressionDataDoubleMatrix getSignalChannelAFancy(BioAssayDimension dimension) {
boolean channelANeedsReconstruction;
/*
* This is made messy by data sets where the non-background-subtracted data has been omitted, but the background
* values are available.
*/
if (dat == null)
dat = this.getQuantitationTypesNeeded();
QuantitationType signalChannelA = dat.getSignalChannelA(dimension);
QuantitationType signalChannelB = dat.getSignalChannelB(dimension);
QuantitationType backgroundChannelA = dat.getBackgroundChannelA(dimension);
QuantitationType bkgSubChannelA = dat.getBkgSubChannelA(dimension);
channelANeedsReconstruction = this.checkChannelA(signalChannelA, signalChannelB, backgroundChannelA, bkgSubChannelA);
ExpressionDataDoubleMatrix signalDataA;
if (channelANeedsReconstruction) {
ExpressionDataDoubleMatrix bkgDataA = null;
if (backgroundChannelA != null) {
bkgDataA = new ExpressionDataDoubleMatrix(vectors, backgroundChannelA);
}
// use background-subtracted data and add bkg back on
assert bkgDataA != null;
assert bkgSubChannelA != null;
signalDataA = new ExpressionDataDoubleMatrix(vectors, bkgSubChannelA);
this.addBackgroundBack(signalDataA, bkgDataA);
return signalDataA;
}
return this.getSignalChannelA();
}
Aggregations