LinTInd
Workflows
Standard Workflow
Reconstruct a lineage tree and visualize indel patterns from CRISPR-edited amplicon sequencing data.
library(LinTInd)
# Define paths to package raw data
data_path <- paste0(system.file("extdata", package = 'LinTInd'), "/CB_UMI")
fafile <- paste0(system.file("extdata", package = 'LinTInd'), "/V3.fasta")
cutsite_path <- paste0(system.file("extdata", package = 'LinTInd'), "/V3.cutSites")
celltype_path <- paste0(system.file("extdata", package = 'LinTInd'), "/celltype.tsv")
# Read input files
data <- read.table(data_path, sep="\t", header=TRUE)
ref <- ReadFasta(fafile)
cutsite <- read.table(cutsite_path, col.names = c("indx", "start", "end"))
celltype <- read.table(celltype_path, header=TRUE, stringsAsFactors=FALSE)
# Align reads and identify indels
scarinfo <- FindIndel(data=data, scarfull=ref, scar=cutsite, indel.coverage="All", type="test", cln=1)
# Generate array-form scar strings
scarinfo <- IndelForm(scarinfo, cln=1)
# Define final scar form for each cell
cellsinfo <- IndelIdents(scarinfo, method.use="umi.num", cln=1)
# Visualize indel distribution
IndelPlot(cellsinfo = cellsinfo)
# Extract indels and calculate group similarity
tag <- TagProcess(cellsinfo$info, Cells=celltype)
tag_dist <- TagDist(tag, method = "Jaccard")
# Reconstruct and plot the lineage tree
treeinfo <- BuildTree(tag)
plotinfo <- PlotTree(treeinfo = treeinfo, data.extract = "TRUE", annotation = "TRUE")
plotinfo$p
Note on inputs/outputs:
- Input: A data frame of sequencing reads (with optional cell barcodes and UMIs), a reference FASTA file, a cut site position table, and an optional cell type annotation table.
- Output: A reconstructed lineage tree object and visualization plots of indels and tree structure.
When to Use
- CRISPR Lineage Tracing: Reconstructing lineage trees from alleles generated by CRISPR-mediated gene editing using
BuildTree().
- Indel Identification: Aligning sequencing reads to a reference sequence and identifying insertions/deletions using
FindIndel().
- Scar Profiling: Generating standardized array-form scar strings for each read or single cell using
IndelForm() and IndelIdents().
- Group Similarity Analysis: Quantifying similarity (e.g., Jaccard, Spearman, or hypergeometric test) between cell groups/clusters using
TagDist().
When NOT to Use
- General Single-Cell Analysis: For standard single-cell RNA-seq clustering or cell-type annotation, use
Seurat or scran because LinTInd is specialized for lineage tracing via CRISPR-induced scars.
- Phylogenetics from SNPs: For standard phylogenetic tree reconstruction from natural genomic mutations (e.g., SNPs) without CRISPR-induced scars, use
ape because LinTInd relies on specific cut-site and indel array structures.
Data Requirements
- Sequence Data: A data frame containing a column of read sequences (
Read.Seq), with optional columns for cell barcodes (Cell.BC) and UMIs (UMI).
- Reference Sequence: A FASTA file containing the reference sequence, loaded using
ReadFasta().
- Cut Sites: A table containing cut site indices, start positions, and end positions.
- Cell Type Annotation (optional): A tab-separated file mapping cell barcodes (
Cell.BC) to cell types (Cell.type).
Key Parameters
- indel.coverage ("All"): Parameter in
FindIndel() specifying which indels to cover.
- type ("test"): Parameter in
FindIndel() specifying the run type.
- cln (1): Number of cores/threads to use in
FindIndel(), IndelForm(), and IndelIdents().
- method.use ("reads.num"): Method to define the scar form per cell in
IndelIdents(); options include "reads.num", "umi.num", and "consensus".
- method ("Jaccard"): Similarity calculation method in
TagDist(); options include "Jaccard", "P", and "spearman".
- data.extract ("TRUE"): Logical parameter in
PlotTree() to extract data.
- annotation ("TRUE"): Logical parameter in
PlotTree() to annotate the tree plot.
Best Practices
- Verify that the reference sequence and cut sites match the experimental design before running
FindIndel().
- Use
IndelForm() immediately after FindIndel() to convert identified indels into standardized array-form strings.
- For single-cell data with UMIs, use
method.use="umi.num" in IndelIdents() to define cell scar forms based on UMI consensus rather than raw read counts.
- Provide cell type annotations to
TagProcess() to enable group-level similarity calculations with TagDist().
Common Pitfalls
- Missing Sequence Columns: Missing or mismatched column names in the input sequence data frame (e.g., missing
Read.Seq). Fix: Ensure the sequence column is present and correctly named before running FindIndel().
- Missing Annotations in TagDist: Running
TagDist() without cell type annotations. Fix: Pass a valid cell type data frame to TagProcess() via the Cells parameter before computing distances.
- High Computational Time: High computational time when processing large datasets. Fix: Increase the
cln parameter in FindIndel(), IndelForm(), and IndelIdents() to utilize multiple cores.
Alternatives
- Seurat for general single-cell analysis and clustering.
- scater for single-cell quality control and visualization.
- scran for single-cell expression data normalization and variance modeling.
- ape for general phylogenetic tree reconstruction and analysis.
Citations
- Wang L. (2021). LinTInd: Reconstruction of lineage trees from CRISPR-mediated gene editing. R package.
References
1---2name: lintind3description: LinTInd4---56# LinTInd78## Workflows910### Standard Workflow1112Reconstruct a lineage tree and visualize indel patterns from CRISPR-edited amplicon sequencing data.1314```r15library(LinTInd)1617# Define paths to package raw data18data_path <- paste0(system.file("extdata", package = 'LinTInd'), "/CB_UMI")19fafile <- paste0(system.file("extdata", package = 'LinTInd'), "/V3.fasta")20cutsite_path <- paste0(system.file("extdata", package = 'LinTInd'), "/V3.cutSites")21celltype_path <- paste0(system.file("extdata", package = 'LinTInd'), "/celltype.tsv")2223# Read input files24data <- read.table(data_path, sep="\t", header=TRUE)25ref <- ReadFasta(fafile)26cutsite <- read.table(cutsite_path, col.names = c("indx", "start", "end"))27celltype <- read.table(celltype_path, header=TRUE, stringsAsFactors=FALSE)2829# Align reads and identify indels30scarinfo <- FindIndel(data=data, scarfull=ref, scar=cutsite, indel.coverage="All", type="test", cln=1)3132# Generate array-form scar strings33scarinfo <- IndelForm(scarinfo, cln=1)3435# Define final scar form for each cell36cellsinfo <- IndelIdents(scarinfo, method.use="umi.num", cln=1)3738# Visualize indel distribution39IndelPlot(cellsinfo = cellsinfo)4041# Extract indels and calculate group similarity42tag <- TagProcess(cellsinfo$info, Cells=celltype)43tag_dist <- TagDist(tag, method = "Jaccard")4445# Reconstruct and plot the lineage tree46treeinfo <- BuildTree(tag)47plotinfo <- PlotTree(treeinfo = treeinfo, data.extract = "TRUE", annotation = "TRUE")48plotinfo$p49```5051**Note on inputs/outputs:**52* **Input:** A data frame of sequencing reads (with optional cell barcodes and UMIs), a reference FASTA file, a cut site position table, and an optional cell type annotation table.53* **Output:** A reconstructed lineage tree object and visualization plots of indels and tree structure.5455## When to Use56* **CRISPR Lineage Tracing:** Reconstructing lineage trees from alleles generated by CRISPR-mediated gene editing using `BuildTree()`.57* **Indel Identification:** Aligning sequencing reads to a reference sequence and identifying insertions/deletions using `FindIndel()`.58* **Scar Profiling:** Generating standardized array-form scar strings for each read or single cell using `IndelForm()` and `IndelIdents()`.59* **Group Similarity Analysis:** Quantifying similarity (e.g., Jaccard, Spearman, or hypergeometric test) between cell groups/clusters using `TagDist()`.6061## When NOT to Use62* **General Single-Cell Analysis:** For standard single-cell RNA-seq clustering or cell-type annotation, use `Seurat` or `scran` because `LinTInd` is specialized for lineage tracing via CRISPR-induced scars.63* **Phylogenetics from SNPs:** For standard phylogenetic tree reconstruction from natural genomic mutations (e.g., SNPs) without CRISPR-induced scars, use `ape` because `LinTInd` relies on specific cut-site and indel array structures.6465## Data Requirements66* **Sequence Data:** A data frame containing a column of read sequences (`Read.Seq`), with optional columns for cell barcodes (`Cell.BC`) and UMIs (`UMI`).67* **Reference Sequence:** A FASTA file containing the reference sequence, loaded using `ReadFasta()`.68* **Cut Sites:** A table containing cut site indices, start positions, and end positions.69* **Cell Type Annotation (optional):** A tab-separated file mapping cell barcodes (`Cell.BC`) to cell types (`Cell.type`).7071## Key Parameters72* **indel.coverage** ("All"): Parameter in `FindIndel()` specifying which indels to cover.73* **type** ("test"): Parameter in `FindIndel()` specifying the run type.74* **cln** (1): Number of cores/threads to use in `FindIndel()`, `IndelForm()`, and `IndelIdents()`.75* **method.use** ("reads.num"): Method to define the scar form per cell in `IndelIdents()`; options include "reads.num", "umi.num", and "consensus".76* **method** ("Jaccard"): Similarity calculation method in `TagDist()`; options include "Jaccard", "P", and "spearman".77* **data.extract** ("TRUE"): Logical parameter in `PlotTree()` to extract data.78* **annotation** ("TRUE"): Logical parameter in `PlotTree()` to annotate the tree plot.7980## Best Practices81* Verify that the reference sequence and cut sites match the experimental design before running `FindIndel()`.82* Use `IndelForm()` immediately after `FindIndel()` to convert identified indels into standardized array-form strings.83* For single-cell data with UMIs, use `method.use="umi.num"` in `IndelIdents()` to define cell scar forms based on UMI consensus rather than raw read counts.84* Provide cell type annotations to `TagProcess()` to enable group-level similarity calculations with `TagDist()`.8586## Common Pitfalls87* **Missing Sequence Columns:** Missing or mismatched column names in the input sequence data frame (e.g., missing `Read.Seq`). *Fix:* Ensure the sequence column is present and correctly named before running `FindIndel()`.88* **Missing Annotations in TagDist:** Running `TagDist()` without cell type annotations. *Fix:* Pass a valid cell type data frame to `TagProcess()` via the `Cells` parameter before computing distances.89* **High Computational Time:** High computational time when processing large datasets. *Fix:* Increase the `cln` parameter in `FindIndel()`, `IndelForm()`, and `IndelIdents()` to utilize multiple cores.9091## Alternatives92* **Seurat** for general single-cell analysis and clustering.93* **scater** for single-cell quality control and visualization.94* **scran** for single-cell expression data normalization and variance modeling.95* **ape** for general phylogenetic tree reconstruction and analysis.9697## Citations98* Wang L. (2021). LinTInd: Reconstruction of lineage trees from CRISPR-mediated gene editing. R package.99100## References101* Homepage: https://bioconductor.org/packages/lintind102* Vignette: https://bioconductor.org/packages/release/bioc/vignettes/lintind/inst/doc/vignette_main.html