pypi cosg 1.1.3
cosg v1.1.3 - layer='auto' stops normalising twice

latest release: 1.2.0
one month ago

A patch release with one correctness fix and one packaging fix.

Fixed

  • run_cosg_cytome(layer='auto') double-normalised an already-normalised
    matrix.
    auto resolved RNA to log1p from a table keyed on the modality,
    without looking at the data. Because cytome.from_anndata stores whatever
    adata.X held under {modality}_counts — including a log-normalised
    matrix — any file written from normalised input had log1p applied a
    second time, while the function is documented as equivalent to
    cosg.cosg(adata).

    The damage was quiet rather than obvious: correlation with the in-memory
    reference stayed around 0.99, and specificity scores moved by up to
    0.11. That is small enough to pass a glance and large enough to change
    which genes rank as markers.

    auto now probes the stored matrix. When it is demonstrably not integer,
    the values are used as given — equivalent to layer='counts', which is what
    reproduces cosg.cosg on the AnnData the file came from — and a warning
    names the override. An explicit layer= is obeyed untouched.

  • The version had two sources of truth. pyproject.toml and
    cosg/__init__.py each carried a literal; they agree until a release bumps
    one. pyproject now declares the version dynamic and reads
    cosg.__version__.

Works with cytome 0.3.0

cytome 0.3.0 stops naming a matrix {modality}_counts unless it holds raw
integer counts, so a file converted from normalized data now carries
{modality}_data (or a name the writer chose) and no counts.

  • layer='auto' recognises that layout and reads the matrix that was
    adata.X, naming which one it picked rather than failing on a missing
    counts.
  • Where cytome records matrix_meta.is_integer, that is preferred over
    probing the values here. The writer decided it while the data was in hand;
    re-deriving it is what produced the dead probe described above.

The minimum cytome version is unchanged at 0.2.3. This release exists to
read older files correctly — the ones whose {modality}_counts may hold
normalized values — and requiring 0.3.0 would force an upgrade that helps none
of them. The dev extra does require 0.3.0, so the suite exercises the paths
only 0.3.0 produces instead of skipping them and reporting green.

Upgrading

If you have used run_cosg_cytome(layer='auto') on a cytome converted from a
normalised AnnData, re-run it — the previous result was computed on
doubly-normalised values. Runs on raw-count files are unaffected, and any run
that passed an explicit layer= was always correct.

pip install -U cosg

Don't miss a new cosg release

NewReleases is sending notifications on new releases.