Preprocessing pp

Contents

Preprocessing pp#

Preprocessing functions for seqlet extraction and motif similarity analysis.

pp.extract_seqlets(contrib, oh[, method, motifs])

Extract, scale, and process seqlets from saliency maps.

pp.calculate_motif_similarity(seqlets, ...)

Calculate TomTom similarity and convert to log-space for clustering.

pp.create_seqlet_adata(similarity_matrix, ...)

Create comprehensive AnnData object storing all seqlet data for analysis pipeline.

Accessors#

Per-seqlet and per-region arrays are stored once in adata.uns["unique_examples"] and read back through these functions rather than being duplicated into adata.obs.

pp.get_seqlet_oh(adata, seqlet_idx)

Get the one-hot sequence of a single seqlet.

pp.get_seqlet_ohs(adata, seqlet_idxs)

Get the one-hot sequences of several seqlets.

pp.get_seqlet_matrix(adata, seqlet_idx)

Get the normalized contribution matrix of a single seqlet.

pp.get_seqlet_matrices(adata, seqlet_idxs)

Get the normalized contribution matrices of several seqlets.

pp.get_example_idx(adata, seqlet_idx)

Get the index for an example associated with a seqlet.

pp.get_example_oh(adata, seqlet_idx)

Get the one-hot sequence for an example associated with a seqlet.

pp.get_example_contrib(adata, seqlet_idx)

Get the contribution scores for an example associated with a seqlet.