besca.pp Package

Functions

filter(adata[, max_genes, min_genes, ...])

Filter cell outliers based on counts, numbers of genes expressed, number of cells expressing a gene and mitochondrial gene content.

filter_gene_list(adata, filepath[, use_raw, ...])

Function to remove all genes specified in a gene list read from file.

frac_pos(adata[, threshold])

Calculate the fraction of cells positive for expression of a gene.

frac_reads(adata)

Cacluate the fraction of reads being attributed to a specific gene.

mean_expr(adata)

Calculate the mean expression of a gene.

top_expressed_genes(adata[, top_n])

Give out the genes most frequently expressed in cells.

fraction_counts(adata[, species, name, ...])

Function to calculate fraction of counts per cell from a gene list.

top_counts_genes(adata[, top_n])

Give out the genes that contribute the largest fraction to the total UMI counts.

normalize_geometric(adata)

Perform geometric normalization on CITEseq data.

valOutlier(adata[, nmads, rlib_loc])

Estimates and returns the thresholds to use for gene/cell filtering based on outliers calculated from the deviation to the median QCs.

scTransform(adata[, hvg, n_genes, rlib_loc])

Function to call scTransform normalization or HVG selection from Python.

besca.pl Package

Functions

kp_genes(adata[, threshold, min_genes, ax, ...])

visualize the minimum gene per cell threshold.

kp_counts(adata[, min_counts, ax, figsize])

visualize the minimum UMI counts per cell threshold.

kp_cells(adata[, threshold, min_cells, ax, ...])

visualize the minimum number of cells expressing a gene threshold.

max_counts(adata[, max_counts, ax, figsize])

visualize maximum UMI counts per cell threshold.

max_genes(adata[, max_genes, ax, figsize])

visualize maximum number of genes per cell threshold.

max_mito(adata[, max_mito, annotation_type, ...])

visualize maximum mitochondrial gene percentage threshold.

dropouts(adata[, ax, bins, figsize])

Plot number of dropouts.

detected_genes(adata[, ax, bins, figsize])

Plot number of detected genes.

library_size(adata[, ax, bins, figsize])

Plot library size.

librarysize_overview(adata[, bins, figsize])

Generates overview figure of libarysize, dropouts and detected genes.

transcript_capture_efficiency(adata[, ax, ...])

Plot total gene counts vs detection probability.

top_genes_counts(adata[, top_n, ax, figsize])

plot top n genes that contribute to fraction of counts per cell

gene_expr_split(adata, genes[, ...])

visualize gene expression of two groups as a split violin plot

gene_expr_split_stacked(adata, genes, ...[, ...])

Stacked violin plot for visualization of genes expression.

box_per_ind(plotdata, y_axis, x_axis[, ...])

plot boxplot with values per individual.

stacked_split_violin(tidy_data, x_axis, ...)

plot stacked split violin plots.

celllabel_quant_boxplot(adata, ...[, ...])

generate a box and whisker plot with overlayed swarm plot of celltype abundances

celllabel_quant_stackedbar(adata, ...[, ...])

Generate a stacked bar plot of the percentage of labelcounts within each AnnData subset

dot_heatmap(adata, genes[, group_by, ...])

Generate a dot plot, filled with heatmap of individuals cells gene expression.

dot_heatmap_split(adata, genes, split_by[, ...])

Generate a dot plot, filled with heatmap of individuals cells gene expression to compare two conditions.

dot_heatmap_split_greyscale(adata, genes, ...)

Generate a dot plot, filled with heatmap of individuals cells gene expression to compare two conditions (greyscale).

update_qualitative_palette(adata, palette[, ...])

Update adata object such that the umap will adhere to the palette provided.

nomenclature_network(config_file[, ...])

Plot a nomenclature network based on annotation config file.

riverplot_2categories(adata, categories[, ...])

Generate a riverplot/sanker diagram between two categories.

flex_dotplot(df, X, Y, HUE, SIZE, title[, ...])

Generate a dot plot showing average expression and fraction positive cells

besca.tl Package

Functions

count_occurrence(adata[, count_variable, ...])

Generate dataframe containing the label counts/percentages of a specific column in adata.obs

count_occurrence_subset(adata, subset_variable)

count occurrence of a label in adata.obs after subseting adata object

count_occurrence_subset_conditions(adata, ...)

count occurrence of a label for each condition in adata.obs after subseting adata object

annotate_cells_clustering(adata, ...[, ...])

Function to add annotation to adata.obs based on clustering This function replaces the original cluster labels located in the column clustering_label with the new values specified in the list new_cluster_lables.

report(adata_pred, celltype, method, ...[, ...])

reports basic metrics, produces confusion matrices and plots umap of prediction

plot_confusion_matrix(y_true, y_pred, ...[, ...])

plots confusion matrices

besca.tl.bcor Package

Functions

batch_correct(adata, batch_to_correct)

function to perform batch correction

postprocess_mnnpy(adata, bdata)

postprocessing to generate a newly functional AnnData object

besca.tl.dge Package

Functions

perform_dge(adata, design_matrix, ...[, ...])

Perform differential gene expression between two conditions over many adata subsets.

plot_interactive_volcano(top_table_path, outdir)

plot an interactive volcano plot based on toptable file.

get_de(adata, mygroup[, demethod, topnr, ...])

Get a table of significant DE genes at certain cutoffs Based on an AnnData object and an annotation category (e.g.

besca.tl.rc Package

Functions

recluster(adata, celltype[, celltype_label, ...])

Perform subclustering on specific celltype to identify subclusters.

annotate_new_cellnames(adata, ...[, ...])

annotate new cellnames to each of the subclusters identified by running recluster.

besca.Import Package

Functions

read_mtx(filepath[, annotation, use_genes, ...])

Read matrix.mtx, genes.tsv, barcodes.tsv to AnnData object. By specifiying an input folder this function reads the contained matrix.mtx, genes.tsv and barcodes.tsv files to an AnnData object. In case annotation = True it also adds the annotation contained in metadata.tsv to the object. :param filepath: filepath as string to the directory containg the matrix.mtx, genes.tsv, barcodes.tsv and if applicable metadata.tsv :type filepath: str :param annotation: boolian identifier if an annotation file is also located in the folder and should be added to the AnnData object :type annotation: bool (default = True) :param use_genes: either SYMBOL or ENSEMBL. Other genenames are not yet supported. :type use_genes: str :param species: string specifying the species, only needs to be used when no Gene Symbols are supplied and you only have the ENSEMBLE gene ids to perform a lookup. :type species: str | default = 'human' :param citeseq: string indicating if only gene expression values (gex_only) or only protein expression values ('citeseq_only') or everything is read if None is specified :type citeseq: 'gex_only' or 'citeseq_only' or False or None | default = None.

add_cell_labeling(adata, filepath[, label])

add a labeling written out in the FAIR formating to adata.obs

assert_adata(adata[, attempFix])

Asserts that an adata object is containing information needed for the besca pipeline to run and export information.

besca.export Package

Functions

X_to_mtx(adata[, outpath, write_metadata, ...])

export adata object to mtx format (matrix.mtx, genes.tsv, barcodes.tsv)

raw_to_mtx(adata[, outpath, write_metadata, ...])

export adata.raw to .mtx (matrix.mtx, genes.tsv, barcodes, tsv)

clustering(adata[, outpath, export_average, ...])

export mapping of cells to clusters to .tsv file

write_labeling_to_files(adata[, outpath, ...])

export mapping of cells to specified label to .tsv file

labeling_info([outpath, description, ...])

write out labeling info for uploading to database

analysis_metadata(adata[, outpath, ...])

export plotting coordinates to analysis_metadata.tsv

generate_gep(adata[, filename, column, ...])

Generate Gene Expression Profile (GEP) from scRNA-seq annotations

ranked_genes(adata[, type, outpath, ...])

export marker genes for each cluster to .gct file

pseudobulk(adata[, outpath, column, label, ...])

export pseudobulk profiles of cells to .gct files

besca.st Package

Functions

read_matrix(root_path[, citeseq, ...])

Read matrix file as expected for the standard workflow.

filtering_cells_genes_min(adata, ...)

filtering_mito_genes_max(adata, ...)

export_cp10k(adata, basepath)

Export raw cp10k to FAIR format for loading into database

export_regressedOut(adata, basepath)

Export regressedOut to FAIR format for loading into database

export_clustering(adata, basepath, method)

Export cluster to cell mapping to FAIR format for loading into database

export_metadata(adata, basepath[, n_pcs, ...])

Export metadata in FAIR format for loading into database

export_rank(adata, basepath[, type, ...])

Export ranked genes to FAIR format for loading into database

export_celltype(adata, basepath)

Export celltype annotation to cell mapping in FAIR format for loading into database

additional_labeling(adata, labeling_to_use, ...)

Standard Workflow function to export an additional labeling besides louvain to FAIR format.

celltype_labeling(adata, labeling_author, ...)

Standard Workflow function to export an additional labeling besides louvain to FAIR format.