Skip to contents

Core redeemR2.0 workflow

Primary functions for importing REDEEM-V consensus calls and producing a filter2-ready redeemR object.

redeemR.read.trim()
Function to read in redeemV outputs with edge trimming, default is trimming 4bp
redeemR.read()
Function to read in redeemV outputs
Create_redeemR()
Create_redeemR
Create_redeemR_model()
Create a redeemR object from raw variant summaries
clean_redeem()
clean_redeem
add_annotation_redeem()
add_annotation_redeem
clean_redeem_remove_blacklist_RSRS50()
clean_redeem_remove_blacklist_RSRS50
Add_DepthMatrix_filter2()
Add Filter-2-adjusted depth matrix to a redeemR object
add_median_depth_to_redeemR()
Add median depth information to redeemR object
clean_redeem_remove_low_median_depth()
Remove variants with low median depth and depth-corrected homoplasmy
add_prop_2_3_to_redeemR()
add_prop_2_3_to_redeemR
update_redeemR_from_GTsummary()
Update redeemR object from GTsummary.filtered (helper)

REDEEM-V parsing and summaries

Utilities for reading final/ outputs, depth summaries, genotype summaries, and consensus diagnostics.

DepthSummary()
Function to summarize the depth (Total that passed Q30)
PosCoverageCellCount()
Function to count cells with non-zero coverage per position
GTSummary()
Function to generate GTS summary
reconstruct_genotype_summary()
This is a function borrowed from https://github.com/NickWilliamsSanger/treemut/blob/main/R/treemut.R#L68 Input phylo object, return a "profile matrix"--Edge(or denoted as the ending node) vs cell. a 0, 1 character string that indicate what cells in a given node
ComputeRejectRate()
Function to compute the reject rate(The filtering rate in concensus variant calling)
Show_Consensus()
Function to plot consensus mtDNA mutation benchmark
run_redeem_qc()
run_redeem_qc
print_redeemR_matrix_dims()
Print redeemR matrix dimensions
check_redeem()
Check redeem object consistency

Variant annotation

Population, context, blacklist, coding-impact, disease, and mutation-type annotation helpers.

annotate_all_variants()
Apply full suite of variant annotations
annotate_variants_population_stats()
Annotate variant table with population frequency and haplogroup statistics
annotate_variants_hypermutable()
Annotate hypermutable variants
annotate_variants_blacklist()
Annotate variants with mitochondrial blacklist region flag
annotate_variants_homopolymer()
Annotate variants with mitochondrial homopolymer context
annotate_variants_aachange()
Annotate variants with amino-acid change and predicted impact via dndscv
annotate_variants_mito_disease()
Annotate variants with mitochondrial disease associations
Annotate_base_change()
Annotate variant annotation with base-change and type
add_changes()
Extract nucleotide change from variant string
add_types()
Classify nucleotide change as transition or transversion
add_hypermutable()
add_hypermutable This function annotates the redeem@V.fitered with hypermutable mutations_v2 (using 3 young donor and 2 aged donors)
MutationProfile.bulk()
Function to plot bulk level mutation signatures
redeemR-data all.genes.refer ATACWhite CellPCT CellPCT.update ContextsDic gr_genes Griffin_Signatures haplogroup_markers mito_diseases mito_homopolymer mitomap_freq msig.db ref_all_long RefCDS RNAWhite
Bundled annotation and reference data

Matrix filtering and subsetting

Helpers for cell-by-variant matrices, binary matrices, depth matrices, and additional variant-level filters.

subset_redeem()
Subset redeemR object to a whitelist of cells and rebuild matrices
Subset_redeemR()
Subset_redeemR Subset a redeemR object by selecting a subset of cells, return a new redeemR object with only 4 slots: para; CellMeta; Cts.Mtx.bi; UniqueV, can be used for downstreme compute distance, clonal clustering, make tree, etc
filter_redeemR_by_cells()
Filter by cell subset
filter_redeemR_by_UMI()
Filter by UMI count (Freq) threshold on GTsummary
filter_redeemR_by_hetero()
Filter by VAF (hetero) threshold on GTsummary
filter_redeemR_by_meancount()
Filter by mean UMI count threshold on GTsummary
filter_redeemR_by_rules()
Filter by predefined rules using GTsummary data
filter_redeemR_by_LIS()
Filter by LIS score and VAF threshold (Wang et al., 2025, Genome Biology)
make_V.fitered_from_mtx()
Create variant summary table from count matrix
convert_redeem_matrix_long()
Convert a redeemR variant & depth matrix into long format for downstream analysis
convert_variant()
convert_variant
safe_dim()
Safely get matrix-like dimensions

Lineage and tree utilities

Distance, matrix, and tree helpers for downstream lineage reconstruction and visualization.

BinaryDist()
Compute distances for binary distances
quick_w_jaccard()
Compute weighted jaccard distance
quick_w_cosine()
Compute weighted cosine distance
compute_distance_matrix()
Compute Distance Matrix from Heteroplasmy Matrix
Make_matrix()
Make_matrix This will make the matixies of Cell VS mitochondrial variants and return redeemR Results stored in Cts.Mtx and Cts.Mtx.bi
AddDist()
AddDist This add Jaccard, Dice, Jaccard3W distance and stored in DistObjects
AddTree()
Add_Tree Optional, if a phylogentic tree object phylo is already available, can be directly added to the redeemR
Make_tree()
Make_tree This will generate a basic phylogenetic tree
create_rooted_tree()
Create Rooted Phylogenetic Tree from Distance Matrix
plot_tree_heatmap_teng_cw()
plot_tree_heatmap_teng_cw
plot_depth()
Function to plot the mito depth summary
plot_variant()
Function to plot variant metrics
plot_npSummary()
plot_npSummary to assess the outputlevel

Classes and S4 methods

redeemR object classes and method documentation.

redeemR-class redeemR
Major redeem class that store clonal-resolved multi-omics
mitoTracing-class mitoTracing
Legacy function: Major mitoTracing class that store clonal-resolved multi-omics
Datatoplots-class Datatoplots
An intermediate S4 class Datatoplots
DistObjects-class DistObjects
An intermediate S4 class Datatoplots
TREE-class TREE
An intermediate S4 class Tree that store tree info
Add_AssignVariant()
Add_AssignVariant a function to assign variants to edges based on maximum likihood
Add_DepthMatrix()
Add_DepthMatrix Optional, add a matrix with same dimension with the Cts.Mtx and Cts.Mtx.bi, which display the depths
Add_tree_cut()
Add_tree_cut a function to cut tree using assigned variant as branch-length on edge
AddDatatoplot_clustering()
AddDatatoplot_clustering This prepare the clonal clustering data to plot
SeuratLSIClustering()
SeuratLSIClustering This will use the mito variants for Seurat clustering (LSI based)
AddDatatoplot_clustering(<redeemR>)
AddDatatoplot_clustering This prepare the clonal clustering data to plot
AddDist(<redeemR>)
AddDist This add Jaccard, Dice, Jaccard3W distance and stored in DistObjects
AddTree(<redeemR>)
Add_Tree Optional, if a phylogentic tree object phylo is already available, can be directly added to the redeemR class in slot TREE
Add_AssignVariant(<redeemR>)
a function to assign variants to edges based on maximum likihood
Add_DepthMatrix(<redeemR>)
Add_DepthMatrix Optional, add a matrix with same dimension with the Cts.Mtx and Cts.Mtx.bi, which display the depths
Add_tree_cut(<redeemR>)
a function to cut tree using assigned variant as branch-length on edge
Make_matrix(<redeemR>)
Make_matrix This will make the matixies of Cell VS mitochondrial variants and return redeemR Results stored in Cts.Mtx and Cts.Mtx.bi
Make_tree(<redeemR>)
Make_tree This will generate a basic phylogenetic tree
SeuratLSIClustering(<redeemR>)
SeuratLSIClustering This will use the mito variants for Seurat clustering (LSI based)
show(<redeemR>)
show This will show the basics of redeemR class

Legacy and exploratory helpers

Older APIs, wrappers, plotting helpers, and project-specific utilities kept for backward compatibility.

ATAC_Wrapper()
Wrap Seurat ATAC clustering
AddDist_legacy()
AddDist_legacy This add Jaccard, Dice, Jaccard3W distance and stored in DistObjects
AddDist_legacy(<mitoTracing>)
AddDist_legacy This add Jaccard, Dice, Jaccard3W distance and stored in DistObjects
AddHemSignature()
Function to add hematopoietic signatures from Griffin_Signatures
AddsigTag.6.new()
AddsigTag.6.new
Build_Manhattan_Tree()
Build Manhattan Tree
CW_mgatk.read()
Old Function to read in redeemV outputs It process the data same way as redeemR.read but simultanously reading in all threadhold as a list This function allows you to read raw data from XX/final folder, the output from redeemV
Clone_FinderMarker()
Define a function to perform Find marker for top vs bottom clones This function was developed based on DN4T2.basics.ipynb
ComputeRejectRate_legacy()
Function to compute the reject rate(The filtering rate in concensus variant calling)
CountOverlap_Adj()
CountOverlap_Adj function to count the connectedness (adjacency matrix), or the number of cells sharing more than n variants with the given cell
CountVperCell()
Internal function in plot_variant
Create_mitoTracing()
Create_mitoTracing
CV()
Internal CV
DE.gettripple()
DE.gettripple
DoDE()
DoDE
FromDist2Graph()
FromDist2Graph From distance object or matrix to graph, default is to return igraph object This function was developed based on
Fun.enrich_withFC()
Fun.enrich_withFC
Fun.enrich_withFC.pvalue()
Fun.enrich_withFC.pvalue
GEM_Wrapper()
Wrap Seurat RNA clustering
Get_Clonal_Variants()
Get_Clonal_Variants
Getgenenumber()
Getgenenumber
Getpallet2()
Getpallet2
LineageBiasPlot()
plot_npSummary to plot the lineage composition
MakeAllNodes()
Define a function make the Allnodes(Node|Parent|Freq|CladeSize), where Freq is the number of variants assigned to the node(as ending point) from redeemR object,
MakeDF4Regress()
MakeDF4Regress Define a function to make two dataframe for regression analysis This function was developed based on HSC_multiome_Het_2.ipynb
MakeNN()
Define a function to make nn list, which can be further used to make adjacency matrix This scan row by row, looking for k.param nearest neighbours
Make_AnnTable()
Make_AnnTable, Make a big dataframe, each row is a cell, each column includes info such as clonal UMAP, Clonal ID, ATAC/RNA/WNN UMAP, PCA, gene expression of chosen gene, etc. Require a redeemR object and a multiome wrapper that better matches the cells in the redeemR
Make_Cells4Nodes()
Define a function to make a list, each contains the cell names for a node
Make_tree_legacy()
Make_tree_legacy This will generate a basic phylogenetic tree
Make_tree_legacy(<mitoTracing>)
Make_tree_legacy This will generate a basic phylogenetic tree
MergeMtx()
Function to Merge sparse Matrix
Motifenrich.binom()
Motifenrich.binom In house function to compute enrichment from Fimo This function was developed based on HSC_multiome_Het.ipynb and HSC_multiome_Het_2.ipynb
Multi_Wrapper()
Wrap Seurat Multiomics clustering
NN2M()
Define a function convert nn list to adjacency matrix that can be further used for igraph
ProgenyMapping()
Define a function to perform single-cell based hard porogeny assignment This function was developed based on DN4T2.basics.ipynb
ProgenyMapping_np()
ProgenyMapping_np Define a function to compute network propagation based probability FromDist2Graph is needed to convert fistance matrix into MNN graph
Reclustering()
Function to reclustering a seurat object
Reclustering_hm()
Function to reclustering_hm a seurat object with Harmony
Run_Lin_regression()
Run_Lin_regression
Run_Lin_regression_poi()
Run_Lin_regression_poi Firstly used in HSC_multiome_Het_2.ipynb This function was developed based on
Runplot_scale_2()
plot_npSummary to assess the outputlevel vs lineage bias, normalize by assigned
Runplot_scale_3()
plot_npSummary to assess the outputlevel vs lineage bias, normalize by HSC original clone size
Tomerge.col()
Tomerge.col
Tomerge_v2()
Tomerge_v2
Translate_RNA2ATAC() Translate_RNA2ATAC()
Function to translate the RNA barcode into ATAC barcode and add a column
Translate_simple_ATAC2RNA()
Translate_simple_ATAC2RNA
Translate_simple_RNA2ATAC()
Translate_simple_RNA2ATAC
Vfilter_v3()
Function to filter variants, deprecated
Vfilter_v4()
Function to filter variants, v4
add_derived_profile_info()
This is a convinience function, internal borrowed from https://github.com/NickWilliamsSanger/treemut/blob/main/R/treemut.R#L68
add_freq_raw()
Convinient function that takes raw fragment, and out put fragment with frequency Produce KS test results, input is the redeem object from redeemR object,
add_raw_fragment()
Produce a raw fragment table with frequency (how many cells) and the reletive distance from redeemR object,
append_dim_row()
Append redeemR matrix dimension snapshot
binomialtest.msig.enrch_deplet()
binomialtest.msig.enrch_deplet
clean_redeem_removehomo()
clean_redeem_removehomo
clean_redeem_removehot()
clean_redeem_removehotcall
convert_mitotracing_redeemR()
convert_mitotracing_redeemR
df2ProfileMtx()
This is a convinience function, internal
get_ancestral_nodes()
This is a convinience function, internal borrowed from https://github.com/NickWilliamsSanger/treemut/blob/main/R/treemut.R#L68
get_hype_v2()
get_hype_v2 This function annotates the redeem@V.fitered with hypermutable mutations_v2 (using 3 young donor and 2 aged donors)
gsea_enrichmentheat()
gsea_enrichmentheat
make_ks_test_df()
Produce KS test results, input is the redeem object from redeemR object,
make_position_df_3.4()
Function needed to compute the
make_position_df_3.5()
make_position, but remain all the raw genotyp information Input is the ind_df or
plot_depth_legacy()
Legacy Function to plot the mito depth summary
plot_variant_legacy()
Legacy Function to plot variant metrics
redeemR.read.multiple.trim()
Function to read in multiple runs of redeemV outputs with edge trimming, default is trimming 5bp
split_profile()
This is a convinience function, internal borrowed from https://github.com/NickWilliamsSanger/treemut/blob/main/R/treemut.R#L68
str2vector()
This is a convinience function, internal
theme_cw1()
Define a custom theme function
theme_cw2()
Define a custom theme function