Skip to content

chelauk/lp-wgs

Repository files navigation

Introduction

lp-wgs is a bioinformatics best-practice analysis pipeline for shallow whole genome sequence analyses.

The pipeline is built using Nextflow, a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The Nextflow DSL2 implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from nf-core/modules

Pipeline summary

  1. Read QC (FastQC)

  2. Trim Reads (Fastp)

  3. Align Reads (bwa) (optional: begin from this stage)

  4. Filter Bam (samtools) (optional: if it is set with --filter-bam the default is 90<=fragment size<=150, this can be set with --filter_bam_min and --filter_bam_max)

  5. Coverage (mosdepth)

  6. Alignment QC with (picard)

  7. GC counts (HMMcopy)

  8. read counts (HMMcopy)

  9. ICHOR cna calls and tumour cell fraction (ICHOR) Bin options for ICHOR include 1000kb,500kb,100kb and 10kb these are set with the --map_bin parameter for ichor the normal fraction and ploids and subclone fractions can be set, see here for low tumour fractions setting

    --ichor_purity cf_dna
    
  • will set these parameters for ichor automatically

      --normal "c(0.95, 0.99, 0.995, 0.999)"  
      --ploidy "c(2)"  
      --maxCN 3  
      --estimateScPrevalence FALSE   
      --scStates "c()"   
      --chrs "c(1:22)"   
      --chrTrain "c(1:22)" 
    
  • otherwise you can set

     --ichor_purity_manual  c(0.95, 0.99, 0.995, 0.999)
    

    which will set this parameter for ichor

     --normal "c(0.95, 0.99, 0.995, 0.999)"
    
  1. ACE Absolute Copy number Estimation using low-coverage whole genome sequencing data (ACE). The default script for ACE is
library(ACE)
args <- commandArgs(trailingOnly = TRUE)
output_folder <- args[1]
ploidy <- c(2, 3, 4)

runACE(
    outputdir = output_folder, filetype = "bam",
    genome = "hg38", ploidies = ploidy
)
  1. Collate QC (MultiQC)
flowchart TD
step1(reference fasta)
step2(fastqs)
step2-->step3(qc fastqc)
step2-->step4(trim fastp)
step1-->step5(align bwa)
step4-->step5(align bwa)
step5-->step6(coverage mosdepth)
step5-->step7(alignment qc picard)
step1-->step13(gccounter HMMCOPY)
step5-->step8(counter HMMCOPY)
step13-->step9(CNA ICHOR)
step8-->step9(CNA ICHOR)
step5-->step10(DNA ACE)
step10-->step11(copy number output)
step9-->step11(copy number output)
step3-->step12(multiqc)
step6-->step12(multiqc)
Loading

slurm quick start:

The pipeline will require a csv file with headers describing the paths to samples

  1. Starting from fastq example csv:
patient,sample,lane,fastq_1,fastq_2
patient1,sample1,1,./data/patient1_sample1_R1.fastq.gz,./data/patient1_sample1_R2.fastq.gz
patient1,sample2,1,./data/patient1_sample2_R1.fastq.gz,./data/patient1_sample2_R2.fastq.gz
patient2,sample1,1,./data/patient2_sample1_R1.fastq.gz,./data/patient2_sample1_R2.fastq.gz
patient2,sample2,1,./data/patient2_sample2_R1.fastq.gz,./data/patient2_sample2_R2.fastq.gz

Multi-lane samples are merged automatically with sambamba

example sbatch script:

#!/bin/bash -l
#SBATCH --job-name=nextflow
#SBATCH --output=nextflow_out.txt
#SBATCH --partition=master-worker
#SBATCH --ntasks=1
#SBATCH --time=96:00:00

module load java/jdk15.0.1
nextflow run /path/to/lp-wgs \
		--input input_fastq.csv  \
		--outdir results \
		--igenomes_base /path/to/reference \
		--step 'fastq' \
		-c local.config \
		-with-tower \
		-profile singularity \
		-resume

note that when starting with fastq you need to add --step fastq

note with regard to the reference path it needs to match this pattern:

            bwa                   = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/BWAIndex/"
            dict                  = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/WholeGenomeFasta/Homo_sapiens_assembly38.dict"
            fasta                 = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/WholeGenomeFasta/Homo_sapiens_assembly38.fasta"
            fasta_fai             = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/WholeGenomeFasta/Homo_sapiens_assembly38.fasta.fai"

or you can modify the genomes.config file yourself

  1. Starting from bam example csv:
patient,sample,fastq_1 ,fastq_2
patient1,sample1,./data/patient1_sample1.bam
patient1,sample2,./data/patient1_sample2.bam
patient2,sample1,./data/patient2_sample1.bam
patient2,sample2,./data/patient2_sample2.bam

example sbatch script:

#!/bin/bash -l
#SBATCH --job-name=nextflow
#SBATCH --output=nextflow_out.txt
#SBATCH --partition=master-worker
#SBATCH --ntasks=1
#SBATCH --time=96:00:00

module load java/jdk15.0.1
nextflow run /path/to/lp-wgs \
		--input input_fastq.csv  \
		--outdir results \
		--igenomes_base /path/to/reference \
		--step 'bam' \
		-c local.config \
		-with-tower \
		-profile singularity \
		-resume

Note that some form of configuration will be needed so that Nextflow knows how to fetch the required software. This is usually done in the form of a config profile (YOURPROFILE in the example command above). You can chain multiple config profiles in a comma-separated string.

  • The pipeline comes with config profiles called docker, singularity, podman, shifter, charliecloud and conda which instruct the pipeline to use the named tool for software management. For example, -profile test,docker.
  • Please check nf-core/configs to see if a custom config file to run nf-core pipelines already exists for your Institute. If so, you can simply use -profile <institute> in your command. This will enable either docker or singularity and set the appropriate execution settings for your local compute environment.
  • If you are using singularity, please use the nf-core download command to download images first, before running the pipeline. Setting the NXF_SINGULARITY_CACHEDIR or singularity.cacheDir Nextflow options enables you to store and re-use the images from a central location for future pipeline runs.
  • If you are using conda, it is highly recommended to use the NXF_CONDA_CACHEDIR or conda.cacheDir settings to store the environments in a central location for future pipeline runs.
  1. Start running your own analysis!

    nextflow run lp-wgs --input samplesheet.csv --outdir --genome GRCh38 -profile <docker/singularity/podman/shifter/charliecloud/conda/institute>

    
    

Credits

lp-wgs was originally written by Chela James George Cresswell.

We thank the following people for their extensive assistance in the development of this pipeline:

Contributions and Support

If you would like to contribute to this pipeline, please see the contributing guidelines.

Citations

An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.

This pipeline uses code and infrastructure developed and maintained by the nf-core community, reused here under the MIT license.

The nf-core framework for community-curated bioinformatics pipelines.

Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.

Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.

Releases

No releases published

Packages

No packages published