Nanopore demultiplexing, QC and alignment pipeline

public public 1yr ago Version: 3.1.0 0 bookmarks
Loading...

Introduction

nfcore/nanoseq is a bioinformatics analysis pipeline for Nanopore DNA/RNA sequencing data that can be used to perform basecalling, demultiplexing, QC, alignment, and downstream analysis.

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 in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community!

On release, automated continuous integration tests run the pipeline on a full-sized dataset obtained from the Singapore Nanopore Expression Consortium on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources. The results obtained from the full-sized test can be viewed on the nf-core website .

Pipeline Summary

  1. Demultiplexing ( qcat ; optional )

  2. Raw read cleaning ( NanoLyse ; optional )

  3. Raw read QC ( NanoPlot , FastQC )

  4. Alignment ( GraphMap2 or minimap2 )

    • Both aligners are capable of performing unspliced and spliced alignment. Sensible defaults will be applied automatically based on a combination of the input data and user-specified parameters

    • Each sample can be mapped to its own reference genome if multiplexed in this way

    • Convert SAM to co-ordinate sorted BAM and obtain mapping metrics ( samtools )

  5. Create bigWig ( BEDTools , bedGraphToBigWig ) and bigBed ( BEDTools , bedToBigBed ) coverage tracks for visualisation

  6. DNA specific downstream analysis:

  7. RNA specific downstream analysis:

    • Transcript reconstruction and quantification ( bambu or StringTie2 )

      • bambu performs both transcript reconstruction and quantification

      • When StringTie2 is chosen, each sample can be processed individually and combined. After which, featureCounts will be used for both gene and transcript quantification.

    • Differential expression analysis ( DESeq2 and/or DEXSeq )

    • RNA modification detection ( xpore and/or m6anet )

    • RNA fusion detection ( JAFFAL )

  8. Present QC for raw read and alignment results ( MultiQC )

Functionality Overview

A graphical overview of suggested routes through the pipeline depending on the desired output can be seen below.

nf-core/nanoseq metro map

Quick Start

  1. Install Nextflow ( >=22.10.1 )

  2. Install any of Docker , Singularity (you can follow this tutorial ), Podman , Shifter or Charliecloud for full pipeline reproducibility (you can use Conda both to install Nextflow itself and also to manage software within pipelines. Please only use it within pipelines as a last resort; see docs ) .

  3. Download the pipeline and test it on a minimal dataset with a single command:

    nextflow run nf-core/nanoseq -profile test,YOURPROFILE
    

    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 and are persistently observing issues downloading Singularity images directly due to timeout or network issues, then you can use the --singularity_pull_docker_container parameter to pull and convert the Docker image instead. Alternatively, you can 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.

  4. Start running your own analysis!

Documentation

The nf-core/nanoseq pipeline comes with documentation about the pipeline usage , parameters and output .

nextflow run nf-core/nanoseq \
 --input samplesheet.csv \
 --protocol DNA \
 --barcode_kit SQK-PBK004 \
 -profile <docker/singularity/podman/institute>

See usage docs for all of the available options when running the pipeline.

An example input samplesheet for performing both basecalling and demultiplexing can be found here .

Credits

nf-core/nanoseq was originally written by Chelsea Sawyer and Harshil Patel from The Bioinformatics & Biostatistics Group for use at The Francis Crick Institute , London. Other primary contributors include Laura Wratten , Ying Chen , Yuk Kei Wan and Jonathan Goeke from the Genome Institute of Singapore , Christopher Hakkaart from Institute of Medical Genetics and Applied Genomics , Germany, and Johannes Alneberg and Franziska Bonath from SciLifeLab , Sweden.

Many thanks to others who have helped out along the way too, including (but not limited to): @crickbabs , @AnnaSyme , @ekushele .

Contributions and Support

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

For further information or help, don't hesitate to get in touch on Slack (you can join with this invite ).

Citations

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

You can cite the nf-core publication as follows:

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 .

Code Snippets

23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
run_bambu.r \\
    --tag=. \\
    --ncore=$task.cpus \\
    --annotation=$gtf \\
    --fasta=$fasta $bams

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
    bioconductor-bambu: \$(Rscript -e "library(bambu); cat(as.character(packageVersion('bambu')))")
    bioconductor-bsgenome: \$(Rscript -e "library(BSgenome); cat(as.character(packageVersion('BSgenome')))")
END_VERSIONS
"""
NextFlow From line 23 of local/bambu.nf
21
22
23
24
25
26
27
28
"""
[ ! -f ${meta.id}.bam ] && ln -s $bam ${meta.id}.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
sed: \$(sed --version 2>&1 | grep "sed (GNU sed)" | sed 's/^.*) //')
END_VERSIONS
"""
20
21
22
23
24
25
26
27
28
29
30
31
"""
bedtools \\
    bamtobed \\
    -bed12 \\
    -cigar \\
    -i ${bam[0]} \\
    | bedtools sort > ${meta.id}.bed12
cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bedtools: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
32
33
"""
bedtools \\
    genomecov \\
    -split \\
    -ibam ${bam[0]} \\
    -bg \\
    | bedtools sort > ${meta.id}.bedGraph
cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bedtools: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
cuteSV \
    ${input} \
    ${fasta} \
    ${meta.id}_cuteSV.vcf \
    . \
    --threads $task.cpus \
    --sample ${meta.id} \
    --genotype

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    cuteSV: \$( cuteSV --version 2>&1 | sed 's/cuteSV //g' )
END_VERSIONS
"""
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
/opt/deepvariant/bin/run_deepvariant \\
    --ref=${fasta} \\
    --reads=${input} \\
    --output_vcf=${prefix}.vcf.gz \\
    --output_gvcf=${prefix}.g.vcf.gz \\
    ${args} \\
    --num_shards=${task.cpus}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' )
END_VERSIONS
"""
20
21
22
23
24
25
26
27
28
"""
run_deseq2.r $params.quantification_method $counts

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
    bioconductor-deseq2: \$(Rscript -e "library(DESeq2); cat(as.character(packageVersion('DESeq2')))")
END_VERSIONS
"""
19
20
21
22
23
24
25
26
27
28
29
"""
run_dexseq.r $params.quantification_method $counts

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
    bioconductor-dexseq:  \$(Rscript -e "library(DEXSeq); cat(as.character(packageVersion('DEXSeq')))")
    bioconductor-drimseq: \$(Rscript -e "library(DRIMSeq); cat(as.character(packageVersion('DRIMSeq')))")
    bioconductor-stager:  \$(Rscript -e "library(stageR); cat(as.character(packageVersion('stageR')))")
END_VERSIONS
"""
21
22
23
24
25
26
27
28
29
"""
samtools faidx $fasta
cut -f 1,2 ${fasta}.fai > ${fasta}.sizes

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
18
19
20
21
22
23
24
25
26
27
"""
curl \\
-L https://ndownloader.figshare.com/files/28168755 \\
-o for_jaffal.tar.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    curl: \$(curl --version | grep "curl" | sed "s/curl //; s/ .*\$//")
END_VERSIONS
"""
17
18
19
20
21
22
23
24
25
26
"""
curl \\
-L https://github.com/wdecoster/nanolyse/raw/master/reference/lambda.fasta.gz \\
-o lambda.fasta.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    curl: \$(echo \$(curl --version  2>&1) | grep "curl" | sed "s/curl //; s/ .*\$//")
END_VERSIONS
"""
16
17
18
19
20
21
22
"""
git clone https://github.com/nf-core/test-datasets.git --branch nanoseq --single-branch

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    git: \$(echo \$(git --version | sed 's/git version //; s/ .*\$//')
"""
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
graphmap2 \\
    align \\
    $preset \\
    $junctions \\
    -t $task.cpus \\
    -r $fasta \\
    -i $index \\
    -d $fastq \\
    -o ${meta.id}.sam \\
    --extcigar

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    graphmap2: \$(echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//')
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
graphmap2 \\
    align \\
    $preset \\
    $junctions \\
    -t $task.cpus \\
    -I \\
    -r $fasta

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    graphmap2: \$(echo \$(graphmap2 align 2>&1) | sed 's/^.*Version: v//; s/ .*\$//')
END_VERSIONS
"""
20
21
22
23
24
25
26
27
"""
gtf2bed $gtf > ${gtf.baseName}.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    perl: \$(echo \$(perl --version 2>&1) | sed 's/.*v\\(.*\\)) built.*/\\1/')
END_VERSIONS
"""
23
24
25
26
27
28
29
30
"""
bpipe run -p refBase=$jaffal_ref_dir $jaffal_ref_dir/JAFFAL.groovy $fastq

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    jaffa: \$( echo 'jaffa 2.0' )
END_VERSIONS
"""
19
20
21
22
23
24
25
26
27
28
29
"""
m6anet-dataprep \\
--eventalign $eventalign \\
--out_dir $meta.id \\
--n_processes $task.cpus

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    m6anet: \$( echo 'm6anet 1.0' )
END_VERSIONS
"""
21
22
23
24
25
26
27
28
"""
m6anet-run_inference --input_dir $input_dir --out_dir $out_dir  --batch_size 512 --n_processes $task.cpus --num_iterations 5 --device cpu

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    m6anet: \$( echo 'm6anet 1.0' )
END_VERSIONS
"""
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""

medaka_variant \\
    -d \\
    -f $fasta \\
    -i $input \\
    -o $output_dir \\
    -t $task.cpus \\
    $split_mnps \\
    $phase_vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    medaka: \$( medaka --version 2>&1 | sed 's/medaka //g' )
END_VERSIONS
"""
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
minimap2 \\
    $preset \\
    $kmer \\
    $stranded \\
    $junctions \\
    $md \\
    -t $task.cpus \\
    $index \\
    $fastq > ${meta.id}.sam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    minimap2: \$(minimap2 --version 2>&1)
END_VERSIONS
"""
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
minimap2 \\
    $preset \\
    $kmer \\
    $stranded \\
    $junctions \\
    -t $task.cpus \\
    -d ${fasta}.mmi \\
    $fasta

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    minimap2: \$(minimap2 --version 2>&1)
END_VERSIONS
"""
31
32
33
34
35
36
37
38
39
40
41
42
"""
multiqc \\
    -f \\
    $args \\
    $custom_config \\
    .

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" )
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
"""
nanopolish index -d $fast5 $fastq
nanopolish eventalign  --reads $fastq --bam $bam --genome $genome --scale-events --signal-index --summary $sample_summary --threads $task.cpus > $sample_eventalign

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    nanopolish: \$( nanopolish --version | sed -e 's/nanopolish version //g' )
END_VERSIONS
"""
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""
mkdir -p "${prefix}"

run_pepper_margin_deepvariant call_variant \\
    -b "${input}" \\
    -f "${fasta}" \\
    -o "." \\
    -p "${prefix}" \\
    -t ${task.cpus} \\
    $gpu \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    pepper_margin_deepvariant: \$(run_pepper_margin_deepvariant --version | sed 's/VERSION: //g')
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
## Unzip fastq file
## qcat doesnt support zipped files yet
FILE=$input_path
if [[ \$FILE == *.gz ]]
then
zcat $input_path > unzipped.fastq
FILE=unzipped.fastq
fi
qcat  \\
-f \$FILE \\
-b ./fastq \\
--kit $params.barcode_kit \\
--min-score $params.qcat_min_score \\
$detect_middle

## Zip fastq files (cannot find pigz command)
gzip fastq/*

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    qcat: \$(qcat --version 2>&1 | sed 's/^.*qcat //; s/ .*\$//')
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
32
33
"""
check_samplesheet.py \\
    $samplesheet \\
    $updated_path \\
    samplesheet.valid.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
"""
samtools sort -@ $task.cpus -o ${meta.id}.sorted.bam -T $meta.id $bam

samtools index ${meta.id}.sorted.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
21
22
23
24
25
26
27
28
"""
samtools view -b -h -O BAM -@ $task.cpus -o ${meta.id}.bam $sam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
32
"""
sniffles \
    -m  $input \
    -v ${meta.id}_sniffles.vcf \
    -t $task.cpus

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sniffles: \$(sniffles --help 2>&1 | grep Version |sed 's/^.*Version: //')
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
32
"""
stringtie \\
    -L \\
    -G $gtf \\
    -o ${meta.id}.stringtie.gtf $bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    stringtie2: \$(stringtie --version 2>&1)
END_VERSIONS
"""
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""
featureCounts \\
    -L \\
    -O \\
    -f \\
    -g gene_id \\
    -t exon \\
    -T $task.cpus \\
    -a $gtf \\
    -o counts_gene.txt \\
    $bams

featureCounts \\
    -L \\
    -O \\
    -f \\
    --primary \\
    --fraction \\
    -F GTF \\
    -g transcript_id \\
    -t transcript \\
    --extraAttributes gene_id \\
    -T $task.cpus \\
    -a $gtf \\
    -o counts_transcript.txt \\
    $bams

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    featureCounts: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g")
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
32
"""
bedToBigBed \\
    $bed12 \\
    $sizes \\
    ${meta.id}.bigBed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    ucsc_bed12tobigbed: \$(echo $VERSION)
END_VERSIONS
"""
22
23
24
25
26
27
28
29
"""
bedGraphToBigWig $bedgraph $sizes ${meta.id}.bigWig

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    ucsc_bedgraphtobigwig: \$(echo $VERSION)
END_VERSIONS
"""
21
22
23
24
25
26
27
28
29
30
31
32
"""
xpore dataprep \\
--eventalign $eventalign \\
--out_dir $meta.id \\
--n_processes $task.cpus \\
--genome --gtf_or_gff $gtf --transcript_fasta $genome

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    xpore: \$( xpore --version | sed -e 's/xpore version //g' )
END_VERSIONS
"""
21
22
23
24
25
26
27
28
29
"""
create_yml.py diffmod_config.yml $dataprep_dirs
xpore diffmod $diffmod_config --n_processes $task.cpus

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    xpore: \$( xpore --version | sed -e 's/xpore version //g' )
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
32
33
34
"""
bcftools \\
    sort \\
    --output ${prefix}.vcf.gz \\
    $args \\
    $vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
39
40
41
42
43
44
45
46
"""
touch ${prefix}.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 39 of sort/main.nf
28
29
30
31
32
33
34
35
36
37
38
"""
printf "%s %s\\n" $rename_to | while read old_name new_name; do
    [ -f "\${new_name}" ] || ln -s \$old_name \$new_name
done
fastqc $args --threads $task.cpus $renamed_files

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" )
END_VERSIONS
"""
42
43
44
45
46
47
48
49
50
"""
touch ${prefix}.html
touch ${prefix}.zip

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" )
END_VERSIONS
"""
25
26
27
28
29
30
31
32
33
"""
gunzip -c $fastq | NanoLyse -r $fasta | gzip > ${prefix}.fastq.gz
mv NanoLyse.log ${prefix}.nanolyse.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    nanolyse: \$(NanoLyse --version 2>&1 | sed -e "s/NanoLyse //g")
END_VERSIONS
"""
27
28
29
30
31
32
33
34
35
36
"""
NanoPlot \\
    $args \\
    -t $task.cpus \\
    $input_file
cat <<-END_VERSIONS > versions.yml
"${task.process}":
    nanoplot: \$(echo \$(NanoPlot --version 2>&1) | sed 's/^.*NanoPlot //; s/ .*\$//')
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
32
33
"""
samtools \\
    faidx \\
    $args \\
    $fasta

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
36
37
38
39
40
41
42
43
"""
touch ${fasta}.fai
cat <<-END_VERSIONS > versions.yml

"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
NextFlow From line 36 of faidx/main.nf
23
24
25
26
27
28
29
30
31
32
33
34
"""
samtools \\
    flagstat \\
    --threads ${task.cpus} \\
    $bam \\
    > ${prefix}.flagstat

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
24
25
26
27
28
29
30
31
32
33
34
35
"""
samtools \\
    idxstats \\
    --threads ${task.cpus-1} \\
    $bam \\
    > ${prefix}.idxstats

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
24
25
26
27
28
29
30
31
32
33
34
35
"""
samtools \\
    index \\
    -@ ${task.cpus-1} \\
    $args \\
    $input

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
38
39
40
41
42
43
44
45
46
47
"""
touch ${input}.bai
touch ${input}.crai
touch ${input}.csi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
NextFlow From line 38 of index/main.nf
25
26
27
28
29
30
31
"""
samtools sort $args -@ $task.cpus -o ${prefix}.bam -T $prefix $bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
35
36
37
38
39
40
41
42
"""
touch ${prefix}.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
NextFlow From line 35 of sort/main.nf
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
samtools \\
    stats \\
    --threads ${task.cpus} \\
    ${reference} \\
    ${input} \\
    > ${prefix}.stats

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
41
42
43
44
45
46
47
48
"""
touch ${prefix}.stats

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
NextFlow From line 41 of stats/main.nf
24
25
26
27
28
29
30
31
32
33
34
35
"""
stringtie \\
    --merge $stringtie_gtf \\
    $reference \\
    -o stringtie.merged.gtf \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    stringtie: \$(stringtie --version 2>&1)
END_VERSIONS
"""
38
39
40
41
42
43
44
45
"""
touch stringtie.merged.gtf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    stringtie: \$(stringtie --version 2>&1)
END_VERSIONS
"""
NextFlow From line 38 of merge/main.nf
32
33
34
35
36
37
38
39
"""
bgzip $command -c $args -@${task.cpus} $input > ${output}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 32 of bgzip/main.nf
46
47
48
49
50
51
52
53
"""
touch ${output}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 46 of bgzip/main.nf
23
24
25
26
27
28
29
30
"""
tabix $args $tab

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
"""
34
35
36
37
38
39
40
41
"""
touch ${tab}.tbi
cat <<-END_VERSIONS > versions.yml

"${task.process}":
    tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 34 of tabix/main.nf
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
mkdir $prefix

## Ensures --strip-components only applied when top level of tar contents is a directory
## If just files or multiple directories, place all in prefix
if [[ \$(tar -taf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then
    tar \\
        -C $prefix --strip-components 1 \\
        -xavf \\
        $args \\
        $archive \\
        $args2
else
    tar \\
        -C $prefix \\
        -xavf \\
        $args \\
        $archive \\
        $args2
fi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//')
END_VERSIONS
"""
NextFlow From line 25 of untar/main.nf
54
55
56
57
58
59
60
61
62
"""
mkdir $prefix
touch ${prefix}/file.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    untar: \$(echo \$(tar --version 2>&1) | sed 's/^.*(GNU tar) //; s/ Copyright.*\$//')
END_VERSIONS
"""
NextFlow From line 54 of untar/main.nf
ShowHide 37 more snippets with no or duplicated tags.

Login to post a comment if you would like to share your experience with this workflow.

Do you know this workflow well? If so, you can request seller status , and start supporting this workflow.

Free

Created: 1yr ago
Updated: 1yr ago
Maitainers: public
URL: https://nf-co.re/nanoseq
Name: nanoseq
Version: 3.1.0
Badge:
workflow icon

Insert copied code into your website to add a link to this workflow.

Downloaded: 0
Copyright: Public Domain
License: None
  • Future updates

Related Workflows

cellranger-snakemake-gke
snakemake workflow to run cellranger on a given bucket using gke.
A Snakemake workflow for running cellranger on a given bucket using Google Kubernetes Engine. The usage of this workflow ...