diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientService.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientService.java index 62976b8ed3daf5e6236db92a4ca2dd4a33c83697..f57a6e1a40ef4b57728620031cf383d4d4e65ace 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientService.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientService.java @@ -42,6 +42,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistr import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LogicalImageInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaFeatureSummary; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellContent; @@ -212,4 +213,14 @@ public interface IScreeningClientService extends IClientService TableExportCriteria<TableModelRowWithObject<MaterialReplicaFeatureSummary>> criteria) throws UserFailureException; + /** + * Return material feature vector summaries from all experiments for a give material tech id. + */ + public TypedTableResultSet<MaterialSimpleFeatureVectorSummary> listMaterialFeaturesFromAllExperiments( + IResultSetConfig<String, TableModelRowWithObject<MaterialSimpleFeatureVectorSummary>> resultSetConfig, + TechId materialId) throws UserFailureException; + + public String prepareExportMaterialFeaturesFromAllExperiments( + TableExportCriteria<TableModelRowWithObject<MaterialSimpleFeatureVectorSummary>> criteria) + throws UserFailureException; } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientServiceAsync.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientServiceAsync.java index ce723e028f66eaea4aebdba45ce81b4650e9dda3..63b497b58ee7772612fce910dc9da9a3f2944f68 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientServiceAsync.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/IScreeningClientServiceAsync.java @@ -43,6 +43,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistr import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LogicalImageInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaFeatureSummary; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellContent; @@ -200,4 +201,20 @@ public interface IScreeningClientServiceAsync extends IClientServiceAsync public void prepareExportMaterialReplicaFeatureSummary( TableExportCriteria<TableModelRowWithObject<MaterialReplicaFeatureSummary>> criteria, AsyncCallback<String> callback); + + /** + * @see IScreeningClientService#listMaterialFeaturesFromAllExperiments(IResultSetConfig, TechId) + */ + public void listMaterialFeaturesFromAllExperiments( + IResultSetConfig<String, TableModelRowWithObject<MaterialSimpleFeatureVectorSummary>> resultSetConfig, + TechId materialId, + AsyncCallback<TypedTableResultSet<MaterialSimpleFeatureVectorSummary>> callback); + + /** + * @see IScreeningClientService#prepareExportMaterialFeaturesFromAllExperiments(TableExportCriteria) + */ + public void prepareExportMaterialFeaturesFromAllExperiments( + TableExportCriteria<TableModelRowWithObject<MaterialSimpleFeatureVectorSummary>> criteria, + AsyncCallback<String> callback); + } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java index e5b43fc07f6acccc737065d0f9df70feafc331ae..992b10169dd38d440966927e23488288fb2c1132 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Dict.java @@ -76,6 +76,9 @@ public final class Dict extends ch.systemsx.cisd.openbis.generic.client.web.clie public static final String EXPERIMENT_FEATURE_VECTOR_SUMMARY_SECTION = "EXPERIMENT_FEATURE_VECTOR_SUMMARY_SECTION"; + public static final String MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION = + "MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION"; + public static final String SCREENING_MODULE_TITLE = "SCREENING_MODULE_TITLE"; public static final String PLATE_MATERIAL_REVIEWER_TITLE = "PLATE_MATERIAL_REVIEWER_TITLE"; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/DisplayTypeIDGenerator.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/DisplayTypeIDGenerator.java index ee205fe0dc9490c9ea18a845b8097add863e8368..43d41a1ff05da582a7b19da201d058ff0cfd1c0f 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/DisplayTypeIDGenerator.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/DisplayTypeIDGenerator.java @@ -43,7 +43,9 @@ public enum DisplayTypeIDGenerator implements IDisplayTypeIDGenerator EXPERIMENT_FEATURE_VECTOR_SUMMARY_SECTION("experiment-feature-vector-summary-section"), - MATERIAL_REPLICA_FEATURE_SUMMARY_SECTION("material-replica-feature-summary-section"); + MATERIAL_REPLICA_FEATURE_SUMMARY_SECTION("material-replica-feature-summary-section"), + + MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION("material-features-from-all-experiments-section"); private final String genericNameOrPrefix; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ImagingMaterialViewer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ImagingMaterialViewer.java index 037eb8c0f9d0362caeac7ef3ca3da5aa43e8faff..4eb74acb3f675ed4565ee7eb50e1f2adc3b66baa 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ImagingMaterialViewer.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ImagingMaterialViewer.java @@ -91,9 +91,12 @@ public class ImagingMaterialViewer extends GenericMaterialViewer new MaterialReplicaSummarySection(screeningViewContext, material, experimentPermId); sections.add(replicaSummarySection); + } else + { + MaterialFeaturesFromAllExpermentsSection featuresFromAllExperimentsSection = + new MaterialFeaturesFromAllExpermentsSection(screeningViewContext, material); + sections.add(featuresFromAllExperimentsSection); } - // TODO 2011-05-17, Tomasz Pylak: show materials in all assays section (always, - // MaterialAllAssaysSummarySection class) return sections; } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExperimentsGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExperimentsGrid.java new file mode 100644 index 0000000000000000000000000000000000000000..34ed395e592dcd36355e6f34347758a6ab53ad59 --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExperimentsGrid.java @@ -0,0 +1,99 @@ +/* + * 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.client.web.client.application.detailviewers; + +import com.google.gwt.user.client.rpc.AsyncCallback; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.DisplayTypeIDGenerator; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; + +/** + * A grid showing feature vector summaries for a material from all corresponding experiments. + * + * @author Kaloyan Enimanev + */ +public class MaterialFeaturesFromAllExperimentsGrid extends + TypedTableGrid<MaterialSimpleFeatureVectorSummary> +{ + private static final String ID = "material_features_from_all_experiments"; + + private static final String PREFIX = GenericConstants.ID_PREFIX + ID; + + public static final String BROWSER_ID = PREFIX + "_main"; + + private final IViewContext<IScreeningClientServiceAsync> specificViewContext; + + private final TechId materialId; + + public static IDisposableComponent create( + IViewContext<IScreeningClientServiceAsync> viewContext, TechId materialId) + { + return new MaterialFeaturesFromAllExperimentsGrid(viewContext, materialId) + .asDisposableWithoutToolbar(); + } + + MaterialFeaturesFromAllExperimentsGrid(IViewContext<IScreeningClientServiceAsync> viewContext, + TechId materialId) + { + super(viewContext.getCommonViewContext(), BROWSER_ID, true, + DisplayTypeIDGenerator.MATERIAL_REPLICA_FEATURE_SUMMARY_SECTION); + this.specificViewContext = viewContext; + this.materialId = materialId; + + setBorders(true); + } + + @Override + protected void listTableRows( + DefaultResultSetConfig<String, TableModelRowWithObject<MaterialSimpleFeatureVectorSummary>> resultSetConfig, + AsyncCallback<TypedTableResultSet<MaterialSimpleFeatureVectorSummary>> callback) + { + specificViewContext.getService().listMaterialFeaturesFromAllExperiments(resultSetConfig, + materialId, callback); + } + + @Override + protected void prepareExportEntities( + TableExportCriteria<TableModelRowWithObject<MaterialSimpleFeatureVectorSummary>> exportCriteria, + AbstractAsyncCallback<String> callback) + { + specificViewContext.getService().prepareExportMaterialFeaturesFromAllExperiments( + exportCriteria, callback); + } + + @Override + protected String translateColumnIdToDictionaryKey(String columnID) + { + return ID + "_" + columnID.toUpperCase(); + } + + public void dispose() + { + asDisposableWithoutToolbar().dispose(); + } +} diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExpermentsSection.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExpermentsSection.java new file mode 100644 index 0000000000000000000000000000000000000000..427026b5c69fe6804bcac80ce4ae5038768eba62 --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExpermentsSection.java @@ -0,0 +1,42 @@ +package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.Dict; +import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.DisplayTypeIDGenerator; + +/** + * Material section panel showing feature vector summaries from all experiments. + * + * @author Kaloyan Enimanev + */ +public class MaterialFeaturesFromAllExpermentsSection extends DisposableTabContent +{ + + private final IViewContext<IScreeningClientServiceAsync> screeningViewContext; + + private final IEntityInformationHolderWithIdentifier material; + + public MaterialFeaturesFromAllExpermentsSection( + IViewContext<IScreeningClientServiceAsync> screeningViewContext, + IEntityInformationHolderWithIdentifier material) + { + super(screeningViewContext.getMessage(Dict.MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION), + screeningViewContext, material); + this.screeningViewContext = screeningViewContext; + this.material = material; + setIds(DisplayTypeIDGenerator.MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION); + } + + @Override + protected IDisposableComponent createDisposableContent() + { + return MaterialFeaturesFromAllExperimentsGrid.create(screeningViewContext, new TechId( + material)); + } + +} \ No newline at end of file diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js index 6f45426bb0b0bac0a1f1c736e8501c8ca0be005d..2c72939e9753648050c4187af355b11ce7eab620 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/public/screening-dictionary.js @@ -95,6 +95,9 @@ material_replica_feature_summary_RANK: "Rank", material_replica_feature_summary_MEDIAN: "Median", material_replica_feature_summary_DEVIATION: "Deviation", +material_features_from_all_experiments_ASSAY: "Assay", +MATERIAL_FEATURES_FROM_ALL_EXPERIMENTS_SECTION: "Feature Vectors", + EXACT_MATCH_ONLY: "Exact Matches Only", WELLS_SEARCH_SHOW_COMBINED_RESULTS: "Show all matching results combined", WELL_SEARCH_NO_RESULTS_IN_ANY_EXP_FOUND: "All assays have been searched and no results match the query. Please check the spelling.", diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/MaterialFeatureVectorsFromAllExperimentsProvider.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/MaterialFeatureVectorsFromAllExperimentsProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..b0ee8b079113a49da527aff877042428df5f93b8 --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/MaterialFeatureVectorsFromAllExperimentsProvider.java @@ -0,0 +1,100 @@ +/* + * 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.client.web.server; + +import static ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.grids.MaterialFeatureVectorsFromAllExperimentsGridColumnIDs.EXPERIMENT; + +import java.util.List; + +import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.AbstractTableModelProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.CodeAndLabel; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TypedTableModel; +import ch.systemsx.cisd.openbis.generic.shared.util.IColumnGroup; +import ch.systemsx.cisd.openbis.generic.shared.util.TypedTableModelBuilder; +import ch.systemsx.cisd.openbis.plugin.screening.shared.IScreeningServer; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; + +/** + * A provider for material replica feature summaries. + * + * @author Kaloyan Enimanev + */ +class MaterialFeatureVectorsFromAllExperimentsProvider extends + AbstractTableModelProvider<MaterialSimpleFeatureVectorSummary> +{ + private final IScreeningServer server; + + private final String sessionToken; + + private final TechId materialId; + + public MaterialFeatureVectorsFromAllExperimentsProvider(IScreeningServer server, + String sessionToken, TechId materialId) + { + this.server = server; + this.sessionToken = sessionToken; + this.materialId = materialId; + } + + @Override + public TypedTableModel<MaterialSimpleFeatureVectorSummary> createTableModel() + { + TypedTableModelBuilder<MaterialSimpleFeatureVectorSummary> builder = + new TypedTableModelBuilder<MaterialSimpleFeatureVectorSummary>(); + List<MaterialSimpleFeatureVectorSummary> summaries = + server.getMaterialFeatureVectorsFromAllExperiments(sessionToken, materialId); + + builder.addColumn(EXPERIMENT); + createFeatureColumns(builder, summaries); + for (MaterialSimpleFeatureVectorSummary row : summaries) + { + addRow(builder, row); + } + + return builder.getModel(); + } + + private void createFeatureColumns(TypedTableModelBuilder<MaterialSimpleFeatureVectorSummary> builder, + List<MaterialSimpleFeatureVectorSummary> summaries) + { + IColumnGroup columnGroup = builder.columnGroup("FEATURES"); + for (MaterialSimpleFeatureVectorSummary summary : summaries) + { + for (CodeAndLabel codeAndLabel : summary.getFeatureDescriptions()) + { + columnGroup.column(codeAndLabel.getCode()).withTitle(codeAndLabel.getLabel()); + } + } + } + + private void addRow(TypedTableModelBuilder<MaterialSimpleFeatureVectorSummary> builder, + MaterialSimpleFeatureVectorSummary row) + { + builder.addRow(row); + builder.column(EXPERIMENT).addString(row.getExperiment().getCode()); + + float[] features = row.getFeatureVectorSummary(); + List<CodeAndLabel> descriptions = row.getFeatureDescriptions(); + for (int i = 0; i < features.length; i++) + { + CodeAndLabel description = descriptions.get(i); + builder.column(description.getCode()).addDouble((double) features[i]); + } + } + +} diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java index 15d27e1b107f9883f45249f158c379817faca765..4363260f6a16fd8623753a11c18fca029fb27aee 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/server/ScreeningClientService.java @@ -61,6 +61,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistr import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LogicalImageInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaFeatureSummary; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ScreeningConstants; @@ -371,4 +372,21 @@ public final class ScreeningClientService extends AbstractClientService implemen return prepareExportEntities(criteria); } + public TypedTableResultSet<MaterialSimpleFeatureVectorSummary> listMaterialFeaturesFromAllExperiments( + IResultSetConfig<String, TableModelRowWithObject<MaterialSimpleFeatureVectorSummary>> resultSetConfig, + TechId materialId) throws UserFailureException + { + MaterialFeatureVectorsFromAllExperimentsProvider provider = + new MaterialFeatureVectorsFromAllExperimentsProvider(server, getSessionToken(), + materialId); + return listEntities(provider, resultSetConfig); + } + + public String prepareExportMaterialFeaturesFromAllExperiments( + TableExportCriteria<TableModelRowWithObject<MaterialSimpleFeatureVectorSummary>> criteria) + throws UserFailureException + { + return prepareExportEntities(criteria); + } + } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java index 1f22d54c6627caa73f43d2b424970be5c74572d8..4a8fe7f1c55b58253c2dddc5406f519bccfffb0d 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServer.java @@ -96,6 +96,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageSampleCon import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LogicalImageInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaFeatureSummaryResult; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaSummaryAggregationType; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSummarySettings; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; @@ -300,12 +301,22 @@ public final class ScreeningServer extends AbstractServer<IScreeningServer> impl TechId experimentId) { Session session = getSession(sessionToken); - // NOTE: we want the settings t be passed form the client in future + // NOTE: we want the settings to be passed form the client in future MaterialSummarySettings settings = createDefaultSettings(); return ExperimentFeatureVectorSummaryLoader.loadExperimentFeatureVectors(session, businessObjectFactory, getDAOFactory(), experimentId, settings); } + public List<MaterialSimpleFeatureVectorSummary> getMaterialFeatureVectorsFromAllExperiments( + String sessionToken, TechId materialId) + { + Session session = getSession(sessionToken); + // NOTE: we want the settings to be passed form the client in future + MaterialSummarySettings settings = createDefaultSettings(); + return MaterialFeatureVectorSummaryLoader.loadMaterialFeatureVectorsFromAllAssays(session, + businessObjectFactory, getDAOFactory(), materialId, settings); + } + public static MaterialSummarySettings createDefaultSettings() { MaterialSummarySettings settings = new MaterialSummarySettings(); @@ -458,4 +469,5 @@ public final class ScreeningServer extends AbstractServer<IScreeningServer> impl return MINOR_VERSION; } + } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServerLogger.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServerLogger.java index 02cb5fb123251c6d132ad616b14d96d196c187b8..0850eac9fb5319422f313cd279698bbedcc97504 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServerLogger.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/ScreeningServerLogger.java @@ -58,6 +58,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageDatasetEn import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageSampleContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LogicalImageInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaFeatureSummaryResult; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellContent; @@ -361,4 +362,12 @@ final class ScreeningServerLogger extends AbstractServerLogger implements IScree materialId); return null; } + + public List<MaterialSimpleFeatureVectorSummary> getMaterialFeatureVectorsFromAllExperiments( + String sessionToken, TechId materialId) + { + logAccess(sessionToken, "getMaterialFeatureVectorsFromAllExperiments", + "sessionToken(%s), materialId(%s)", sessionToken, materialId); + return null; + } } 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 fff01a8fe0b38bb88b28fc0fad8e1c077e243ad3..1430c9256d587e62553293aebfb617393e52ccd3 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 @@ -37,13 +37,13 @@ import ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto.IWellExtendedD 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.MaterialIdFeatureVectorSummary; -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; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaFeatureSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaFeatureSummaryResult; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaSummaryAggregationType; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSummarySettings; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellContent; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/IScreeningServer.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/IScreeningServer.java index 3b317136f1ddcb58a70294adb6e55b951091e0d4..cd652f07192fae457a94eaec4100428a5d88b927 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/IScreeningServer.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/IScreeningServer.java @@ -51,6 +51,7 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageDatasetEn import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ImageSampleContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LogicalImageInfo; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialReplicaFeatureSummaryResult; +import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.MaterialSimpleFeatureVectorSummary; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateContent; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.PlateImages; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellContent; @@ -227,4 +228,13 @@ public interface IScreeningServer extends IServer public MaterialReplicaFeatureSummaryResult getMaterialFeatureVectorSummary(String sessionToken, @AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class) TechId experimentId, TechId materialId); + + /** + * Returns feature vectors from all experiments for a specified material. + */ + @Transactional(readOnly = true) + @RolesAllowed(RoleWithHierarchy.SPACE_OBSERVER) + public List<MaterialSimpleFeatureVectorSummary> getMaterialFeatureVectorsFromAllExperiments( + String sessionToken, TechId materialId); + } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/MaterialFeatureVectorsFromAllExperimentsResult.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/MaterialFeatureVectorsFromAllExperimentsResult.java new file mode 100644 index 0000000000000000000000000000000000000000..faccf8aeb705f1201fa13362ba515846f5fc72da --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/MaterialFeatureVectorsFromAllExperimentsResult.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.shared.basic.dto; + +import java.util.List; + +import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder; + +/** + * A result object delivering a material feature vector summaries for all experiments. + * + * @author Kaloyan Enimanev + */ +public class MaterialFeatureVectorsFromAllExperimentsResult implements ISerializable +{ + private static final long serialVersionUID = ServiceVersionHolder.VERSION; + + private Material material; + + private List<MaterialSimpleFeatureVectorSummary> summaries; + + // GWT only + @SuppressWarnings("unused") + private MaterialFeatureVectorsFromAllExperimentsResult() + { + } + + public MaterialFeatureVectorsFromAllExperimentsResult(Material material, + List<MaterialSimpleFeatureVectorSummary> summaries) + { + this.material = material; + this.summaries = summaries; + } + + public Material getMaterial() + { + return material; + } + + public List<MaterialSimpleFeatureVectorSummary> getSummaries() + { + return summaries; + } + +} 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/shared/basic/dto/MaterialSimpleFeatureVectorSummary.java similarity index 69% rename from screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/server/logic/dto/MaterialSimpleFeatureVectorSummary.java rename to screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/MaterialSimpleFeatureVectorSummary.java index de8b20c1aaec3d8e02f6c12f56b90288eac38c4a..ba74534835193d5f92c8558414786fbb02fd8496 100644 --- 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/shared/basic/dto/MaterialSimpleFeatureVectorSummary.java @@ -14,26 +14,37 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.plugin.screening.server.logic.dto; +package ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto; import java.util.List; +import ch.systemsx.cisd.openbis.generic.shared.basic.ISerializable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.CodeAndLabel; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder; /** * Stores feature vector summaries for one material and experiment. * * @author Tomasz Pylak */ -public class MaterialSimpleFeatureVectorSummary +public class MaterialSimpleFeatureVectorSummary implements ISerializable { - private final Experiment experiment; + private static final long serialVersionUID = ServiceVersionHolder.VERSION; + + private Experiment experiment; // has the same length as feature vectors summary - private final List<CodeAndLabel> featureDescriptions; + private List<CodeAndLabel> featureDescriptions; + + private float[] featureVectorSummary; - private final float[] featureVectorSummary; + // GTW + // TODO KE: create a separate DTO for the UI layer if there is enough time + @SuppressWarnings("unused") + private MaterialSimpleFeatureVectorSummary() + { + } public MaterialSimpleFeatureVectorSummary(Experiment experiment, List<CodeAndLabel> featureDescriptions, float[] featureVectorSummary) diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/grids/MaterialFeatureVectorsFromAllExperimentsGridColumnIDs.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/grids/MaterialFeatureVectorsFromAllExperimentsGridColumnIDs.java new file mode 100644 index 0000000000000000000000000000000000000000..07053fde320d6b7c39dfc9aa4b0ea57aa639a32c --- /dev/null +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/basic/dto/grids/MaterialFeatureVectorsFromAllExperimentsGridColumnIDs.java @@ -0,0 +1,27 @@ +/* + * 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.shared.basic.dto.grids; + +/** + * @author Kaloyan Enimanev + */ +public class MaterialFeatureVectorsFromAllExperimentsGridColumnIDs +{ + + public static final String EXPERIMENT = "ASSAY"; + +}