Data preparation

To apply one of the 11 guide assignment functions of the crispat package, we first have to create and save an AnnData object containing the gRNA counts for all cells. Depending on the format of your input data, this can either be done by using one of our import functions or for more customizability directly using the anndata package. In our package, we provide two functions that either read in cellranger output (create_anndata_from_cellranger) or a csv file with the gRNA-cell matrix (create_anndata_from_csv) to create the .h5ad file. If creating an AnnData object yourself, make sure to add a batch column to adata.obs even if you only have one batch (use same value for all cells in this case).

crispat.create_anndata_from_cellranger(batch_list, input_dir, save_dir)

Creates an AnnData object from cellranger output (one folder per batch named batch1, batch2,…)

Parameters:
  • batch_list (list) – list of batch numbers

  • input_dir (list) – directory containing the cellranger output of each batch

  • save_dir (str) – directory in which to save the AnnData object that is used as input for guide assignment

Returns:

None

crispat.create_anndata_from_csv(csv_file, save_dir)

Creates an AnnData object from a csv file (rows: gRNAs, columns: cells; name of first column: gRNA)

Parameters:
  • csv_file (str) – path of the csv file

  • save_dir (str) – directory in which to save the AnnData object that is used as input for guide assignment

Returns:

None