pku-yuangroup/openai4s/bio-alternative-splicing-splicing-qc

Claude Code and agent skill by pku-yuangroup/openai4s

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Assesses RNA-seq data quality specifically for alternative splicing analysis. QC layers include experimental design audit (library prep, read length, depth, replicates), STAR 2-pass cohort-style alignment, junction saturation curves and discovery plateau detection, novel-vs-known junction ratio diagnostics, junction-overhang distribution, splice-site strength scoring (MaxEntScan intrinsic + SpliceAI context-aware), strandedness verification, GENCODE basic vs comprehensive choice, and rRNA contamination screening. Splicing analysis is more demanding than DGE on read length, depth, library prep, alignment strategy, and annotation choice — failures silently bias PSI estimates and inflate novel-junction false positives. Use when evaluating data suitability for splicing analysis, troubleshooting low event detection, or designing sequencing experiments where AS is a primary endpoint.

Install

npx vskill@latest install pku-yuangroup/openai4s/bio-alternative-splicing-splicing-qc

SKILL.md

The same SKILL.md was published earlier as pku-yuangroup/openai4s/bio-alternative-splicing-splicing-qc.

Version Compatibility

Reference examples tested with: RSeQC 5.0+, STAR 2.7.11+, samtools 1.19+, pysam 0.22+, regtools 1.0+, maxentpy 0.0.1+, spliceai 1.3+, matplotlib 3.8+, pandas 2.2+

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures
  • CLI: <tool> --version then <tool> --help to confirm flags

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Splicing-Specific Quality Control

Splicing analysis is more demanding than DGE on read length, depth, library prep, alignment strategy, and annotation choice. Failures in any of these silently bias PSI estimates and inflate novel-junction false positives. The decision sequence is: experimental design -> library prep -> alignment strategy -> annotation -> diagnostic metrics. Each layer's failure mode is distinct.

QC Layer Taxonomy

LayerTargetToolFails when
Experimental designRead length, depth, replicates, library typePre-sequencing review<PE 75nt; n<3 vs n<3; <30M reads/sample
Library preppoly(A) vs rRNA depletionPre-sequencing reviewpoly(A) library used for IR analysis
AlignmentSTAR 2-pass cohort-styleSTAR1-pass loses 14% novel junctions; per-sample 2-pass introduces inconsistency
Junction discoverySaturation, noveltyRSeQC junction_saturation, junction_annotationCurve still rising = under-sequenced; novel% >40% suggests biology or artifact
Strand specificityLibrary protocol consistencyRSeQC infer_experimentWrong --libType halves usable junctions
Splice site strengthCryptic vs canonicalMaxEntScan, SpliceAIWeak splice sites (MaxEnt<5) may indicate cryptic, regulated, or annotation error
Junction overhangRead-junction support qualitypysam CIGAR parsingOverhang <8nt = high false-positive rate
ContaminationrRNA, adaptersfastq_screen>20% rRNA in "depleted" library = failed depletion
AnnotationGENCODE basic vs comprehensiveAnnotation choiceBasic for canonical events; comprehensive for DTU

Decision Tree by Question

QuestionRecommended QC
Will my planned RNA-seq design support AS analysis?Pre-sequencing audit: library type, read length, depth, replicates
Is my data suitable for cassette exon analysis?Junction saturation + known/novel ratio + read length
Why does my AS analysis call so few events?Saturation curve, depth, library type, alignment 2-pass
Why does my AS analysis call so many novel junctions?Annotation completeness + novel% + biology check (TDP-43, SF3B1)
Are my SpliceAI predictions calibrated for my tissue?MaxEntScan + SpliceAI concordance for known sites
Did STAR 2-pass actually run cohort-style?Verify SJ.out.tab merging across samples
Is intron retention detectable in my data?Library type (must be rRNA-depleted); strand-specific
Are my microexons detectable?Read length >=100; aligner anchor settings; consider VAST-TOOLS

Experimental Design Audit (Before Sequencing)

DecisionFor splicing analysisRationale
Library preprRNA depletion (Ribo-Zero, RiboCop)poly(A) selection loses pre-mRNA, nascent transcripts, and detained introns; for IR analysis rRNA depletion is mandatory (convention)
Read lengthPE 100-150 nt (PE 150 strongly preferred)Junction-spanning reads need >=8 nt overhang on each exon; shorter single-end reads bias junction detection toward shorter exons (convention)
PairingPaired-endSingle-end loses fragment-level disambiguation of junctions
Depth50-100M reads/sampleDGE-grade 30M misses low-PSI events; 100M for low-abundance event discovery
StrandednessStranded library (Illumina TruSeq stranded)Distinguishes overlapping antisense; some tools double-count unstranded junctions
Replicatesn>=3 per conditionn=2 vs n=2 has poor calibration in most tools (especially SUPPA2)
AnnotationGENCODE basic for canonical, comprehensive for DTU/discoverybasic = high-confidence; comprehensive includes putative — affects FDR control
MicroexonsPE 100+ with --alignSJoverhangMin 8; VAST-TOOLSDefault aligners miss 3-27nt exons
Long-intron genes (TTN, brain)Increased --alignIntronMaxDefault 1Mb may miss >1Mb introns

STAR 2-Pass Alignment

Goal: Maximize novel-junction sensitivity for downstream AS analysis.

Approach: Run STAR once per sample to discover novel junctions (pass 1), merge novel junctions across cohort, then re-align with the augmented junction set (pass 2). Cohort-style 2-pass beats per-sample basic 2-pass for differential splicing because all samples use the same junction reference.

bash
# Pass 1: per-sample
STAR --runMode alignReads \
--runThreadN 8 \
--genomeDir genome_index \
--sjdbGTFfile gencode.v45.basic.gtf \
--sjdbOverhang 149 \
--readFilesIn sample_R1.fq.gz sample_R2.fq.gz \
--readFilesCommand zcat \
--outSAMtype BAM SortedByCoordinate \
--outFileNamePrefix pass1_${sample}_ \
--outSJtype Standard \
--outFilterMultimapNmax 20 \
--alignSJoverhangMin 8 \
--alignSJDBoverhangMin 1
bash
# Cohort-style 2-pass: collect all SJ.out.tab from pass 1
cat pass1_*_SJ.out.tab | awk '$5 > 0 && $7 >= 3' | sort -u > cohort_novel_SJ.tab
# Pass 2: re-align with augmented junctions
STAR --runMode alignReads \
--runThreadN 8 \
--genomeDir genome_index \
--sjdbGTFfile gencode.v45.basic.gtf \
--sjdbFileChrStartEnd cohort_novel_SJ.tab \
--sjdbOverhang 149 \
--readFilesIn sample_R1.fq.gz sample_R2.fq.gz \
--readFilesCommand zcat \
--outSAMtype BAM SortedByCoordinate \
--outFileNamePrefix pass2_${sample}_ \
--outSJtype Standard \
--twopassMode None \
--quantMode GeneCounts \
--alignSJoverhangMin 8 \
--alignSJDBoverhangMin 3
ApproachNovel-junction recoveryCohort consistency
1-pass with annotation~80-86% (depends on GENCODE completeness)High (annotation-based)
Per-sample basic 2-pass (--twopassMode Basic)>=94%Variable (each sample has its own junction set)
Cohort-style 2-pass (manual merge)>=94%High (shared junction reference)

Per-sample 2-pass (--twopassMode Basic) is simpler but produces inconsistent junction sets across samples; for differential splicing the cohort-style version is preferred (Veeneman 2016 Bioinformatics).

The pass-1 filter awk '$5 > 0 && $7 >= 3' keeps junctions with strand info AND >=3 unique reads — adjust threshold to balance discovery vs noise.

Junction Saturation

Goal: Determine whether sequencing depth is sufficient for comprehensive splicing detection.

Approach: Run RSeQC junction saturation; check whether the discovery curve plateaus.

bash
junction_saturation.py \
-i sample.bam \
-r gencode_v45.bed \
-o sample_junc_sat \
-m 50
python
import subprocess
import pandas as pd
samples = ['s1.bam', 's2.bam', 's3.bam']
for sample in samples:
subprocess.run([
'junction_saturation.py',
'-i', sample,
'-r', 'gencode_v45.bed',
'-o', sample.replace('.bam', '_junc_sat')
], check=True)

The output *.junctionSaturation_plot.r plots known + novel junctions vs subsampled reads.

Plateau detection rule: if from 80% to 100% of reads, the junction count rises by <2%, consider it plateaued. Still rising means more sequencing would yield more junctions.

For AS analysis, plateau on the known junction curve is the requirement; novel-junction curves often don't plateau even at deep coverage (which is biologically informative — novel junctions are inherently rarer events).

Novel-vs-Known Junction Ratio

Goal: Detect annotation/mapping issues or biologically interesting cryptic splicing.

Approach: Classify junctions with RSeQC and compute the novel:known ratio.

bash
junction_annotation.py -i sample.bam -r gencode_v45.bed -o sample_junc_annot
python
import pandas as pd
# RSeQC .junction.xls has a header: chrom, intron_st(0-based), intron_end(1-based), read_count, annotation
junc = pd.read_csv('sample_junc_annot.junction.xls', sep='\t')
total = junc['read_count'].sum()
by_class = junc.groupby('annotation')['read_count'].sum()
known_frac = by_class.get('annotated', 0) / total
novel_frac = (by_class.get('partial_novel', 0) + by_class.get('complete_novel', 0)) / total
print(f'known: {known_frac:.1%}, novel: {novel_frac:.1%}')
Known fractionStatusInterpretation
>=80%HealthyComprehensive annotation, good alignment
60-80%AcceptableCheck annotation completeness or organism
<60%Suspect or interestingMapping artifacts, contamination, OR biologically informative

High novel-junction rate may be biology, not artifact:

  • TDP-43 loss (ALS/FTD post-mortem brain): cryptic exon de-repression in UNC13A, STMN2, ATG4B (Brown 2022 Nature; Klim 2019 Nat Neurosci)
  • SF3B1-mutant cancer (MDS, CLL, uveal melanoma): cryptic 3'ss ~10-30nt upstream of canonical (Darman 2015 Cell Rep)
  • Non-model organism: GENCODE-grade annotation unavailable; novel junctions reflect annotation gaps not biology
  • Microbial / viral contamination: reads aligning to host but with unusual junctions

If novel% >40%, drill down: check organism, check spliceosomal mutation status, check known disease signatures.

Junction Read Overhang and Coverage

Goal: Profile per-junction read counts and overhang distribution to identify weakly-supported events.

Approach: Parse CIGAR for N (intron) operations; tally per-junction reads and minimum exon overhangs.

python
import pysam
from collections import defaultdict
def junction_stats(bam_path):
bam = pysam.AlignmentFile(bam_path, 'rb')
counts = defaultdict(int)
min_overhang = defaultdict(lambda: float('inf'))
for read in bam.fetch():
if read.is_unmapped or read.is_secondary:
continue
ref_pos = read.reference_start
cumulative_query = 0
cigar = read.cigartuples
for i, (op, length) in enumerate(cigar):
if op == 3:
left_match = sum(l for o, l in cigar[:i] if o in (0, 7, 8))
right_match = sum(l for o, l in cigar[i+1:] if o in (0, 7, 8))
overhang = min(left_match, right_match)
key = (read.reference_name, ref_pos, ref_pos + length)
counts[key] += 1
min_overhang[key] = min(min_overhang[key], overhang)
if op in (0, 2, 3, 7, 8):
ref_pos += length
bam.close()
return counts, dict(min_overhang)
counts, overhang = junction_stats('sample.bam')
print(f'total junctions: {len(counts)}')
print(f'>= 10 reads: {sum(1 for c in counts.values() if c >= 10)}')
print(f'overhang >= 8 nt: {sum(1 for k, c in counts.items() if overhang[k] >= 8)}')

Junction reads with overhang <8 nt are common false positives, especially for novel sites. Most callers default to >=8 nt anchor for this reason. Microexon-aware aligners use overhang as low as 6 nt with explicit configuration.

Splice Site Strength (MaxEntScan and SpliceAI)

Goal: Score donor and acceptor splice sites to flag weak / cryptic sites and to predict variant impact on splicing.

Approach: Use MaxEntScan (sequence information content) and SpliceAI (context-aware deep-learning) — they answer different questions.

python
from maxentpy.maxent import score5, score3

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Grok Build (Cursor)
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/pku-yuangroup/openai4s/bio-alternative-splicing-splicing-qc/badge)](https://verified-skill.com/skills/pku-yuangroup/openai4s/bio-alternative-splicing-splicing-qc)

Something wrong with this skill or its page? Tell us.