# Lintind

> LinTInd

- Skill: `biomate-ai/lintind` (Agent Skill)
- Install (CLI): `npx skillmds@latest add biomate-ai/lintind`
- Raw SKILL.md: https://api.skillmd.com/api/skills/biomate-ai/lintind/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: biomate-ai (https://skillmd.com/u/biomate-ai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/biomate-ai/lintind

---


# LinTInd

## Workflows

### Standard Workflow

Reconstruct a lineage tree and visualize indel patterns from CRISPR-edited amplicon sequencing data.

```r
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
* Homepage: https://bioconductor.org/packages/lintind
* Vignette: https://bioconductor.org/packages/release/bioc/vignettes/lintind/inst/doc/vignette_main.html

