Skip to main content

CHiMP (Crystal Hits in My Plate) is a deep learning system to help researchers work with micrographs of protein crystallisation experiments. XChem CHiMP consists of one component:

1. CHiMP Detector. This uses an object detection network to find the position of any crystals and drops in the image and uses this information to calculate a coordinate for dispensing compound using the Echo.

Installation

pip install chimpflow

chimpflow --version

Model file for xchem-chimp

The model file is saved in:

https://gitlab.diamond.ac.uk/xchem/xchem-chimp-models

This file is too large for github.

For GitHub pytest to find the file in its CI/CD Actions, this file has been uploaded to zenodo:

https://zenodo.org/record/7810708/2022-12-07_CHiMP_Mask_R_CNN_XChem_50eph_VMXi_finetune_DICT_NZ.pytorch

The tests/conftest.py fetches this file automatically.

Running

rm -rf detector_output
python -m detect_folder_chimp \
    --echo --preview \
    --num_classes=3 \
    --MODEL_PATH=src/xchem_chimp/detector/model/2022-12-07_CHiMP_Mask_R_CNN_XChem_50eph_VMXi_finetune_DICT_NZ.pytorch \
    --IMAGE_PATH=tests/SubwellImages/97wo_2021-09-14_RI1000-0276-3drop

you can expect something like:

20-Mar-23 08:09:21 - INFO - Loading libraries...
20-Mar-23 08:09:21 - DEBUG - Loading model from src/xchem_chimp/detector/model/2022-12-07_CHiMP_Mask_R_CNN_XChem_50eph_VMXi_finetune_DICT_NZ.pytorch
20-Mar-23 08:09:21 - INFO - Making directory for detector output: /27/xchem-chimp/detector_output
20-Mar-23 08:09:21 - DEBUG - extracting coordinates...
20-Mar-23 08:09:25 - DEBUG - create_detector_output_dict: 97wo_01A_1.jpg - Number of objects found: 33
20-Mar-23 08:09:25 - DEBUG - 1 drops, 32 crystals over prob threshold
20-Mar-23 08:09:26 - DEBUG - Extracting Echo coordinate from distance transform.
20-Mar-23 08:09:27 - DEBUG - Calculating well centroids...
20-Mar-23 08:09:27 - DEBUG - Loading background images
20-Mar-23 08:09:27 - DEBUG - Well centroid found at (504, 600)

Development questions

  • Is the folder src/xchem_chimp/detector/background_images needed in the distribution?

  • Where best to put model_file for unit testing?

  • Is torchvision a necessary dependency for runtime?

  • How are the model files built?

  • Why are there so many mypy problems in coord_generator.py and detector_utils.py?

  • How significant is this: DeprecationWarning: Please use gaussian_filter from the scipy.ndimage namespace, the scipy.ndimage.filters namespace is deprecated.

  • Do we need to keep anything in the zocalo directory?

  • Is there some example image where target_position is properly calculated?

Documentation

See https://www.cs.diamond.ac.uk/chimpflow for more detailed documentation.

Building and viewing the documents locally:

git clone git+https://gitlab.diamond.ac.uk/scisoft/bxflow/chimpflow.git
cd chimpflow
virtualenv /scratch/$USER/venv/chimpflow
source /scratch/$USER/venv/chimpflow/bin/activate
pip install -e .[dev]
make -f .chimpflow/Makefile validate_docs
browse to file:///scratch/$USER/venvs/chimpflow/build/html/index.html

Topics for further documentation:

  • TODO list of improvements

  • change log

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xchem-chimp-1.0.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xchem_chimp-1.0.1-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

File details

Details for the file xchem-chimp-1.0.1.tar.gz.

File metadata

  • Download URL: xchem-chimp-1.0.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for xchem-chimp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1caba9520f7c2adcfd0388af7cd8f28faf6e5a4c36e8051971915356f483c971
MD5 7617b7a1a56a137d9110e35510657611
BLAKE2b-256 5b5c2e77b91a86aeb6d79e77369680c6b0f3fc99e005a954ba3d6297a4c11ac7

See more details on using hashes here.

File details

Details for the file xchem_chimp-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: xchem_chimp-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 46.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for xchem_chimp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4076662b0e458515c5ff8d2ef8c068d6134859c0273bd5fdc5f3f3e4ce06c52
MD5 60b66e8497a70f41c7badda8bed5d6a9
BLAKE2b-256 73ebcac079e6b946a39d271af521b2fde1cdf4a8bd59db097659e022da7f00a1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page