API

You can import perturbseq as:

import perturbseq as perturb

Note

Testnote

Preprocessing: pp

Perturbation assignments and queries

pp.compute_TPT(gbcs_dataset)

Compute transcript per transcript

pp.get_perturbations(adata_here[, …])

Get a list of perturbations in the dataset

pp.perturb_overlap_obs(perturbation_list, …)

Get perturbations present as obs

pp.annotate_controls(adata_here, …[, …])

Make obs with control guides

pp.subset_singly_perturbed(adata_here[, …])

Keep only cells with one perturbation

pp.perturbs_per_cell(adata_here[, …])

Number of perturbations per cell

pp.cells_per_perturb(adata_here[, …])

Counts the number of cells for each perturbation.

pp.delete_guides_from_varnames(adata_here[, …])

Delete perturbations from adata.var_names

Sub/down-sampling

pp.subsample_cells(adata_here, num_cells, …)

Subsample cells/perturbation

pp.downsample_counts(adata_here, …[, my_rng])

Downsample counts per cell to a fraction

Summarization across perturbations

pp.obs_mean(adata_here, grouping_variable, obs)

Get the mean of an obs across pre-defined groups.

pp.score_programs(adata_here[, …])

Get program score for each cell, by averaging program genes

Preparing for modeling

pp.obs_to_design_matrix(adata_here, obs_names)

Design matrix for linear model from obs

pp.split_train_valid_test(adata_here[, …])

Split cells into training, validation and test

Tools: tl

tl.moi(adata_here[, perturbations_obs, …])