use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class ExpressionExperimentDaoImpl method removeDataVectors.
private int removeDataVectors(Session session, Set<BioAssayDimension> dims, Set<QuantitationType> qts, Collection<RawExpressionDataVector> designElementDataVectors, int count) {
AbstractDao.log.info("Removing Design Element Data Vectors ...");
for (RawExpressionDataVector dv : designElementDataVectors) {
BioAssayDimension bad = dv.getBioAssayDimension();
dims.add(bad);
QuantitationType qt = dv.getQuantitationType();
qts.add(qt);
dv.setBioAssayDimension(null);
dv.setQuantitationType(null);
session.delete(dv);
if (++count % 1000 == 0) {
session.flush();
}
// put back...
dv.setBioAssayDimension(bad);
dv.setQuantitationType(qt);
if (count % 20000 == 0) {
AbstractDao.log.info(count + " design Element data vectors deleted");
}
}
count = 0;
return count;
}
use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method getPreferredDataVectors.
/**
* @return The 'preferred' data vectors - NOT the processed data vectors!
*/
private Collection<DesignElementDataVector> getPreferredDataVectors() {
Collection<DesignElementDataVector> result = new HashSet<>();
List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
List<QuantitationType> qtypes = this.getPreferredQTypes();
for (DesignElementDataVector vector : vectors) {
if (!(vector instanceof ProcessedExpressionDataVector) && dimensions.contains(vector.getBioAssayDimension()) && qtypes.contains(vector.getQuantitationType()))
result.add(vector);
}
return result;
}
use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method populateMissingValueInfo.
private void populateMissingValueInfo() {
ByteArrayConverter bac = new ByteArrayConverter();
for (DesignElementDataVector vector : vectors) {
QuantitationType qt = vector.getQuantitationType();
if (!numMissingValues.containsKey(qt)) {
numMissingValues.put(qt, 0);
}
for (Double d : bac.byteArrayToDoubles(vector.getData())) {
if (d.isNaN()) {
anyMissing = true;
numMissingValues.put(qt, numMissingValues.get(qt) + 1);
}
}
}
}
use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method getMissingValueQTypes.
private List<QuantitationType> getMissingValueQTypes() {
List<QuantitationType> result = new ArrayList<>();
List<BioAssayDimension> dimensions = this.getBioAssayDimensions();
for (BioAssayDimension dim : dimensions) {
for (DesignElementDataVector vector : vectors) {
if (!vector.getBioAssayDimension().equals(dim))
continue;
QuantitationType qType = vector.getQuantitationType();
if (!qType.getType().equals(StandardQuantitationType.PRESENTABSENT))
continue;
// ArrayDesign adUsed = arrayDesignForVector( vector );
// if ( arrayDesign != null && !adUsed.equals( arrayDesign ) ) continue;
// if we get here, we're in the right place.
result.add(qType);
// on to the next dimension.
break;
}
}
return result;
}
use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.
the class QuantitationTypeData method getMissingValueQuantitationTypes.
/**
* @param expressionExperiment (should be lightly thawed)
* @return a collection of QTs
*/
public static Collection<QuantitationType> getMissingValueQuantitationTypes(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.getType().equals(StandardQuantitationType.PRESENTABSENT)) {
ExpressionDataMatrixBuilder.log.debug("Present/absent=" + qType);
neededQtTypes.add(qType);
}
}
return neededQtTypes;
}
Aggregations