Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCS and handling of row/column index keys #33

Closed
sbesson opened this issue May 6, 2022 · 1 comment
Closed

HCS and handling of row/column index keys #33

sbesson opened this issue May 6, 2022 · 1 comment

Comments

@sbesson
Copy link
Member

sbesson commented May 6, 2022

See original report from @pwalczysko in #31 (comment)_

Index keys for the well rows/columns were initially introduced in glencoesoftware/bioformats2raw#91 and first released in the version 0.3.0 of bioformats2raw.

These keys have been formalized and specified upstream in the OME-NGFF 0.4 specification - see https://ngff.openmicroscopy.org/0.4/#plate-md. As part of this specification, they have been renamed as rowIndex and columnIndex to match the naming style for new keys.

In both cases, these indices are expected to be integers.

String wellCol = (String) well.get("column_index");
String wellRow = (String) well.get("row_index");
String well_id = MetadataTools.createLSID("Well", wellCount);
store.setWellID(well_id, 0, w);
String[] parts = wellPath.split("/");
if (wellRow == null || wellRow.isEmpty()) {
wellRow = parts[parts.length - 2];
}
if (wellCol == null || wellCol.isEmpty()) {
wellCol = parts[parts.length - 1];
}
int rowIndex = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(wellRow.toUpperCase());
if (rowIndex == -1) {
rowIndex = Integer.parseInt(wellRow);
}
int colIndex = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(wellCol.toUpperCase());
if (colIndex == -1) {
colIndex = Integer.parseInt(wellCol);
}
currently handles legacy keys and casts them as strings. This leads to exceptions when dealing with HCS generated with bioformats2raw 0.4.0.

For the OME-NGFF 0.4.0 specification, we should at minimum read the rowIndex/columnIndex keys as Integer.

This leaves a few open questions related to the support of old and new datasets:

  • should the column_index/row_index keys still be parsed to handle OME-NGFF 0.2 datasets created by `bioformats2raw 0.3.x and 0.4.x?
  • for OME-NGFF 0.4 plates, should we keep the fallback mechanism parsing the well paths be maintained or should the reader on the absence of rowIndex and/or columnIndex since these fields are required.

The last item more generally raises the question of how lenient vs strictly compliant the reader should be. If there is a use case for both behaviors, this is possible something worth putting under an option.

@dgault
Copy link
Member

dgault commented May 12, 2022

With the latest commits on #31, the reader should now handle 3 different scenarios for the row and column indexes:

  • parsing rowIndex/columnIndex for NGFF v0.4 data
  • parsing column_index/row_index as per BF2raw 0.3 and 0.4
  • fallback to parsing the data out of the path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants