Repository navigation
Strandedness and STAR 2 pass
- Per-sample value from the
strandednesscolumn, if filled in; otherwiseauto. - Only
autosamples take their value from RSeQC (samtools sort/index-> GTF converted to BED12 ->infer_experiment.py->determine_strandedness.py). The forward- or reverse-strand fraction must reachstrandedness.min_fractionto callforward/reverse; otherwise the library is calledno(unstranded). - For
tetranscripts_diffexp, all samples in a contrast must resolve to the same strandedness value or the run fails with a clear error.
TEcount always receives raw, unsorted STAR output, per the TEtranscripts authors' recommendation.
Strandedness is the most damaging silent error in the pipeline. Getting it
wrong never fails a job — it just makes TEcount count the wrong strand,
roughly halving gene counts and inverting the antisense signal, and every
number downstream inherits that. It is also easy to get wrong: kit
documentation often says "stranded" without saying which direction, and
forward/reverse mean opposite things in different vocabularies.
So by default (strandedness.check_provided: true) RSeQC runs on every
sample, including those that declared a value, and the MultiQC report gains a
Strandedness check table comparing the two — modelled on
nf-core/rnaseq's check:
| Column | Meaning |
|---|---|
| Declared | the strandedness column (auto when left blank) |
| Inferred | what infer_experiment.py says the reads look like |
| Used | the --stranded value actually passed to TEcount/TElocal |
| Status |
OK, auto-detected, or MISMATCH (flagged red) |
| Forward / Reverse / Failed frac | the RSeQC fractions behind the call |
A mismatch is reported, never applied. An explicit sample sheet value
always wins for quantification; the check tells you to go look rather than
quietly changing your analysis. If the inference is right, the run needs
repeating with a corrected samples.csv.
When reading a mismatch, check the Failed fraction first: a low failed
fraction with one strand clearly dominant is strong evidence against the
sample sheet. A high failed fraction, or two similar fractions, means RSeQC
could not tell — the pipeline calls that unstranded because nothing else
can be justified, which is not the same as being confidently unstranded, and
the section says so when it happens.
Because RSeQC now runs on every sample, the report's built-in RSeQC → Infer
experiment plot also covers the whole cohort instead of only the auto
samples.
Set strandedness.check_provided: false to run RSeQC only where it is
actually needed (the auto samples), skipping the extra jobs on a large
cohort. The check table still renders, covering just those samples.
With star.two_pass: none, STAR alignment is guided only by the junctions
annotated in ref.gtf -- a read spanning a real but unannotated splice
junction can end up soft-clipped or reported as a spurious chimeric split
alignment instead of a clean spliced alignment. star.two_pass trades extra
STAR compute for more sensitive novel-junction detection (STAR manual
section 9):
cohortis the default for now, while this feature is being evaluated -- setstar.two_pass: noneto opt out and get the original, single-pass-only DAG.
-
per_sample-- STAR's own--twopassMode Basic. Each sample independently discovers its own novel junctions in a first pass, inserts them into its own genome index, then re-aligns in a second pass. No other rules change; roughly doublesstar_align's runtime per sample. -
cohort-- novel junctions are pooled across every sample before any sample's final alignment (the STAR manual's "multi-sample 2-pass" recipe). Adds two stages:star_align_pass1runs a throwaway, BAM-less alignment per sample (--outSAMtype None) purely to collectresults/star_pass1/{sample}_SJ.out.tab;star_merge_junctionspools every sample's novel (non-annotated) junctions, summing uniquely-mapping read support across samples and keeping only those reachingstar.two_pass_min_unique_reads(default3) intoresults/star_pass1/merged_SJ.out.tab. Every sample's finalstar_alignthen passes that file to STAR via--sjdbFileChrStartEnd. A junction too weakly supported in any single sample to be caught byper_samplemode can still survive here if it recurs (even weakly) across the cohort -- the tradeoff is a DAG sync point (no sample's final alignment starts until every sample's pass-1 has finished) and roughly 2x STAR compute plus the pass-1 jobs themselves.
Both modes only affect alignment sensitivity to unannotated splicing; they
do not produce a transcript/exon annotation (unlike e.g. StringTie), so
exons.bed/genes.bed for the chimera screen still come entirely from
ref.gtf either way.