6.4 Huntington Disease samples profiling against miRBase

Overview

  • Create a metadata “samplesheet.csv” for small RNAseq datasets.

  • Learn to use a “nextflow.config” file in the working directory to override Nextflow parameters (e.g., specify where to find the pipeline assets).

  • Learn how to prepare a PBS script to run the expression profiling of small RNAs against the reference miRBase database annotated microRNAs.

Preparing the pipeline inputs

The pipeline requires preparing at least 2 files:

  • Metadata file (samplesheet.csv) that specifies the name of the samples, location of FASTQ files ('Read 1' and ‘Read 2’), and strandedness (forward, reverse, or auto. Note: auto is used when the strandedness of the data is unknown)

  • PBS Pro script (launch_nf-core_RNAseq_QC.pbs) with instructions to run the pipeline

  • Nextflow.config - revision 2.3.1 of the nf-core/smrnaseq pipeline may not be able to identify the location of reference adapter sequences, thus, we will use a local nextflow.config file to tell Nextflow where to find the reference adapters necessary to trim the raw small_RNA-Seq data

A. Create the metadata file (samplesheet.csv):

Change to the data folder directory:

cd $HOME/workshop/2024-2/session6_smallRNAseq/data/human_disease

Copy the bash script to the working folder

cp /work/training/2024/smallRNAseq/scripts/create_nf-core_smallRNAseq_samplesheet.sh $HOME/workshop/2024-2/session6_smallRNAseq/data/human_disease
  • Note: you could replace ‘$HOME/workshop/data’ with “.” A dot indicates ‘current directory’ and will copy the file to the directory where you are currently located

View the content of the script:

cat create_nf-core_smallRNAseq_samplesheet.sh
image-20241025-063324.png

NOTE: modify ‘read1_extension’ as appropriate for your data. For example: _1.fastq.gz or _R1_001.fastq.gz or _R1.fq.gz , etc

Let’s generate the metadata file by running the following command:

Check the newly created samplesheet.csv file:

sample,fastq_1

ERR409878,/work/training/2024/smallRNAseq/data/human_disease/ERR409878.fastq.gz

ERR409879,/work/training/2024/smallRNAseq/data/human_disease/ERR409879.fastq.gz

ERR409880,/work/training/2024/smallRNAseq/data/human_disease/ERR409880.fastq.gz

ERR409881,/work/training/2024/smallRNAseq/data/human_disease/ERR409881.fastq.gz

ERR409882,/work/training/2024/smallRNAseq/data/human_disease/ERR409882.fastq.gz

ERR409883,/work/training/2024/smallRNAseq/data/human_disease/ERR409883.fastq.gz

ERR409884,/work/training/2024/smallRNAseq/data/human_disease/ERR409884.fastq.gz

ERR409885,/work/training/2024/smallRNAseq/data/human_disease/ERR409885.fastq.gz

ERR409886,/work/training/2024/smallRNAseq/data/human_disease/ERR409886.fastq.gz

ERR409887,/work/training/2024/smallRNAseq/data/human_disease/ERR409887.fastq.gz

ERR409888,/work/training/2024/smallRNAseq/data/human_disease/ERR409888.fastq.gz

ERR409889,/work/training/2024/smallRNAseq/data/human_disease/ERR409889.fastq.gz

ERR409890,/work/training/2024/smallRNAseq/data/human_disease/ERR409890.fastq.gz

ERR409891,/work/training/2024/smallRNAseq/data/human_disease/ERR409891.fastq.gz

ERR409892,/work/training/2024/smallRNAseq/data/human_disease/ERR409892.fastq.gz

ERR409893,/work/training/2024/smallRNAseq/data/human_disease/ERR409893.fastq.gz

ERR409894,/work/training/2024/smallRNAseq/data/human_disease/ERR409894.fastq.gz

ERR409895,/work/training/2024/smallRNAseq/data/human_disease/ERR409895.fastq.gz

ERR409896,/work/training/2024/smallRNAseq/data/human_disease/ERR409896.fastq.gz

ERR409897,/work/training/2024/smallRNAseq/data/human_disease/ERR409897.fastq.gz

ERR409898,/work/training/2024/smallRNAseq/data/human_disease/ERR409898.fastq.gz

ERR409899,/work/training/2024/smallRNAseq/data/human_disease/ERR409899.fastq.gz

ERR409900,/work/training/2024/smallRNAseq/data/human_disease/ERR409900.fastq.gz

sample,fastq_1

ERR409878,/work/training/2024/smallRNAseq/data/human_disease/ERR409878.fastq.gz

ERR409879,/work/training/2024/smallRNAseq/data/human_disease/ERR409879.fastq.gz

ERR409880,/work/training/2024/smallRNAseq/data/human_disease/ERR409880.fastq.gz

ERR409881,/work/training/2024/smallRNAseq/data/human_disease/ERR409881.fastq.gz

ERR409882,/work/training/2024/smallRNAseq/data/human_disease/ERR409882.fastq.gz

ERR409883,/work/training/2024/smallRNAseq/data/human_disease/ERR409883.fastq.gz

ERR409884,/work/training/2024/smallRNAseq/data/human_disease/ERR409884.fastq.gz

ERR409885,/work/training/2024/smallRNAseq/data/human_disease/ERR409885.fastq.gz

ERR409886,/work/training/2024/smallRNAseq/data/human_disease/ERR409886.fastq.gz

ERR409887,/work/training/2024/smallRNAseq/data/human_disease/ERR409887.fastq.gz

ERR409888,/work/training/2024/smallRNAseq/data/human_disease/ERR409888.fastq.gz

ERR409889,/work/training/2024/smallRNAseq/data/human_disease/ERR409889.fastq.gz

ERR409890,/work/training/2024/smallRNAseq/data/human_disease/ERR409890.fastq.gz

ERR409891,/work/training/2024/smallRNAseq/data/human_disease/ERR409891.fastq.gz

ERR409892,/work/training/2024/smallRNAseq/data/human_disease/ERR409892.fastq.gz

ERR409893,/work/training/2024/smallRNAseq/data/human_disease/ERR409893.fastq.gz

ERR409894,/work/training/2024/smallRNAseq/data/human_disease/ERR409894.fastq.gz

ERR409895,/work/training/2024/smallRNAseq/data/human_disease/ERR409895.fastq.gz

ERR409896,/work/training/2024/smallRNAseq/data/human_disease/ERR409896.fastq.gz

ERR409897,/work/training/2024/smallRNAseq/data/human_disease/ERR409897.fastq.gz

ERR409898,/work/training/2024/smallRNAseq/data/human_disease/ERR409898.fastq.gz

ERR409899,/work/training/2024/smallRNAseq/data/human_disease/ERR409899.fastq.gz

ERR409900,/work/training/2024/smallRNAseq/data/human_disease/ERR409900.fastq.gz

B. Prepare PBS Pro script to run the nf-core/smrnaseq pipeline

Copy the PBS Pro script for running the full small RNAseq pipeline (launch_nf-core_smallRNAseq_miRBase.pbs)

Copy and paste the code below to the terminal:

  • Line 1: Copy the samplesheet.csv file to the working directory

  • Line 2: Copy the launch_nf-core_smallRNAseq_human.pbs submission script to the working directory

  • Line 3: Copy the nextflow.config file from shared folder to my working directory.

  • Line 4: move to the working directory

View the content of the launch_nf-core_RNAseq_QC.pbs script:

image-20241027-041434.png

 

TIP: when running the nf-core/smrnaseq pipeline (release 2.3.1) the pipeline is not able to find the location of the reference adapter sequences for trimming of the raw small RNAseq pipeline, so we need to specify where to find the folder where the adapter sequences file is located. To do this, we prepare a “nextflow.config” file (see below). This file should be already in your working directory. Print the content as follows:

Note: if a config file is placed in the working folder it can override parameters define by the global ~/.nextflow/config file or the config file define as part of the pipeline.

Submit the job to the HPC cluster:

Monitor the progress:

The job will take several hours to run, hence we will use precomputed results for the statistical analysis in the next section.

Outputs

The pipeline will produce two folders, one called “work,” where all the processing is done, and another called “results,” where we can find the pipeline's outputs. The content of the results folder is as follows:

The quantification of the mature miRNA and hairpin expressions can be found in the /results/mirna_quant/edger_qc directory.

Let’s inspect the mature.csv file. Let’s use the ‘cat’ command to print it on the screen:

Note: the “mature_counts.csv” needs to be transposed prior running the statistical analysis. This can be done either user the R script or using a script called “transpose_csv.py”.

Let’s copy the transpose_csv.py script to the working folder:

The check how to use the script do the following:

To transpose the initial “mature_counst.csv” file do the following:

Let’s now print the transposed mature counts table: