te-reference-saf-build

Builds shared TE reference SAF files from TEtranscripts RepeatMasker GTFs for RNA-seq counting.

1|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/tony-zhelonkin/scio --skill te-reference-saf-build-tony-zhelonkin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: te-reference-saf-build
Source: https://github.com/tony-zhelonkin/scio/tree/main/skills/te-reference-saf-build
Command: npx skills add https://github.com/tony-zhelonkin/scio --skill te-reference-saf-build-tony-zhelonkin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gawk, bedtools, and includes scripts (resource) and references (resource) components.

What problem does it solve? Setting up a new genome build or species for TE-compatible RNA-seq preprocessing requires building shared TE reference artifacts (TE GTF, grouped subfamily SAF, exon-subtracted no-exon SAF), a recipe that previously lived only as scattered awk/bedtools snippets in per-dataset READMEs with no provenance tracking. ## Core Features & Use Cases - Grouped SAF generation: Converts a TEtranscripts RepeatMasker GTF into a SAF with GeneID = Subfamily:Family:Class so featureCounts pools loci into subfamily meta-features. - Exon subtraction with verification: Derives an exon BED from the canonical gene GTF, normalizes contig names, runs bedtools subtract, and enforces zero residual exon overlap. - Provenance recording: Ships a build-record template capturing source URLs, md5 checksums, exact commands, and consuming datasets. - Use Case: When moving a project from mm39 to GRCh38, run the owned build script once to produce the shared no-exon SAF that every downstream dataset reuses via star-te-preprocessing. ## Quick Start Run scripts/build_te_saf.sh with the TEtranscripts TE GTF, the matching gene GTF, an output directory, and a build prefix to generate the grouped and no-exon SAF reference files.

Frequently Asked Questions about te-reference-saf-build

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a TE reference SAF for RNA-seq featureCounts?▼

Run scripts/build_te_saf.sh with the TEtranscripts RepeatMasker GTF, the matching gene GTF, an output directory, and a build prefix. It produces a grouped SAF with GeneID = Subfamily:Family:Class and an exon-subtracted no-exon SAF ready for featureCounts.

What is the difference between subfamily-level and locus-level TE quantification?▼

Subfamily-level grouping pools all loci of a subfamily into one meta-feature (~1,243 groups for mm39), which this skill builds. Locus-level or copy-resolved quantification needs different tools such as SQuIRE or Telescope and is out of scope here.

Why does bedtools subtract remove nothing from my TE intervals?▼

The usual cause is a contig naming mismatch, such as chr1 versus 1, which silently yields zero overlap. Normalize both BED files to the same convention before subtracting; the script strips leading chr prefixes by default.

Should I rebuild the TE reference SAF for each new dataset?▼

No. These artifacts are built once per genome build and shared across every dataset. Rebuild only when the genome build, TE GTF source, or gene GTF changes, and record each build in the provenance template.

What dependencies does the TE SAF build script require?▼

The script requires GNU awk (gawk) for the three-argument match function, bedtools for subtraction and overlap verification, plus standard coreutils like sort and zcat. It accepts gzipped or plain GTF inputs.