mxcubecore.HardwareObjects.Murko

Client of a murko server, loop and crystal segmentation of sample images.

murko: https://github.com/MartinSavko/murko. The server answers zmq REQ requests; the client needs pyzmq, which is only imported when it is used. Install it with the optional dependency: pip install “mxcubecore[murko]”.

Example yaml configuration:

class: mxcubecore.HardwareObjects.Murko.Murko configuration:

host: murko-server port: 8901 timeout: 10

Classes

Murko(name)

Asks murko where the loop is in an image.

MurkoPrediction

Where murko sees the loop, in fractions of the image size.

Exceptions

MurkoUnavailable

Murko cannot be reached, the queue should not go on without it.

class mxcubecore.HardwareObjects.Murko.Murko(name: str)[source]

Bases: HardwareObject

Asks murko where the loop is in an image.

Parameters:

name (str)

class HOConfig(*, host: str = 'localhost', port: int = 8901, timeout: float = 10, **extra_data: Any)[source]

Bases: HOConfig

Parameters:
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

is_available() → bool[source]

True when the murko server accepts connections.

Return type:

bool

predict(image) → MurkoPrediction | None[source]

Find the loop in image.

Parameters:

image – the image, as an array or JPEG bytes.

Returns:

None when no loop is seen, otherwise where the loop is.

Raises:

MurkoUnavailable – when murko does not answer within the timeout.

Return type:

MurkoPrediction | None

class mxcubecore.HardwareObjects.Murko.MurkoPrediction[source]

Bases: TypedDict

Where murko sees the loop, in fractions of the image size.

exception mxcubecore.HardwareObjects.Murko.MurkoUnavailable[source]

Bases: RuntimeError

Murko cannot be reached, the queue should not go on without it.