API

XChrom: a cross-cell chromatin accessibility prediction model integrating genomic sequences and cellular context.

Import xchrom package

import xchrom

Reading

xchrom.readfile.read_10x_h5_to_h5ad(h5_file, ...)

Read 10x Genomics h5 file and convert to h5ad format

Preprocessing

xchrom.pp.process_train_test_single(ad_atac, ...)

Generate XChrom training and test inputs from a single dataset.

xchrom.pp.process_test_dual(ad_atac, input_fasta)

Generate XChrom train set and test set from 2 datasets, to generate XChrom test inputs.

xchrom.pp.filter_multiome_data(ad_rna, ad_atac)

Filter multiome RNA and ATAC data based on expression/accessibility thresholds and chromosomes

Model training

xchrom.tr.train_XChrom(input_folder, ...[, ...])

Train XChrom model

xchrom.tr.Generator(seq_path, adata, ...[, ...])

Generate input data for XChrom model training and create TensorFlow datasets.

xchrom.tr.XChrom_model(n_cells[, cell_vec, ...])

XChrom model construction

Toolkit

xchrom.tl.calc_auc_pr(true_matrix, pred_matrix)

Calculate the AUROC and AUPRC metrics for given true and predicted matrix.

xchrom.tl.calc_nsls_score(ad_rna, ad_atac[, ...])

Calculate the cluster metrics of scATAC data, including the number of shared neighbors and labels.

xchrom.tl.calc_pca(ad[, max_value, n_comps])

Calculate the PCA of the given data, and save the PCA components in .obsm['X_pca'].

xchrom.tl.bed_to_fasta(bed_input, ...[, ...])

Extract sequences from BED file and write to FASTA file.

xchrom.tl.crosscell_aucprc(cell_embedding_ad)

Evaluate the performance in cross-cell prediction with within-sample data, calculate auROC & auPRC for overall, per-cell and per-peak.

xchrom.tl.crosscell_nsls(cell_embedding_ad)

Evaluate the performance in cross-cell prediction with within-sample data, calculate neighbor score and label score for test cells.

xchrom.tl.crosspeak_aucprc(cell_embedding_ad)

Evaluate the performance in cross-peak prediction with within-sample data, calculate auROC & auPRC for overall, per-cell and per-peak.

xchrom.tl.crossboth_aucprc(cell_embedding_ad)

Evaluate the performance in cross-both prediction with within-sample data, calculate auROC & auPRC for overall, per-cell and per-peak.

xchrom.tl.denoise_nsls(cell_embedding_ad[, ...])

Evaluate the performance of denoise in within-sample data, calculate neighbor score(k=10,50,100) and label score(k=10,50,100) for all cells.

xchrom.tl.crosssamples_aucprc(cell_embedding_ad)

Evaluate the performance in cross-samples scenario, calculate auROC & auPRC for overall, per-cell and per-peak.

xchrom.tl.crosssamples_nsls(cell_embedding_ad)

Evaluate the performance in cross-samples scenario, calculate neighbor score(k=10,50,100) and label score(k=10,50,100) for all cells.

xchrom.tl.calc_ism(cell_embedding_ad, ...[, ...])

Calculate ISM (In Silico Mutagenesis) for a single sequence

xchrom.tl.ism_norm(peak_ism, peak_bed, ...)

Normalized the ISM scores for the four nucleotides at each position such that they summed to zero

xchrom.tl.calc_ism_from_bed(...[, ...])

Calculate the ISM from BED file.

xchrom.tl.generate_tf_activity_data(...[, ...])

Prepare motif data and background sequences for TF activity calculation

xchrom.tl.calc_tf_activity(motif_dir, ...[, ...])

Calculate motif insertion scores.

Plotting

xchrom.pl.plot_train_history(history[, ...])

xchrom.pl.plot_logo(m, ymin, ymax, ax[, title])

Plot the relative importance of the given matrix per position.

xchrom.pl.plot_percell_aucprc(true_matrix, ...)

Plot the per-cell auROC and auPRC scatter plot.

xchrom.pl.plot_perpeak_aucprc(true_matrix, ...)

Plot the per-peak auROC and auPRC scatter plot.

xchrom.pl.plot_motif_activity(...[, save_path])

Plot the activity of a single motif and celltype on UMAP.