Aim:

This pipeline uses raw Oxford Nanopore (ONT) data to run the following processes:

  1. De novo genome assemebly of ONT reads using flye https://github.com/fenderglass/Flye

  2. Sequence comparison of assembled genome to a provide Reference Genome;

  3. Nano-Q: conservatively cleaning ONT reads from bam files and estimate variant frequencies https://github.com/PrestonLeung/Nano-Q

Prerequisites:

Install Nextflow using the following User Guide: Nextflow

Inputs:

The index file (i.e., index.csv) can contain one or multiple samples information, one per line:

sampleid,sample_files,reference
ET300,/mnt/work/phylo/OxfordNanopore/ET300_barcode95/*.fastq.gz,/mnt/work/phylo/OxfordNanopore/ET300_MT921572_reference_sequence.fasta
NC483,/mnt/work/phylo/OxfordNanopore/NC483_barcode96/*.fastq.gz,/mnt/work/phylo/OxfordNanopore/NC483_NC001477_reference_sequence.fasta

Create an index.csv file using the following ‘run_create_index_ONT.sh’ script. Usage: bash run_create_index_ONT.sh SampleID /path/to/ONT/fastq_files.gz

#!/bin/bash
  
## eResearch,QUT
## Script: Generates an index.csv file for input to the ONTprocessing nextflow workflow

#Usage: run_create_index_ONT.sh SampleID /path/to/ONT/fastq_files/ 

##################################################################
SAMPLEID=$1
READSDIR=$2
REFERENCE='/mnt/work/phylo/OxfordNanopore/ET300_MT921572_reference_sequence.fasta'
##################################################################

#Create index.csv file
echo 'sampleid,sample_files,reference' > index.csv

echo 'ONT' > filesTemp
awk -v sample="$SAMPLEID" -v dir="$READSDIR" -v ref="$REFERENCE" '{print sample "," dir "*.fastq.gz," ref}' filesTemp >> index.csv 

rm filesTemp

Running the ONTprocessing nextflow pipeline:

Prepare a PBS pro submission script to run the ONTprocessing pipeline. An example launch.pbs script is the following:

#!/bin/bash -l
#PBS -N ontprocessing
#PBS -l select=1:ncpus=2:mem=4gb
#PBS -l walltime=24:00:00

#Use the current directory to run the workflow
cd $PBS_O_WORKDIR

module load java
NXF_OPTS='-Xms1g -Xmx4g'

nextflow run eresearchqut/ontprocessing --samplesheet index.csv

Create a folder where you analyses will be run, and place a copy of both launch.pbs and index.csv in the same folder. The submit the job to the HPC cluster:

qsub launch.pbs  

Monitor progress of the job:

qjobs

Outputs:

Find in a subfolder called ‘work’ all the intermediate files generating while running the ONTprocessing workflow - this folder is not typically used to assess the outputs but rather to debug any issues with the pipeline. Key intermediate files or outputs for specific ‘processes’ (analyses tasks) are saved to a subfolder called ‘results’ where data for the following analyses are presented:

#merge multiple FASTQ files:
merge/

#De novo genome assembly:
flye/

#Comparison to Reference Genome
infoseq/
blastn/

#Mapping of ONT reads and variant analysis 
minimap2/
samtools/
nano-q/