COSG v1.1.1
pip install -U cosg
v1.1.1 is code-identical to v1.1.0. It fixes the PyPI project page, which
showed a single sentence instead of the README — the packaging metadata pointed
at an inline string rather than at README.rst, so the long description was
never included. Everything below shipped in v1.1.0 and is repeated here because
that page never displayed it.
Streaming backend for .cytome datasets
cosg.cosg() is now a single polymorphic entry point — pass an AnnData, a
path to a .cytome file, or an open CytomeDataset:
import cosg
markers = cosg.cosg(adata, groupby="cell_type") # in memory
markers = cosg.cosg("atlas.cytome", groupby="cell_type") # streamed from disk
On the streaming path the file is read in chunks, so peak memory is set by the
batch size rather than by the number of cells. An open CytomeDataset stays
open — COSG does not close a dataset it did not open.
A GPU path (CuPy) is selectable with device='cpu' | 'gpu' | 'auto' on both
the in-memory and streaming paths.
Also in the streaming backend: batch_key now applies to the streaming, GPU
and feature-batched paths, and output_format='dict' | 'long' | 'dense'
controls the shape of the result.
cosg.__version__ exists; it previously raised AttributeError.
scanpy is now an optional extra
Only plotMarkerDotplot needs it, so a plain pip install cosg is roughly
60 MB and 9 packages lighter than before.
pip install 'cosg[dotplot]'
Calling plotMarkerDotplot without it raises an error naming the extra.
plotMarkerDendrogram and plotMarkerStream do not need scanpy — the
cell-type ordering that previously came from scanpy.tl.dendrogram is now
computed internally and reproduces it exactly.
The cytome backend is an optional extra too
pip install 'cosg[cytome]'
Same rule: an optional feature is not charged to every install. Calling
cosg.cosg() on a .cytome path without the extra raises an error naming it,
rather than the function appearing not to exist.
The default streaming path no longer requires PIASO
layer='log1p' — the default for RNA — is computed by COSG itself and returns
identical values to the implementation it replaced, so earlier results
reproduce. Only layer='infog' and layer='tfidf' require PIASO, since those
are PIASO normalizations; that message now gives the correct install command,
pip install piaso-tools.
Using COSG with PIASO
PIASO 1.2.0 requires cosg>=1.1.0 for its cytome marker path.
BSD-3-Clause. If COSG is useful in your work, please cite:
Dai M, Pei X, Wang X-J. Accurate and fast cell marker gene identification
with COSG. Briefings in Bioinformatics, 2022.