Truth

Contents

Truth#

missionbio.demultiplex.protein.truth.Truth

class Truth(celltypes: Sequence[CellType] = (), version: str = 'NA')#

A phylogenetic tree of cell types.

Input and Output#

copy()

Returns a deep copy of the truth.

read_panel(path)

Reads the truth from a csv panel file.

read_yaml(path)

Reads a truth from a YAML file.

to_yaml(path, version)

Writes the truth to a YAML file.

signature()

returns:

A signature matrix of the truth. 1 for ab+, 0 for ab-,

Handling#

cellnames()

Returns a list of cell type names.

add_doublets()

Adds doublets to the truth.

get()

Returns the cell type with the specified name.

has_cell(cell)

Checks if the truth has a cell type with the specified name.

add_cell(cell, expression[, parent, append, ...])

Add a celltype to the truth.

del_cell(name[, check_valid])

Delete a clone from the truth.

add_ab(expression, cell)

Add an antibody to a cell type and all its descendants

del_ab(antibody[, cell])

Delete an antibody from the truth.

trim(name[, include, check_valid])

Trim the truth to remove the given cell and all its descendants.

isolate(name[, include, check_valid])

Isolate the truth to only contain the given cell and its descendants.

Plotting#

set_color(name, color[, recursive])

Set the color of a cell type.

palette()

Get the palette of the truth.

plot([cutoff, width, unique])

Plot the truth as a tree.

Validity checks#

complete()

returns:

True, when all the celltypes contain the expression of

is_panel_compatible(path)

Checks if the panel can be read using read_panel and is compatible with hashing.

assert_valid()

Assert that the truth is valid.

param celltypes:

A list of cell types.

param version:

The version of the truth.