From 7eca027b2eb9bc56f83b38501f9c9ff92014ff60 Mon Sep 17 00:00:00 2001 From: tpylak <tpylak> Date: Fri, 20 May 2011 10:44:58 +0000 Subject: [PATCH] LMS-2189 minor: prepare framework SVN: 21415 --- .../MaterialFeatureVectorSummaryLoader.java | 19 ++++++ .../MaterialSimpleFeatureVectorSummary.java | 61 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/dto/MaterialSimpleFeatureVectorSummary.java diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/MaterialFeatureVectorSummaryLoader.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/MaterialFeatureVectorSummaryLoader.java index 6b6d025c2ae..8760bf3c70f 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/MaterialFeatureVectorSummaryLoader.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/MaterialFeatureVectorSummaryLoader.java @@ -35,6 +35,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.server.IScreeningBusinessObject import ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto.IWellData; import ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto.MaterialAllReplicasFeatureVectors; import ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto.MaterialBiologicalReplicateFeatureVector; +import ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto.MaterialSimpleFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto.MaterialTechnicalReplicateFeatureVector; import ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto.WellDataCollection; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialBiologicalReplicateFeatureSummary; @@ -53,6 +54,24 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSummar */ public class MaterialFeatureVectorSummaryLoader extends ExperimentFeatureVectorSummaryLoader { + public static List<MaterialSimpleFeatureVectorSummary> loadMaterialFeatureVectorsFromAllAssays( + Session session, IScreeningBusinessObjectFactory businessObjectFactory, + IDAOFactory daoFactory, TechId materialId, MaterialSummarySettings settings) + { + // Probably the result DTO has to be converted (here?) to fit the GUI needs better. + // Note that different experiments can have different set of features! + return new MaterialFeatureVectorSummaryLoader(session, businessObjectFactory, daoFactory, + settings).loadMaterialFeatureVectorsFromAllAssays(materialId); + } + + /** Note that different experiments can have different set of features! */ + private List<MaterialSimpleFeatureVectorSummary> loadMaterialFeatureVectorsFromAllAssays( + TechId materialId) + { + // TODO 2011-05-20, Tomasz Pylak: implement me! + return null; + } + /** * For comments {@See MaterialFeatureVectorSummaryLoader}. */ diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/dto/MaterialSimpleFeatureVectorSummary.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/dto/MaterialSimpleFeatureVectorSummary.java new file mode 100644 index 00000000000..de8b20c1aae --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/dto/MaterialSimpleFeatureVectorSummary.java @@ -0,0 +1,61 @@ +/* + * Copyright 2011 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto; + +import java.util.List; + +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.CodeAndLabel; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; + +/** + * Stores feature vector summaries for one material and experiment. + * + * @author Tomasz Pylak + */ +public class MaterialSimpleFeatureVectorSummary +{ + private final Experiment experiment; + + // has the same length as feature vectors summary + private final List<CodeAndLabel> featureDescriptions; + + private final float[] featureVectorSummary; + + public MaterialSimpleFeatureVectorSummary(Experiment experiment, + List<CodeAndLabel> featureDescriptions, float[] featureVectorSummary) + { + this.experiment = experiment; + this.featureDescriptions = featureDescriptions; + this.featureVectorSummary = featureVectorSummary; + } + + public Experiment getExperiment() + { + return experiment; + } + + public List<CodeAndLabel> getFeatureDescriptions() + { + return featureDescriptions; + } + + public float[] getFeatureVectorSummary() + { + return featureVectorSummary; + } + +} -- GitLab