diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/CsvToCanonicalFeatureVector.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/CsvToCanonicalFeatureVector.java index ae694fa322128f9e68fdf6b3c865ce4364f93270..692c16342052a88ce3c5e6da7664a78056018e55 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/CsvToCanonicalFeatureVector.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/CsvToCanonicalFeatureVector.java @@ -134,7 +134,8 @@ public class CsvToCanonicalFeatureVector CanonicalFeatureVector featureVector = new CanonicalFeatureVector(); CodeAndTitle codeAndTitle = new CodeAndTitle(column.name); ImgFeatureDefDTO featureDef = new ImgFeatureDefDTO(); - featureDef.setName(codeAndTitle.getTitle()); + featureDef.setLabel(codeAndTitle.getTitle()); + featureDef.setDescription(codeAndTitle.getTitle()); String code = codeAndTitle.getCode(); int count = counters.count(code); featureDef.setCode(count == 1 ? code : code + count); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/genedata/GenedataFormatToCanonicalFeatureVector.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/genedata/GenedataFormatToCanonicalFeatureVector.java index c898db971785e86b523c602a2c4d275651a3cb94..9b215c2b5b23850130b13cede92382e516ab2bb7 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/genedata/GenedataFormatToCanonicalFeatureVector.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/genedata/GenedataFormatToCanonicalFeatureVector.java @@ -84,7 +84,8 @@ public class GenedataFormatToCanonicalFeatureVector int count = counters.count(name); ImgFeatureDefDTO featureDef = new ImgFeatureDefDTO(); featureDef.setCode(count == 1 ? name : name + count); - featureDef.setName(name); + featureDef.setLabel(name); + featureDef.setDescription(name); featureVector.setFeatureDef(featureDef); PlateFeatureValues valuesValues = convertColumnToValues(geometry, feature); ImgFeatureValuesDTO values = new ImgFeatureValuesDTO(0., 0., valuesValues, 0); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/FeatureTableBuilder.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/FeatureTableBuilder.java index b8d9a74d66e421c926301a3ce2461f4d36a45c6e..d1298b70a013c6ad80ca254870dc72702302789b 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/FeatureTableBuilder.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/generic/server/FeatureTableBuilder.java @@ -116,18 +116,18 @@ public class FeatureTableBuilder final Bundle bundle = new Bundle(); final List<ImgFeatureDefDTO> featureDefinitions = dao.listFeatureDefsByDataSetId(dataSet.getId()); - final Map<String, ImgFeatureDefDTO> featureNameToDefMap = + final Map<String, ImgFeatureDefDTO> featureCodeToDefMap = new LinkedHashMap<String, ImgFeatureDefDTO>(); for (ImgFeatureDefDTO def : featureDefinitions) { - featureNameToDefMap.put(def.getName(), def); + featureCodeToDefMap.put(def.getCode(), def); } bundle.dataSet = dataSet; bundle.featureDefToValuesMap = new HashMap<ImgFeatureDefDTO, List<ImgFeatureValuesDTO>>(); bundles.add(bundle); if (useAllFeatures) { - featureNames.addAll(featureNameToDefMap.keySet()); + featureNames.addAll(featureCodeToDefMap.keySet()); } for (String featureName : featureNames) { @@ -136,7 +136,7 @@ public class FeatureTableBuilder featureNameToIndexMap.put(featureName, new Integer(featureNameToIndexMap.size())); } - final ImgFeatureDefDTO featureDefinition = featureNameToDefMap.get(featureName); + final ImgFeatureDefDTO featureDefinition = featureCodeToDefMap.get(featureName); if (featureDefinition != null) { List<ImgFeatureValuesDTO> featureValueSets = @@ -222,8 +222,8 @@ public class FeatureTableBuilder { break; } - Integer index = featureNameToIndexMap.get(featureDefinition.getName()); - assert index != null : "No index for feature " + featureDefinition.getName(); + Integer index = featureNameToIndexMap.get(featureDefinition.getCode()); + assert index != null : "No index for feature " + featureDefinition.getCode(); valueArray[index] = featureValues.getForWellLocation(wellPosition.getWellRow(), wellPosition .getWellColumn()); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/screening/server/DssServiceRpcScreening.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/screening/server/DssServiceRpcScreening.java index ce3d7bba1cff0650ea503fc1fe1ffc60e2ce68e7..a83dfdca794969ebd8420a8767a59357683dcae4 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/screening/server/DssServiceRpcScreening.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/screening/server/DssServiceRpcScreening.java @@ -123,7 +123,7 @@ public class DssServiceRpcScreening extends AbstractDssServiceRpc implements List<ImgFeatureDefDTO> featureDefinitions = getFeatureDefinitions(identifier); for (ImgFeatureDefDTO featureDefinition : featureDefinitions) { - String featureName = featureDefinition.getName(); + String featureName = featureDefinition.getLabel(); if (result.contains(featureName) == false) { result.add(featureName); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImgFeatureDefDTO.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImgFeatureDefDTO.java index f805891426e0e922e187e351e112a2147376099a..402505c40f112c82be70f6e445fbeec2089372d7 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImgFeatureDefDTO.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/ImgFeatureDefDTO.java @@ -32,8 +32,8 @@ public class ImgFeatureDefDTO extends AbstractHashable @AutoGeneratedKeys private long id; - @ResultColumn("NAME") - private String name; + @ResultColumn("LABEL") + private String label; @ResultColumn("CODE") private String code; @@ -48,9 +48,9 @@ public class ImgFeatureDefDTO extends AbstractHashable { } - public ImgFeatureDefDTO(String name, String description, long dataSetId) + public ImgFeatureDefDTO(String label, String description, long dataSetId) { - this.name = name; + this.label = label; this.description = description; this.dataSetId = dataSetId; } @@ -65,14 +65,14 @@ public class ImgFeatureDefDTO extends AbstractHashable this.id = id; } - public String getName() + public String getLabel() { - return name; + return label; } - public void setName(String name) + public void setLabel(String label) { - this.name = name; + this.label = label; } public void setCode(String code) diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/CsvToCanonicalFeatureVectorTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/CsvToCanonicalFeatureVectorTest.java index 9575906ecd113f40365a1aedb9a091d78d5874fc..7b22060aa295c42f3116418994234753b6ddacd7 100644 --- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/CsvToCanonicalFeatureVectorTest.java +++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/CsvToCanonicalFeatureVectorTest.java @@ -54,7 +54,7 @@ public class CsvToCanonicalFeatureVectorTest extends AssertJUnit // Check total cells feature CanonicalFeatureVector totalCells = fvs.get(0); ImgFeatureDefDTO def = totalCells.getFeatureDef(); - assertEquals("TotalCells", def.getName()); + assertEquals("TotalCells", def.getLabel()); assertEquals(1, totalCells.getValues().size()); ImgFeatureValuesDTO values = totalCells.getValues().get(0); PlateFeatureValues darr = values.getValues(); @@ -66,7 +66,7 @@ public class CsvToCanonicalFeatureVectorTest extends AssertJUnit // Check InfectionIndex CanonicalFeatureVector infectionIndex = fvs.get(2); def = infectionIndex.getFeatureDef(); - assertEquals("InfectionIndex", def.getName()); + assertEquals("InfectionIndex", def.getLabel()); assertEquals(1, infectionIndex.getValues().size()); values = infectionIndex.getValues().get(0); darr = values.getValues(); diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureVectorUploaderTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureVectorUploaderTest.java index c6bf246977abb88d3d7bf73e0d336a30378cf8b7..ef6e7b5eeff7b0f123f012beca5ed24093316fdc 100644 --- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureVectorUploaderTest.java +++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureVectorUploaderTest.java @@ -111,7 +111,7 @@ public class FeatureVectorUploaderTest extends AbstractDBTest private void verifyFeatureDef() { - assertEquals(TEST_FEATURE_NAME + count, featureDef.getName()); + assertEquals(TEST_FEATURE_NAME + count, featureDef.getLabel()); List<ImgFeatureValuesDTO> featureValuesList = dao.getFeatureValues(featureDef); assertEquals(1, featureValuesList.size()); featureValues = featureValuesList.get(0); diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/genedata/FeatureStorageProcessorTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/genedata/FeatureStorageProcessorTest.java index bd5de1755f222b84fc0b2924d62e04b750472bd7..268f2ae643052325d62e1c874fefcd3833a79a58 100644 --- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/genedata/FeatureStorageProcessorTest.java +++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/genedata/FeatureStorageProcessorTest.java @@ -100,6 +100,7 @@ public class FeatureStorageProcessorTest extends AbstractFileSystemTestCase will(returnValue(datasetId)); ImgFeatureDefDTO featureDTO = new ImgFeatureDefDTO("alpha", "alpha", datasetId); + featureDTO.setCode("alpha"); one(dao).addFeatureDef(with(equal(featureDTO))); will(returnValue((long) 1)); @@ -107,6 +108,7 @@ public class FeatureStorageProcessorTest extends AbstractFileSystemTestCase will(returnValue((long) 1)); featureDTO = new ImgFeatureDefDTO("beta", "beta", datasetId); + featureDTO.setCode("beta"); one(dao).addFeatureDef(with(equal(featureDTO))); will(returnValue((long) 2)); diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/genedata/GenedataFormatToCanonicalFeatureVectorTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/genedata/GenedataFormatToCanonicalFeatureVectorTest.java index 17ff9db8c628b31e1e1d0d4801b5d4b34e87f92f..c91cf5e3999dbd314fec7d8675df4f1134a6cdbc 100644 --- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/genedata/GenedataFormatToCanonicalFeatureVectorTest.java +++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/dss/etl/genedata/GenedataFormatToCanonicalFeatureVectorTest.java @@ -66,7 +66,7 @@ public class GenedataFormatToCanonicalFeatureVectorTest extends AbstractFileSyst private void verifyFeature(CanonicalFeatureVector feature, String featureName, float[] values) { ImgFeatureDefDTO featureDef = feature.getFeatureDef(); - assertEquals(featureName, featureDef.getName()); + assertEquals(featureName, featureDef.getLabel()); List<ImgFeatureValuesDTO> featureValues = feature.getValues(); assertEquals(1, featureValues.size()); ImgFeatureValuesDTO featureValue = featureValues.get(0); diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/FeatureVectorDAOTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/FeatureVectorDAOTest.java index e12e0316b4c5a927f04a0254b75ce8e7b9206e30..124fe4e0833fc9e44c33dde5701b6322e23042d5 100644 --- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/FeatureVectorDAOTest.java +++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/dataaccess/FeatureVectorDAOTest.java @@ -104,7 +104,7 @@ public class FeatureVectorDAOTest extends AbstractDBTest assertEquals(1, featureDefs.size()); ImgFeatureDefDTO featureDef = featureDefs.get(0); - assertEquals(TEST_FEATURE_NAME, featureDef.getName()); + assertEquals(TEST_FEATURE_NAME, featureDef.getLabel()); createFeatureValues(featureDef); List<ImgFeatureValuesDTO> featureValuesList = dao.getFeatureValues(featureDef);