How do I get a well coordinate ("A1" row col etc) from a resource?

I am looking at a backend implementation. The interface has

  async def aspirate(
    self,
    ops: List[Aspiration],
    use_channels: List[int],
    **backend_kwargs,
  ):
  .....
  .....

I need to get a well name (like “A1”).
I can see that an Aspiration object has a Container resource. Can I safely assume that the resource in an Aspiration object always has ordered_items which are either str or Well type, containing the well name?

I assume here that ordered_items are the positions or Wells, and that ordering is something else, is that correct?

1 Like

you cannot assume that the container is always a well in a canonical plate, it may also be a trough, petri dish, etc. If the dc1 only supports plates, that’s fine for now, just raise an error when the container is not a Well. In the future, we can probably hack something together for the other containers.

there is no convenient api for getting the canonical index of a resource yet. i will add it. for now you can use this:

plate = well.parent  # well = op.resource
child_idx = plate.children.index(well)
plate._ordering[child_idx]

Thanks, I’ll give that a go.
willem

you can now use {Well,TipSpot}.get_identifier

1 Like

Fab, thanks very much - will give that a go, hopefully soon.

1 Like