scPyviewer.prepare.prepare#

scPyviewer.prepare.prepare(in_path, out_path, group_key=None, n_top_genes=2000, do_tsne=True, convert_csc=True, backed_only=False)[source]#

Prepare an AnnData for the scPyviewer app.

convert_csc controls whether X is converted to CSC format (fastest backed column access) at the cost of 2x peak RAM for the conversion step. Pass False when RAM is limited; gene-expression coloring will work but will read the entire matrix per gene (much slower).

backed_only=True (or auto-triggered when file > 0.66x available RAM) keeps X on disk the entire time – skips normalisation and DE, but peak RAM stays under 3 GB regardless of file size.

Parameters:
  • in_path (str)

  • out_path (str)

  • group_key (str | None)

  • n_top_genes (int)

  • do_tsne (bool)

  • convert_csc (bool)

  • backed_only (bool)

Return type:

dict[str, Any]