### Example Params File (YAML) Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md An example of a YAML file used to specify pipeline parameters. This format allows for clear organization of input, output, and configuration settings. ```yaml input: outdir: genome: 'GRCh37' <...> ``` -------------------------------- ### Run nf-core/rnaseq Pipeline Source: https://github.com/nf-core/rnaseq/blob/master/docs/output.md Example command to run the nf-core/rnaseq pipeline with a test profile. This command is typically used for initial testing or demonstration purposes. ```bash nextflow run nf-core/rnaseq -profile test_full, ``` -------------------------------- ### Start RStudio Server Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/de_rstudio.md Launches the RStudio server and keeps the Gitpod session active. Ensure sufficient sleep time for analysis. ```bash sudo rstudio-server start && sleep 5000 ``` -------------------------------- ### Install nf-metro and Dependencies Source: https://github.com/nf-core/rnaseq/blob/master/docs/dev/metro_map.md Installs the nf-metro package and cairosvg for rendering SVG to PNG. Ensure you have Python and pip installed. ```bash pip install 'nf-metro>=0.5.4' cairosvg ``` -------------------------------- ### BBSplit FASTA List Configuration Source: https://github.com/nf-core/rnaseq/blob/master/docs/output.md This example shows the required format for the `--bbsplit_fasta_list` parameter, which specifies the short name and path to reference genomes for BBSplit indexing. This list is used to build the index for binning reads. ```bash mm10,/path/to/mm10.fa ecoli,/path/to/ecoli.fa sarscov2,/path/to/sarscov2.fa ``` -------------------------------- ### Copy Static PNG to Documentation Directory Source: https://github.com/nf-core/rnaseq/blob/master/docs/dev/metro_map.md Copies the generated static PNG metro map to a specific subdirectory within the documentation for usage examples. ```bash cp docs/images/nf-core-rnaseq_metro_map_grey.png \ docs/usage/differential_expression_analysis/img/ ``` -------------------------------- ### Run RiboDetector for rRNA Removal Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use this command to enable RiboDetector for rRNA removal. Ensure RiboDetector is installed and configured. ```bash nextflow run nf-core/rnaseq --remove_ribo_rna --ribo_removal_tool ribodetector ... ``` -------------------------------- ### Example Generated Samplesheet with BAM Paths Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md This CSV format shows the structure of a samplesheet generated after the initial run, including paths to genome_bam and transcriptome_bam files. ```csv sample,fastq_1,fastq_2,strandedness,seq_platform,seq_center,genome_bam,percent_mapped,transcriptome_bam SAMPLE1,/path/sample1_R1.fastq.gz,/path/sample1_R2.fastq.gz,forward,ILLUMINA,,results/star_salmon/SAMPLE1.markdup.sorted.bam,85.2,results/star_salmon/SAMPLE1.Aligned.toTranscriptome.out.bam SAMPLE2,/path/sample2_R1.fastq.gz,,reverse,ILLUMINA,,results/star_salmon/SAMPLE2.sorted.bam,92.1,results/star_salmon/SAMPLE2.Aligned.toTranscriptome.out.bam ``` -------------------------------- ### Load Required R Libraries Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/de_rstudio.md Loads essential R packages for data manipulation (tidyverse), differential expression analysis (DESeq2), heatmap visualization (pheatmap), color palettes (RColorBrewer), and text label repulsion (ggrepel). Installs pheatmap if missing. ```r #### Loading libraries #### # tidyverse: collection of R packages for data manipulation, visualization and modeling library("tidyverse") # DESeq2: package for differential gene expression analysis library("DESeq2") # pheatmap: package for creating heatmaps, which will be used to visualise the results install.packages("pheatmap") # To install the package missing in the current RStudio env library("pheatmap") # RColorBrewer: package for creating color palettes, which will be used to customise the heatmaps library("RColorBrewer") # ggrepel: package that provides geoms for ggplot2 to repel overlapping text labels in the plots library("ggrepel") ``` -------------------------------- ### Custom Kallisto Quantification Arguments Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Supply additional arguments to Kallisto quantification using '--extra_kallisto_quant_args'. This can be used to specify library strandedness, for example. ```bash --extra_kallisto_quant_args "--fr-stranded" ``` -------------------------------- ### Step 1: Initial Run with BAM Generation Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Run the pipeline to generate BAM files and a samplesheet for future reprocessing. Use the --save_align_intermeds flag to publish BAM files. ```bash nextflow run nf-core/rnaseq \ --input samplesheet.csv \ --save_align_intermeds \ --outdir results_initial \ -profile docker ``` -------------------------------- ### Create R Project and Script Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/de_rstudio.md Initializes a new R project and creates an R script file for analysis commands. The working directory should be set up correctly. ```r #### Differential expression analysis with DESeq2 #### ``` -------------------------------- ### Launch nf-core/rnaseq Pipeline (Bash) Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/rnaseq.md Execute the nf-core/rnaseq pipeline using a specific version, input samplesheet, output directory, genome, and aligner. Includes parameters to skip certain QC steps for faster execution. ```bash nextflow run nf-core/rnaseq -r 3.12.0 \ --input /workspace/gitpod/training/data/reads/rnaseq_samplesheet.csv \ --outdir ./results_star_salmon \ --genome GRCh38chr21 \ --aligner star_salmon \ --pseudo_aligner salmon \ --skip_biotype_qc \ --skip_stringtie \ --skip_bigwig \ --skip_umi_extract \ --skip_trimming \ --skip_fastqc \ --skip_markduplicates \ --skip_dupradar \ --skip_rseqc \ --skip_qualimap ``` -------------------------------- ### Specify Samplesheet Input Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use the --input parameter to specify the path to your samplesheet file. This file must contain sample information, including FASTQ file locations and strandedness. ```bash --input '[path to samplesheet file]' ``` -------------------------------- ### Custom Salmon Quantification Arguments Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Provide custom parameters to the Salmon quantification command via '--extra_salmon_quant_args'. For example, to enable sequence bias correction. ```bash --extra_salmon_quant_args "--seqBias --gcBias" ``` -------------------------------- ### Disable fq lint validator Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use the extra_fqlint_args parameter to disable specific validators from fq. For example, disable the paired read name check by setting it to --disable-validator P001. ```bash --extra_fqlint_args "--disable-validator P001" ``` -------------------------------- ### Per-sample Quantification with Salmon Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md This command demonstrates how to run the pipeline for per-sample quantification using Salmon, skipping alignment and merging steps. It's optimized for speed when only quantification is needed. ```bash nextflow run nf-core/rnaseq \ --input samplesheet.csv \ --pseudo_aligner salmon \ --skip_alignment \ --skip_quantification_merge \ --outdir results ``` -------------------------------- ### Run nf-core/rnaseq Pipeline Source: https://github.com/nf-core/rnaseq/blob/master/README.md Basic command to execute the nf-core/rnaseq pipeline. Requires specifying input samplesheet, output directory, genome annotation (GTF), and genome FASTA file. A profile for execution environment (e.g., Docker, Singularity) must also be provided. ```bash nextflow run nf-core/rnaseq \ --input \ --outdir \ --gtf \ --fasta \ -profile ``` -------------------------------- ### R Design Formula Examples Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/theory.md Specifies the sources of variation for the statistical model. The tilde (~) indicates a formula relationship. The order of variables does not affect results, but the main factor of interest is commonly placed last. ```r design = ~ condition ``` ```r design = ~ sex + developmental_stage + condition ``` -------------------------------- ### Enable RustQC in nf-core/rnaseq Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md To enable RustQC, use the --use_rustqc flag. This flag automatically skips the individual QC tools that RustQC replaces. ```bash nextflow run nf-core/rnaseq \ --input samplesheet.csv \ --outdir results \ --fasta genome.fa \ --gtf annotation.gtf \ --use_rustqc \ -profile docker ``` -------------------------------- ### Run STAR Alignment with Parabricks GPU Acceleration Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md This command initiates the nf-core/rnaseq pipeline with Parabricks for GPU-accelerated STAR alignment. Ensure you have NVIDIA GPUs and the necessary container runtime (Docker/Singularity). ```bash nextflow run nf-core/rnaseq \ --input samplesheet.csv \ --outdir results \ --fasta genome.fa \ --gtf annotation.gtf \ --use_parabricks_star \ -profile docker ``` -------------------------------- ### Load Enrichment Analysis Libraries Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/de_rstudio.md Loads necessary R libraries for functional enrichment analysis, including clusterProfiler for enrichment, org.Hs.eg.db for human gene annotation, and cowplot for plot manipulation. Includes installation for cowplot if missing. ```r library(clusterProfiler) library(org.Hs.eg.db) install.packages("cowplot") # To install the package missing in the current RStudio env library(cowplot) ``` -------------------------------- ### Basic Pipeline Execution Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Standard command to run the pipeline with essential parameters for input, output, and genome data. Requires a samplesheet, output directory, GTF file, and genome FASTA file. Uses the 'docker' profile for execution. ```bash nextflow run \ nf-core/rnaseq \ --input \ --outdir \ --gtf \ --fasta \ -profile docker ``` -------------------------------- ### Run Linting with nf-core/tools Source: https://github.com/nf-core/rnaseq/blob/master/docs/CONTRIBUTING.md Enforce nf-core guidelines by running lint tests on the pipeline directory. Failures or warnings will provide links to documentation for correction. ```bash nf-core pipelines lint ``` -------------------------------- ### Run RNA-Seq Pipeline with Prokaryotic Profile Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md This command initiates the nf-core/rnaseq pipeline with settings optimized for prokaryotic data, using Docker for containerization. Ensure your input files (samplesheet.csv, genome.fasta, annotation.gff3) are correctly specified. ```bash nextflow run nf-core/rnaseq \ --input samplesheet.csv \ --fasta genome.fasta \ --gff annotation.gff3 \ --outdir results \ -profile prokaryotic,docker ``` -------------------------------- ### Set Sentieon License (File) Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use this command to set the Sentieon license secret when the license is provided as a file. The file content is base64-encoded. ```bash nextflow secrets set SENTIEON_LICENSE_BASE64 $(cat | base64 -w 0) ``` -------------------------------- ### Run nf-test Locally Source: https://github.com/nf-core/rnaseq/blob/master/docs/CONTRIBUTING.md Execute local tests using nf-test. Always include the 'test' profile explicitly, as this pipeline supports both CPU and GPU test profiles. ```bash nf-test test --tag test --profile +docker --verbose ``` -------------------------------- ### Download Latest Ensembl Human Reference Files Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use these commands to download the latest Ensembl human reference FASTA and GTF files for GRCh38. Ensure consistency in reference resource usage to avoid compatibility issues. ```bash latest_release=$(curl -s 'http://rest.ensembl.org/info/software?content-type=application/json' | grep -o '"release":[0-9]*' | cut -d: -f2) wget -L ftp://ftp.ensembl.org/pub/release-${latest_release}/fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa.gz wget -L ftp://ftp.ensembl.org/pub/release-${latest_release}/gtf/homo_sapiens/Homo_sapiens.GRCh38.${latest_release}.gtf.gz ``` -------------------------------- ### Enable rRNA Removal with Bowtie2 Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use this command to enable rRNA removal using the Bowtie2 tool. A rRNA database manifest file must be specified via --ribo_database_manifest. ```bash nextflow run nf-core/rnaseq --remove_ribo_rna --ribo_removal_tool bowtie2 ... ``` -------------------------------- ### Configure Reference Genome and Annotations (Groovy) Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/rnaseq.md Add this code to your `nextflow.config` file to define a new genome entry, specifying paths to FASTA, GFF, transcript FASTA, and pre-built STAR and Salmon indices. ```groovy igenomes_base = '/workspace/gitpod/training/data/refs/' genomes { 'GRCh38chr21' { fasta = "${params.igenomes_base}/sequence/Homo_sapiens_assembly38_chr21.fasta" fasta_fai = "${params.igenomes_base}/sequence/Homo_sapiens_assembly38_chr21.fasta.fai" gff = "${params.igenomes_base}/gencode_v29_chr21_parsed.gff" transcript_fasta = "${params.igenomes_base}/gencode.v29.transcripts_chr21.fa" star_index = "${params.igenomes_base}/star_index_chr21.tar.gz" salmon_index = "${params.igenomes_base}/salmon_index_chr21.tar.gz" } } ``` -------------------------------- ### Running Salmon in Isolation Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use the '--skip_alignment' parameter to run Salmon or Kallisto in isolation, without the standard alignment workflow. This is useful if you only need pseudoalignment and quantification. ```bash --skip_alignment ``` -------------------------------- ### Rapid Quantification Profile Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md This command utilizes a pre-defined profile 'rapid_quant' to bundle common options for fast, per-sample quantification, including alignment-independent QC skips. It also specifies Docker for containerized execution. ```bash nextflow run nf-core/rnaseq \ --input samplesheet.csv \ -profile rapid_quant,docker \ --outdir results ``` -------------------------------- ### Enable GPU Acceleration for RiboDetector Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md To leverage GPU acceleration with RiboDetector, use the `--use_gpu_ribodetector` flag. This requires a CUDA-enabled environment with PyTorch GPU support. ```bash nextflow run nf-core/rnaseq --remove_ribo_rna --ribo_removal_tool ribodetector --use_gpu_ribodetector ... ``` -------------------------------- ### Check Sample Name Matching Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/de_rstudio.md Verify that sample names in the count data and metadata match and are in the correct order to prevent DESeq2 errors. ```r all(colnames(dds$counts) %in% rownames(metadata)) # Must be TRUE all(colnames(dds$counts) == rownames(metadata)) # Must be TRUE ``` -------------------------------- ### Set Computational Resources (Groovy) Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage/differential_expression_analysis/rnaseq.md Configure computational resource limits such as maximum CPUs, memory, and time by adding these parameters to the `params` directive in your `nextflow.config` file. ```groovy params { max_cpus = 2 max_memory = '6.5GB' max_time = '2.h' } ``` -------------------------------- ### Render Static SVG and PNG Metro Map Source: https://github.com/nf-core/rnaseq/blob/master/docs/dev/metro_map.md Generates a static SVG metro map and converts it to PNG using nf-metro and cairosvg. The `--theme light`, `--x-spacing`, `--y-spacing`, and `--no-straight-diamonds` options customize the map's appearance. The `--logo` option includes a pipeline logo. ```bash nf-metro render assets/metro_map.mmd \ -o docs/images/nf-core-rnaseq_metro_map_grey.svg \ --theme light --x-spacing 60 --y-spacing 40 \ --no-straight-diamonds \ --logo docs/images/nf-core-rnaseq_logo_light.png ``` ```python python -c "import cairosvg; cairosvg.svg2png( url='docs/images/nf-core-rnaseq_metro_map_grey.svg', write_to='docs/images/nf-core-rnaseq_metro_map_grey.png', output_width=2265)" ``` -------------------------------- ### FASTP FASTQ Sampling Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use the `--extra_fastp_args` parameter to specify the `--reads_to_process` option for fastp. This allows you to limit the number of reads processed for testing or resource management. ```bash --trimmer fastp --extra_fastp_args '--reads_to_process 10000' ``` -------------------------------- ### Pipeline Execution with Params File Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Execute the pipeline using parameters defined in an external YAML or JSON file. This simplifies repeated runs with the same settings. Ensure the params file is correctly formatted and accessible. ```bash nextflow run nf-core/rnaseq -profile docker -params-file params.yaml ``` -------------------------------- ### Render Animated SVG Metro Map Source: https://github.com/nf-core/rnaseq/blob/master/docs/dev/metro_map.md Creates an animated SVG metro map for use in the README file. The `--animate` flag enables animation. Other options are similar to static rendering. ```bash nf-metro render assets/metro_map.mmd \ -o docs/images/nf-core-rnaseq_metro_map_grey_animated.svg \ --theme light --x-spacing 60 --y-spacing 40 --animate \ --no-straight-diamonds \ --logo docs/images/nf-core-rnaseq_logo_light.png ``` -------------------------------- ### Enable rRNA Removal with SortMeRNA Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use this command to enable rRNA removal using the default SortMeRNA tool. Ensure you have the necessary rRNA database configured. ```bash nextflow run nf-core/rnaseq --remove_ribo_rna --ribo_removal_tool sortmerna ... ``` -------------------------------- ### Set Sentieon License (String) Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use this command to set the Sentieon license secret when the license is provided as a string (IP:Port). The license string is base64-encoded. ```bash nextflow secrets set SENTIEON_LICENSE_BASE64 $(echo -n | base64 -w 0) ``` -------------------------------- ### Step 2: Reprocessing Run with BAM Input Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Reprocess data using the generated samplesheet with BAM files, skipping the alignment step. The --skip_alignment flag ensures BAM files are used for post-processing and quantification. ```bash nextflow run nf-core/rnaseq \ --input samplesheets/samplesheet_with_bams.csv \ --skip_alignment \ --outdir results_reprocessed \ -profile docker ``` -------------------------------- ### Enable Specific RustQC Modules Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md While RustQC includes Preseq and TIN by default, you can explicitly enable or disable specific RSeQC modules using these options. This is useful for fine-tuning the QC process. ```bash --skip_preseq false \ --rseqc_modules bam_stat,inner_distance,infer_experiment,junction_annotation,junction_saturation,read_distribution,read_duplication,tin ``` -------------------------------- ### Run Pipeline with GFFRead for Prokaryotic Genomes Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use this command to run the pipeline with the `--gffread_transcript_fasta` parameter, which is useful when RSEM fails to extract transcripts correctly, especially with non-standard annotation formats. ```bash nextflow run nf-core/rnaseq \ --input samplesheet.csv \ --fasta genome.fasta \ --gtf annotation.gtf \ --gffread_transcript_fasta \ --outdir results \ -profile docker ``` -------------------------------- ### Pipeline Execution on ARM Architectures Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Run the pipeline in an ARM-compatible mode by specifying the 'arm64' profile alongside 'docker'. This enables the use of ARM-compatible containers and adjusts Conda definitions for ARM operations. Note that this profile is experimental. ```bash nextflow run \ nf-core/rnaseq \ --input \ --outdir \ --gtf \ --fasta \ -profile docker,arm64 ``` -------------------------------- ### Custom STAR Alignment Parameters for 3′ Assays Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Use these parameters to adjust STAR aligner settings for 3′ RNA-seq protocols like QuantSeq, by decreasing mismatch tolerance and clipping poly(A) tails. Pipeline defaults may be overridden. ```bash --extra_star_align_args "--outFilterMismatchNoverLmax 0.1 --clip3pAdapterSeq AAAAAAAA" ``` -------------------------------- ### Set Nextflow Memory Options Source: https://github.com/nf-core/rnaseq/blob/master/docs/usage.md Limit the memory allocated to the Nextflow Java virtual machine. Add this line to your environment configuration file (e.g., ~/.bashrc). ```bash NXF_OPTS='-Xms1g -Xmx4g' ```