Skill Tracer
Skills › Knowledge Work Plugins › nextflow-development › rnaseq.md

rnaseq.md

118 lines · bio-research/skills/nextflow-development/references/pipelines/rnaseq.md at 2574e29

Open on GitHub
1# nf-core/rnaseq
2
3**Version:** 3.22.2
4
5**Official Documentation:** https://nf-co.re/rnaseq/3.22.2/
6**GitHub:** https://github.com/nf-core/rnaseq
7
8> **Note:** When updating to a new version, check the [releases page](https://github.com/nf-core/rnaseq/releases) for breaking changes and update the version in commands below.
9

nf-core/rnaseq

Version: 3.22.2

Official Documentation: https://nf-co.re/rnaseq/3.22.2/ GitHub: https://github.com/nf-core/rnaseq

Note: When updating to a new version, check the releases page for breaking changes and update the version in commands below.
Raw lines 1 to 9
10## Contents
11- [Test command](#test-command)
12- [Samplesheet format](#samplesheet-format)
13- [Parameters](#parameters)
14- [Output files](#output-files)
15- [Downstream analysis](#downstream-analysis)

Contents

  • Test command
  • Samplesheet format
  • Parameters
  • Output files
  • Downstream analysis
Raw lines 10 to 16
17## Test command
19```bash
20nextflow run nf-core/rnaseq -r 3.22.2 -profile test,docker --outdir test_rnaseq
21```
23Expected: ~15 min, creates `multiqc/multiqc_report.html`.

Test command

nextflow run nf-core/rnaseq -r 3.22.2 -profile test,docker --outdir test_rnaseq

Expected: ~15 min, creates multiqc/multiqc_report.html.

Raw lines 17 to 24
25## Samplesheet format
27```csv
28sample,fastq_1,fastq_2,strandedness
29CONTROL_REP1,/path/to/ctrl1_R1.fq.gz,/path/to/ctrl1_R2.fq.gz,auto
30CONTROL_REP2,/path/to/ctrl2_R1.fq.gz,/path/to/ctrl2_R2.fq.gz,auto
31TREATMENT_REP1,/path/to/treat1_R1.fq.gz,/path/to/treat1_R2.fq.gz,auto
32```
34| Column | Required | Values |
35|--------|----------|--------|
36| sample | Yes | Alphanumeric, underscores allowed |
37| fastq_1 | Yes | Absolute path to R1 |
38| fastq_2 | No | Absolute path to R2 (empty for single-end) |
39| strandedness | Yes | `auto`, `forward`, `reverse`, `unstranded` |
41**Strandedness guide:**
42- `auto`: Inferred from data (recommended)
43- `forward`: TruSeq Stranded, dUTP protocols
44- `reverse`: Ligation-based protocols
45- `unstranded`: Non-stranded protocols

Samplesheet format

sample,fastq_1,fastq_2,strandedness
CONTROL_REP1,/path/to/ctrl1_R1.fq.gz,/path/to/ctrl1_R2.fq.gz,auto
CONTROL_REP2,/path/to/ctrl2_R1.fq.gz,/path/to/ctrl2_R2.fq.gz,auto
TREATMENT_REP1,/path/to/treat1_R1.fq.gz,/path/to/treat1_R2.fq.gz,auto
ColumnRequiredValues
sampleYesAlphanumeric, underscores allowed
fastq_1YesAbsolute path to R1
fastq_2NoAbsolute path to R2 (empty for single-end)
strandednessYesauto, forward, reverse, unstranded

Strandedness guide:

  • auto: Inferred from data (recommended)
  • forward: TruSeq Stranded, dUTP protocols
  • reverse: Ligation-based protocols
  • unstranded: Non-stranded protocols
Raw lines 25 to 46
47## Parameters
49### Minimal run
50```bash
51nextflow run nf-core/rnaseq -r 3.22.2 -profile docker \
52 --input samplesheet.csv --outdir results --genome GRCh38
53```

Minimal run

nextflow run nf-core/rnaseq -r 3.22.2 -profile docker \
    --input samplesheet.csv --outdir results --genome GRCh38
Raw lines 49 to 54
55### Common parameters
57| Parameter | Default | Description |
58|-----------|---------|-------------|
59| `--aligner` | `star_salmon` | Options: `star_salmon`, `star_rsem`, `hisat2` |
60| `--genome` | - | `GRCh38`, `GRCh37`, `mm10`, `BDGP6` |
61| `--pseudo_aligner` | - | Set to `salmon` for pseudo-alignment only |
62| `--skip_trimming` | false | Skip adapter trimming |
63| `--skip_alignment` | false | Pseudo-alignment only |

Common parameters

ParameterDefaultDescription
--alignerstar_salmonOptions: star_salmon, star_rsem, hisat2
--genome-GRCh38, GRCh37, mm10, BDGP6
--pseudo_aligner-Set to salmon for pseudo-alignment only
--skip_trimmingfalseSkip adapter trimming
--skip_alignmentfalsePseudo-alignment only
Raw lines 55 to 64
65### Custom reference
66```bash
67--fasta /path/to/genome.fa \
68--gtf /path/to/annotation.gtf \
69--star_index /path/to/star/ # Optional, builds if absent
70```

Custom reference

--fasta /path/to/genome.fa \
--gtf /path/to/annotation.gtf \
--star_index /path/to/star/  # Optional, builds if absent
Raw lines 65 to 71
72## Output files
74```
75results/
76├── star_salmon/
77│ ├── salmon.merged.gene_counts.tsv # Raw counts for DESeq2
78│ ├── salmon.merged.gene_tpm.tsv # TPM values
79│ └── *.bam # Alignments
80├── multiqc/
81│ └── multiqc_report.html # QC summary
82└── pipeline_info/
83```
85**Key outputs:**
86- `salmon.merged.gene_counts.tsv`: Input for DESeq2/edgeR
87- `salmon.merged.gene_tpm.tsv`: Normalized expression

Output files

results/
├── star_salmon/
│   ├── salmon.merged.gene_counts.tsv    # Raw counts for DESeq2
│   ├── salmon.merged.gene_tpm.tsv       # TPM values
│   └── *.bam                            # Alignments
├── multiqc/
│   └── multiqc_report.html              # QC summary
└── pipeline_info/

Key outputs:

  • salmon.merged.gene_counts.tsv: Input for DESeq2/edgeR
  • salmon.merged.gene_tpm.tsv: Normalized expression
Raw lines 72 to 88
89## Downstream analysis
91```r
92library(DESeq2)
93counts <- read.delim("salmon.merged.gene_counts.tsv", row.names=1)
94coldata <- data.frame(
95 condition = factor(c("control", "control", "treatment", "treatment"))
97dds <- DESeqDataSetFromMatrix(
98 countData = round(counts),
99 colData = coldata,
100 design = ~ condition
102dds <- DESeq(dds)
103res <- results(dds, contrast = c("condition", "treatment", "control"))
104```

Downstream analysis

library(DESeq2)
counts <- read.delim("salmon.merged.gene_counts.tsv", row.names=1)
coldata <- data.frame(
    condition = factor(c("control", "control", "treatment", "treatment"))
)
dds <- DESeqDataSetFromMatrix(
    countData = round(counts),
    colData = coldata,
    design = ~ condition
)
dds <- DESeq(dds)
res <- results(dds, contrast = c("condition", "treatment", "control"))
Raw lines 89 to 105
106## Troubleshooting
108**STAR index fails**: Increase memory with `--max_memory '64.GB'` or provide pre-built `--star_index`.
110**Low alignment rate**: Verify genome matches species; check FastQC for adapter contamination.
112**Strandedness detection fails**: Specify explicitly with `--strandedness reverse`.

Troubleshooting

STAR index fails: Increase memory with --max_memory '64.GB' or provide pre-built --star_index.

Low alignment rate: Verify genome matches species; check FastQC for adapter contamination.

Strandedness detection fails: Specify explicitly with --strandedness reverse.

Raw lines 106 to 113
114## More Information
116- **Full parameter list:** https://nf-co.re/rnaseq/3.22.2/parameters/
117- **Output documentation:** https://nf-co.re/rnaseq/3.22.2/docs/output/
118- **Usage documentation:** https://nf-co.re/rnaseq/3.22.2/docs/usage/

More Information

  • Full parameter list: https://nf-co.re/rnaseq/3.22.2/parameters/
  • Output documentation: https://nf-co.re/rnaseq/3.22.2/docs/output/
  • Usage documentation: https://nf-co.re/rnaseq/3.22.2/docs/usage/
Raw lines 114 to 118