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

feat: run / tiltseries s3 data validation (zarr, mrc, mdoc, and metadata checks) #223

Merged
merged 72 commits into from
Sep 4, 2024

Conversation

daniel-ji
Copy link
Contributor

@daniel-ji daniel-ji commented Aug 25, 2024

…i/s3-data-validation-dataset-deposition-photos
…i/s3-data-validation-dataset-deposition-photos
… into daniel-ji/s3-data-validation-frames-gains
@daniel-ji daniel-ji marked this pull request as ready for review August 27, 2024 22:13
@daniel-ji daniel-ji changed the base branch from daniel-ji/s3-data-validation-frames-gains to main August 27, 2024 22:21
@daniel-ji daniel-ji changed the base branch from main to daniel-ji/s3-data-validation-frames-gains August 27, 2024 22:21
@daniel-ji daniel-ji changed the title Add run / tiltseries s3 data validation (rawtlts, tlts, zarr, mrc, mdoc, and metadata checks) Add run / tiltseries s3 data validation (zarr, mrc, mdoc, and metadata checks) Aug 28, 2024
@daniel-ji daniel-ji force-pushed the daniel-ji/s3-data-validation-frames-gains branch from 84da6a5 to 251214b Compare August 28, 2024 02:57
@daniel-ji daniel-ji force-pushed the daniel-ji/s3-data-validation-tiltseries branch from 9ad946a to 1deb4ab Compare August 28, 2024 03:00
Comment on lines 58 to 59
for ex in exclude:
tentatives = [tent for tent in tentatives if ex not in tent]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check should be a part of the fixture that generates the run_names and not be done here. Which it already is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in a later pr, see #250


zarrays = header_data["zarrays"]
for i, zarray in zarrays.items():
header = self.mrc_headers[mrc_file].header
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could this header be outside the for loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

Comment on lines 110 to 122
### BEGIN MDOC consistency tests ###
def test_tiltseries_pixel_spacing_mdoc(self, tiltseries_metadata: Dict, tiltseries_mdoc: pd.DataFrame):
"""Check that the tiltseries pixel spacing matches the MDOC data."""
assert len(set(tiltseries_mdoc["PixelSpacing"])) == 1
assert tiltseries_metadata["pixel_spacing"] == tiltseries_mdoc["PixelSpacing"][0]

def test_tiltseries_image_size_mdoc(self, tiltseries_metadata: Dict, tiltseries_mdoc: pd.DataFrame):
"""Check that the tiltseries image size matches the MDOC data."""
assert len(set(tiltseries_mdoc["ImageSize"])) == 1
assert tiltseries_metadata["size"]["x"] == tiltseries_mdoc["ImageSize"][0][0]
assert tiltseries_metadata["size"]["y"] == tiltseries_mdoc["ImageSize"][0][1]

### END MDOC consistency tests ###
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the mdoc files are saved along with the tiltseries at the moment, they are associated to the frames. As, there is processing to go from frames to tiltseries, it is very unlikely for us to have the same Image size or pixel spacings. So, these two tests are more likely to fail and that is the expected behaviour.

Base automatically changed from daniel-ji/s3-data-validation-frames-gains to main September 3, 2024 00:28
@daniel-ji daniel-ji changed the title Add run / tiltseries s3 data validation (zarr, mrc, mdoc, and metadata checks) feat: run / tiltseries s3 data validation (zarr, mrc, mdoc, and metadata checks) Sep 3, 2024
@daniel-ji daniel-ji merged commit 9be9481 into main Sep 4, 2024
9 checks passed
@daniel-ji daniel-ji deleted the daniel-ji/s3-data-validation-tiltseries branch September 4, 2024 22:31
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

Successfully merging this pull request may close these issues.

2 participants