diff --git a/bds/source/java/ch/systemsx/cisd/bds/DataSet.java b/bds/source/java/ch/systemsx/cisd/bds/DataSet.java index 5b2028d56feacf59810d93766abb8dac5fb0fa94..fd046108e8de26409d5fcc9d9a5dd54f21a05377 100644 --- a/bds/source/java/ch/systemsx/cisd/bds/DataSet.java +++ b/bds/source/java/ch/systemsx/cisd/bds/DataSet.java @@ -21,6 +21,8 @@ import java.util.Collections; import java.util.Date; import java.util.List; +import types.BooleanOrUnknown; + import ch.systemsx.cisd.bds.exception.DataStructureException; import ch.systemsx.cisd.bds.storage.IDirectory; import ch.systemsx.cisd.common.collections.CollectionIO; @@ -47,6 +49,8 @@ public final class DataSet implements IStorable static final String OBSERVABLE_TYPE = "observable_type"; static final String IS_MEASURED = "is_measured"; + + static final String IS_COMPLETE = "is_complete"; static final String PARENT_CODES = "parent_codes"; @@ -67,10 +71,12 @@ public final class DataSet implements IStorable * by means of some calculation from another data set. */ private final boolean isMeasured; - + /** The list of parent codes. Never <code>null</code> but could be empty. */ private final List<String> parentCodes; + private BooleanOrUnknown isComplete = BooleanOrUnknown.UNKNOWN; + /** * Creates an instance of data set. * @@ -141,6 +147,11 @@ public final class DataSet implements IStorable { return parentCodes; } + + public final void setComplete(boolean complete) + { + isComplete = BooleanOrUnknown.resolve(complete); + } /** * Loads the experiment identifier from the specified directory. @@ -176,6 +187,7 @@ public final class DataSet implements IStorable folder.addKeyValuePair(PRODUCER_CODE, StringUtils.emptyIfNull(producerCode)); folder.addKeyValuePair(IS_MEASURED, Boolean.toString(isMeasured).toUpperCase()); folder.addKeyValuePair(OBSERVABLE_TYPE, observableTypeCode); + folder.addKeyValuePair(IS_COMPLETE, isComplete.toString()); final String value; if (parentCodes.size() > 0) { diff --git a/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageFormatV1_0.java b/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageFormatV1_0.java index d38400f12eff3eb6712e17f320f6c1f7651d3454..ba1d20fdebb67bef82a8009e546e3aae1c4885c9 100644 --- a/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageFormatV1_0.java +++ b/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageFormatV1_0.java @@ -52,10 +52,8 @@ public final class HCSImageFormatV1_0 extends Format * These parameters are located in <code>metadata/parameters</code>. * </p> */ - private final static String[] FORMAT_PARAMETERS = - new String[] - { PlateGeometry.PLATE_GEOMETRY, WellGeometry.WELL_GEOMETRY, NUMBER_OF_CHANNELS, - CONTAINS_ORIGINAL_DATA }; + private final static String[] FORMAT_PARAMETERS = new String[] + { WellGeometry.WELL_GEOMETRY, NUMBER_OF_CHANNELS, CONTAINS_ORIGINAL_DATA }; /** * The one and only one instance. diff --git a/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageFormattedData.java b/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageFormattedData.java index 30a53c9252e4699ccea69e8938e78ae783340137..1431c801929ed71bf19930abd7eb58eb26b4a86f 100644 --- a/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageFormattedData.java +++ b/bds/source/java/ch/systemsx/cisd/bds/hcs/HCSImageFormattedData.java @@ -59,17 +59,17 @@ public final class HCSImageFormattedData extends AbstractFormattedData implement return (Boolean) getFormatParameters().getValue(HCSImageFormatV1_0.CONTAINS_ORIGINAL_DATA); } - private final Geometry getWellGeometry() + public final Geometry getWellGeometry() { return (Geometry) getFormatParameters().getValue(WellGeometry.WELL_GEOMETRY); } - private final Geometry getPlateGeometry() + public final Geometry getPlateGeometry() { return (Geometry) getFormatParameters().getValue(PlateGeometry.PLATE_GEOMETRY); } - private final int getChannelCount() + public final int getChannelCount() { return ((Integer) getFormatParameters().getValue(HCSImageFormatV1_0.NUMBER_OF_CHANNELS)) .intValue(); @@ -169,20 +169,20 @@ public final class HCSImageFormattedData extends AbstractFormattedData implement // IHCSFormattedData // - public final INode tryGetStandardNodeAt(final int channel, final Location plateLocation, - final Location wellLocation) + public final INode tryGetStandardNodeAt(final int channel, final Location wellLocation, + final Location tileLocation) { - checkCoordinates(channel, plateLocation, wellLocation); + checkCoordinates(channel, wellLocation, tileLocation); try { final IDirectory standardDir = getStandardDataDirectory(); final IDirectory channelDir = Utilities.getSubDirectory(standardDir, getChannelName(channel)); final IDirectory plateRowDir = - Utilities.getSubDirectory(channelDir, getPlateRowDirName(plateLocation)); + Utilities.getSubDirectory(channelDir, getPlateRowDirName(wellLocation)); final IDirectory plateColumnDir = - Utilities.getSubDirectory(plateRowDir, getPlateColumnDir(plateLocation)); - return plateColumnDir.tryGetNode(createWellFileName(wellLocation)); + Utilities.getSubDirectory(plateRowDir, getPlateColumnDir(wellLocation)); + return plateColumnDir.tryGetNode(createWellFileName(tileLocation)); } catch (final DataStructureException e) { return null; @@ -190,28 +190,28 @@ public final class HCSImageFormattedData extends AbstractFormattedData implement } public final NodePath addStandardNode(final File imageRootDirectory, - final String imageRelativePath, final int channel, final Location plateLocation, - final Location wellLocation) throws DataStructureException + final String imageRelativePath, final int channel, final Location wellLocation, + final Location tileLocation) throws DataStructureException { assert imageRootDirectory != null : "Given image root directory can not be null."; assert imageRelativePath != null : "Given image relative path can not be null."; - INode node = tryGetStandardNodeAt(channel, plateLocation, wellLocation); + INode node = tryGetStandardNodeAt(channel, wellLocation, tileLocation); if (node != null) { throw new DataStructureException( String .format( "A node already exists at channel %d, plate location '%s' and well location '%s'.", - channel, plateLocation, wellLocation)); + channel, wellLocation, tileLocation)); } final IDirectory standardDir = getStandardDataDirectory(); final IDirectory channelDir = Utilities.getOrCreateSubDirectory(standardDir, getChannelName(channel)); final IDirectory plateRowDir = - Utilities.getOrCreateSubDirectory(channelDir, getPlateRowDirName(plateLocation)); + Utilities.getOrCreateSubDirectory(channelDir, getPlateRowDirName(wellLocation)); final IDirectory plateColumnDir = - Utilities.getOrCreateSubDirectory(plateRowDir, getPlateColumnDir(plateLocation)); - final String wellFileName = createWellFileName(wellLocation); + Utilities.getOrCreateSubDirectory(plateRowDir, getPlateColumnDir(wellLocation)); + final String wellFileName = createWellFileName(tileLocation); if (containsOriginalData()) { final IDirectory imageRootDirectoryNode = getImageRootDirectoryNode(imageRootDirectory); @@ -236,7 +236,7 @@ public final class HCSImageFormattedData extends AbstractFormattedData implement String .format( "Original file name '%s' could not be added at channel %d, plate location '%s' and well location '%s'.", - imageRelativePath, channel, plateLocation, wellLocation)); + imageRelativePath, channel, wellLocation, tileLocation)); } final char sep = Constants.PATH_SEPARATOR; final String standardNodePath = diff --git a/bds/source/java/ch/systemsx/cisd/bds/hcs/IHCSImageFormattedData.java b/bds/source/java/ch/systemsx/cisd/bds/hcs/IHCSImageFormattedData.java index 5848633e11c91a358b02b51152dce73801582732..090fe2d423d61d4b7023d16e39b3308f38d10708 100644 --- a/bds/source/java/ch/systemsx/cisd/bds/hcs/IHCSImageFormattedData.java +++ b/bds/source/java/ch/systemsx/cisd/bds/hcs/IHCSImageFormattedData.java @@ -31,9 +31,29 @@ import ch.systemsx.cisd.bds.storage.INode; */ public interface IHCSImageFormattedData extends IFormattedData { + /** + * Returns <code>true</code> if the data structure contains the original data. + */ + public boolean containsOriginalData(); + + /** + * Returns the number of channels. + */ + public int getChannelCount(); + + /** + * Returns the geometric arrangement of the tiles of a well. + */ + public Geometry getWellGeometry(); + + /** + * Returns the geometric arrangement of the wells of a plate. + */ + public Geometry getPlateGeometry(); + /** - * For given <var>channel</var>, given <var>plateLocation</var> and given <var>wellLocation</var> + * For given <var>channel</var>, given <var>wellLocation</var> and given <var>tileLocation</var> * returns the corresponding <code>INode</code> (found in <code>data/standard</code> * directory). * @@ -41,8 +61,8 @@ public interface IHCSImageFormattedData extends IFormattedData * <code>data/original</code> directory or a {@link IFile} that can be extracted * somewhere. Might return <code>null</code>. */ - public INode tryGetStandardNodeAt(final int channel, final Location plateLocation, - final Location wellLocation); + public INode tryGetStandardNodeAt(final int channel, final Location wellLocation, + final Location tileLocation); /** * Adds a new image file at given coordinates. @@ -57,8 +77,9 @@ public interface IHCSImageFormattedData extends IFormattedData * @throws DataStructureException if a node already exists at given coordinates. */ public NodePath addStandardNode(final File imageRootDirectory, final String imageRelativePath, - final int channel, final Location plateLocation, final Location wellLocation) + final int channel, final Location wellLocation, final Location tileLocation) throws DataStructureException; + // // Helper classes