scte

$npx mdskill add swaruplab/operon/scte

Quantify transposable element expression from single-cell BAM files at locus or family level.

  • Processes scRNA-seq or ATAC-seq BAM files to count TE and gene expression per cell.
  • Depends on Python, samtools, pysam, numpy, and optionally anndata and h5py.
  • Allocates reads using configurable modes: exclusive, inclusive, or nointron.
  • Outputs a CSV count matrix or AnnData h5ad file for downstream analysis.

SKILL.md

.github/skills/scteView on GitHub ↗
---
name: scte
display_name: scTE
description: Quantify transposable element expression from single-cell RNA/ATAC-seq BAM files at locus or family level.
license: MIT
metadata:
---

# scTE

## Overview

scTE allocates aligned reads from single-cell RNA-seq or ATAC-seq BAM files to a unified gene + transposable element (TE) reference, producing a per-cell count matrix that contains both protein-coding genes and individual TE loci (or TE family aggregates). It uses prebuilt or custom genome indices that encode gene/exon coordinates alongside RepeatMasker-style TE annotations, and resolves the overlap between TE elements and gene bodies via configurable allocation modes (`exclusive`, `inclusive`, `nointron`). Output is a CSV table by default, or an AnnData `.h5ad` ready for Scanpy/Seurat workflows.

## When to Use This Skill

- Analyzing 10x Genomics or STARsolo scRNA-seq BAM files for TE expression alongside gene counts.
- Studying individual TE loci vs. family-level abundance in single cells.
- Processing C1 Fluidigm or other barcode-less scRNA-seq formats with UMI disabled.

## Prerequisites

```bash
git clone https://github.com/JiekaiLab/scTE.git
cd scTE
python setup.py install

# Recommended companion tools
conda install -c bioconda samtools
pip install anndata h5py pysam numpy
```

Requires Python ≥ 3.6. Prebuilt indices for mm10, hg38, panTro6, macFas5, dm6, danRer11, and xenTro9 are bundled with the repository; custom genomes are built with `scTE_build -te <BED> -gene <GTF> -o <prefix> -g <genome>`.

## Input Format

- Aligned BAM/SAM file with cell barcodes in `CR:Z` or `CB:Z` tags and UMIs in `UR:Z` or `UB:Z` tags.
- Prebuilt genome index (`mm10.exclusive.idx`, `hg38.exclusive.idx`, etc.) or custom index from GTF genes and BED TEs.
- Optional: custom gene GTF and TE BED files for `scTE_build`.

## Quick Start

```bash
scTE -i inp.bam -o out -x mm10.exclusive.idx --hdf5 True -CB CB -UMI UB
```

## Parameters

| Name | Default | Description |
| --- | --- | --- |
| `-i` | (required) | Input aligned BAM/SAM file. |
| `-o` | (required) | Output file prefix. |
| `-x` | (required) | Path to prebuilt or custom genome index (`.idx`). |
| `-p` | `1` | Number of threads (~10 GB RAM per thread). |
| `--hdf5` | `False` | Emit `.h5ad` AnnData instead of CSV when `True`. |
| `-CB` | `CR` | Cell barcode BAM tag name, or `False` to disable. |
| `-UMI` | `UR` | UMI BAM tag name, or `False` to disable. |
| `-m` / `--mode` | `exclusive` | TE/gene overlap allocation: `exclusive`, `inclusive`, or `nointron`. |

## Output

- CSV (default) or HDF5 (`--hdf5 True`) count matrix with cells as rows and genes/TEs as columns.
- HDF5 output is an AnnData `.h5ad` file directly loadable in Scanpy (`sc.read_h5ad`) or convertible to Seurat via `SeuratDisk::Convert`.

## Sharp Edges

- Memory ~10 GB per thread; cap `-p` on modest systems.
- BAM must carry correct barcode/UMI tags: Cell Ranger uses `CB:Z`/`UB:Z`, STARsolo uses `CR:Z`/`UR:Z` — wrong flags silently produce empty matrices.
- By default, TEs inside exon/UTR regions are assigned only to the gene; use `-m inclusive` to count both.
- Prebuilt indices ship for mm10, hg38, panTro6, macFas5, dm6, danRer11, xenTro9; other genomes require `scTE_build`.
- Input BAM should be coordinate-sorted and indexed (`samtools sort` + `samtools index`) for best performance; very large BAMs (>50 GB) may take hours.

## References

He, J. et al. (2021). "scTE: identifying the activity of transposable elements at single-cell resolution." *Nature Communications* 12, 1456. DOI: 10.1038/s41467-021-21808-x.

More from swaruplab/operon

SkillDescription
agentd-drug-discoveryUse the AgentD workflow to mine evidence, design molecules, and rank candidates with SAR plus ADMET annotations for early drug discovery tasks.
alphafold-databaseAccess AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.
antibody-design-agentAn advanced agent for de novo antibody design and optimization using state-of-the-art protein language models (MAGE, RFdiffusion).
archrSingle-cell ATAC-seq analysis with ArchR (R). The mature R-based scATAC pipeline — Arrow files, doublet inference, iterative LSI + Harmony, clustering, gene scores, MACS2 peak calling, motif enrichment, chromVAR deviations, footprinting, scRNA-seq integration (label transfer), trajectory analysis (built-in + Monocle3 + Slingshot), and ArchR's interactive genome browser. Sister protocol to snapatac2 — pick this for established R workflows.
automated-bioinformatics-pipelinesPipeline maestro
autonomous-biomedical-agentAutonomous biomedical AI agent framework for executing complex research tasks across genomics, drug discovery, molecular biology, and clinical analysis. Use this skill when conducting multi-step biomedical research including CRISPR screening design, single-cell RNA-seq analysis, ADMET prediction, GWAS interpretation, rare disease diagnosis, or lab protocol optimization. Leverages LLM reasoning with code execution and integrated biomedical databases.
autonomous-oncology-agentPrecision Oncology
basecallingConvert raw Nanopore signal data (FAST5/POD5) to nucleotide sequences using Dorado basecaller. Covers model selection, GPU acceleration, modified base detection, and quality filtering. Use when processing raw Nanopore data before alignment. Note: Guppy is deprecated; use Dorado for all new analyses.
batch-processingProcess multiple sequence files in batch using Biopython. Use when working with many files, merging/splitting sequences, or automating file operations across directories.
bindingdb-databaseQuery BindingDB for measured drug-target binding affinities (Ki, Kd, IC50, EC50). Search by target (UniProt ID), compound (SMILES/name), or pathogen. Essential for drug discovery, lead optimization, polypharmacology analysis, and structure-activity relationship (SAR) studies.