Skip to content

jump_target2 cannot be asked for a plate from particular sources #94

Description

@timtreis

jump_target2 takes plates=, a list of barcodes, with TARGET2_DEFAULT (ds/_datasets.py:36) holding eleven of them to mean "one plate from each source". The intent is not expressible by a caller: anyone who wants a different slice of the same idea, say two sources, or three plates from one source, has to name barcodes.

docs/tutorials/10_differential_features.ipynb shows the shape of the problem. It wants two sources and writes:

("jump_target2", lambda: mt.ds.jump_target2(plates=["BR00121438", "JCPQC051"])),

with a comment explaining the intent, because the API has no way to say it.

The source is available without new data: every file's s3_key is cpg0016-jump/source_N/workspace/..., and _plate(file.name) at ds/_datasets.py:68 already parses the file names for the batch. A _source(file) helper beside it, plus a sources= or n_per_source= argument, would express the default rather than freeze it.

Two arguments against doing it, which is why #79 kept the tuple and why this is an issue rather than a patch:

  • Deriving the default makes a public default depend on registry row order and on the S3 path shape. A reordered registry would silently change which plates mt.ds.jump_target2() returns.
  • The pinned tuple is greppable and diffable; a derived default is not.

A middle option is to keep the literal as the default and add sources= purely as a filter over it and over plates=None.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions