Call and score variants from WGS/WES of rare disease patients.

public public 1yr ago Version: 1.0.0 0 bookmarks

TOC

Introduction

nf-core/raredisease is a best-practice bioinformatic pipeline for calling and scoring variants from WGS/WES data from rare disease patients. This pipeline is heavily inspired by MIP .

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 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. Metrics:

2. Alignment:

3. Variant calling - SNV:

4. Variant calling - SV:

5. Annotation - SNV:

6. Annotation - SV:

7. Mitochondrial analysis:

8. Variant calling - repeat expansions:

9. Rank variants - SV and SNV:

Note that it is possible to include/exclude certain tools or steps.

Usage

Note If you are new to Nextflow and nf-core, please refer to this page on how to set-up Nextflow. Make sure to test your setup with -profile test before running the workflow on actual data.

First, prepare a samplesheet with your input data that looks as follows:

samplesheet.csv :

sample,lane,fastq_1,fastq_2,sex,phenotype,paternal_id,maternal_id,case_id
hugelymodelbat,1,reads_1.fastq.gz,reads_2.fastq.gz,1,2,,,justhusky

Each row represents a fastq file (single-end) or a pair of fastq files (paired end).

Second, ensure that you have defined the path to reference files and parameters required for the type of analysis that you want to perform. More information about this can be found here .

Now, you can run the pipeline using:

nextflow run nf-core/raredisease \
 -profile <docker/singularity/podman/shifter/charliecloud/conda/institute> \
 --input samplesheet.csv \
 --outdir <OUTDIR>

Warning: Please provide pipeline parameters via the CLI or Nextflow -params-file option. Custom config files including those provided by the -c Nextflow option can be used to provide any configuration except for parameters ; see docs .

For more details and further functionality, please refer to the usage documentation and the parameter documentation .

Pipeline output

For more details about the output files and reports, please refer to the output documentation .

Credits

nf-core/raredisease was written in a collaboration between the Clinical Genomics nodes in Sweden, with major contributions from Ramprasad Neethiraj , Anders Jemt , Lucia Pena Perez , and Mei Wu at Clinical Genomics Stockholm.

Additional contributors were Sima Rahimi , Gwenna Breton and Emma Västerviga (Clinical Genomics Gothenburg); Halfdan Rydbeck and Lauri Mesilaakso (Clinical Genomics Linköping); Subazini Thankaswamy Kosalai (Clinical Genomics Örebro); Annick Renevey and Peter Pruisscher (Clinical Genomics Stockholm); Ryan Kennedy (Clinical Genomics Lund); Anders Sune Pedersen (Danish National Genome Center) and Lucas Taniguti .

We thank the nf-core community 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 .

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

Citations

If you use nf-core/raredisease for your analysis, please cite it using the following doi: 10.5281/zenodo.7995798

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 .

You can read more about MIP's use in healthcare in,

Stranneheim H, Lagerstedt-Robinson K, Magnusson M, et al. Integration of whole genome sequencing into a healthcare setting: high diagnostic rates across multiple clinical entities in 3219 rare disease patients. Genome Med. 2021;13(1):40. doi:10.1186/s13073-021-00855-5

Code Snippets

24
25
26
27
28
29
30
31
32
"""
add_most_severe_consequence.py --file_in ${vcf} --file_out ${prefix}.vcf --variant_csq ${variant_consequences}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    add_most_severe_consequence: v1.0
    python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""
36
37
38
39
40
41
42
43
44
"""
touch ${prefix}_csq.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    add_most_severe_consequence: v1.0
    python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
"""
add_most_severe_pli.py --file_in ${vcf} --file_out ${prefix}.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    add_most_severe_pli: v1.0
    python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""
35
36
37
38
39
40
41
42
43
"""
touch ${prefix}_pli.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    add_most_severe_pli: v1.0
    python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""
21
22
23
24
25
26
27
28
"""
awk 'BEGIN {SEP="\t"}; {print \$1 SEP "0" SEP \$2}' ${fasta_fai} > ${fasta_fai.baseName}.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//')
END_VERSIONS
"""
31
32
33
34
35
36
37
38
"""
touch chr.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//')
END_VERSIONS
"""
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""
vep \\
    -i $vcf \\
    -o ${prefix}.${file_extension}${compress_out} \\
    $args \\
    $reference \\
    --assembly $genome \\
    --species $species \\
    --cache \\
    --cache_version $cache_version \\
    --dir_cache $dir_cache \\
    --fork $task.cpus \\
    ${stats_file}


cat <<-END_VERSIONS > versions.yml
"${task.process}":
    ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//')
END_VERSIONS
"""
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""
touch ${prefix}.vcf
touch ${prefix}.tab
touch ${prefix}.json
touch ${prefix}.vcf.gz
touch ${prefix}.tab.gz
touch ${prefix}.json.gz
touch ${prefix}.summary.html

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//')
END_VERSIONS
"""
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
filter_vep \\
    --format vcf \\
    --input_file $vcf \\
    --output_file ${prefix}.ann_filter.vcf.gz \\
    --only_matched \\
    --filter \"HGNC_ID in ${select_feature_file}\"

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//')
END_VERSIONS
"""
41
42
43
44
45
46
47
48
"""
touch ${prefix}.ann_filter.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//')
END_VERSIONS
"""
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
gatk --java-options "-Xmx${avail_mem}M" CollectReadCounts \\
    -I $bam \\
    --read-index $bai \\
    -R $fasta \\
    -L $interval_list \\
    -O ${prefix}.hdf5 \\
    $args \\
    --tmp-dir .

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
48
49
50
51
52
53
54
55
"""
touch ${prefix}.hdf5

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
gatk --java-options "-Xmx${avail_mem}M" DenoiseReadCounts \\
    -I $read_counts \\
    --count-panel-of-normals $panel_of_normals \\
    --standardized-copy-ratios ${prefix}.standardizedCR.tsv \\
    --denoised-copy-ratios ${prefix}.denoisedCR.tsv \\
    $args \\
    --tmp-dir .

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
45
46
47
48
49
50
51
52
53
"""
touch ${prefix}.standardizedCR.tsv
touch ${prefix}.denoisedCR.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
19
20
21
22
23
24
25
26
27
28
29
30
"""
generate_gens_data.pl \\
    $read_counts \\
    $vcf \\
    $prefix \\
    $gnomad_positions

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    generate_gens_data.pl: \$(echo \$(generate_gens_data.pl --version 2>&1))
END_VERSIONS
"""
NextFlow From line 19 of gens/main.nf
34
35
36
37
38
39
40
41
42
43
44
"""
touch ${prefix}.baf.bed.gz
touch ${prefix}.baf.bed.gz.tbi
touch ${prefix}.cov.bed.gz
touch ${prefix}.cov.bed.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    generate_gens_data.pl: \$(echo \$(generate_gens_data.pl --version 2>&1))
END_VERSIONS
"""
NextFlow From line 34 of gens/main.nf
21
22
23
24
25
26
27
28
"""
cut -f 1,2 $fai > ${fai}.sizes

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    cut: \$(echo \$(cut --help 2>&1 | head -n 1 | cut -f1,2 -d' '))
END_VERSIONS
"""
26
27
28
29
30
31
32
33
34
35
36
"""
samtools stats --threads ${task.cpus} $args ${reference} ${input} | \\
grep -E ^IS | \\
awk 'BEGIN {sum=0} (\$2>=1200 && \$2<=15000) {sum=sum+\$3} (\$2<1200 || \$2>15000) {sum_norm=sum_norm+\$3} END \\
{print "intermediate discordant ", sum, "normal ", sum_norm, "ratio ppk", sum*1000/(sum_norm+sum)}' 1> ${prefix}.txt

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

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
29
30
"""
check_samplesheet.py \\
    $samplesheet \\
    samplesheet.valid.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    python: \$(python --version | sed 's/Python //g')
END_VERSIONS
"""
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""
if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then
    echo "Initializing SENTIEON_LICENSE env variable"
    source sentieon_init.sh SENTIEON_LICENSE_BASE64
fi

sentieon driver  \\
    -t ${task.cpus} \\
    -r $fasta \\
    $args \\
    $input \\
    --algo QualCal \\
    $dbsnp \\
    ${prefix}.table

sentieon driver \\
    -t ${task.cpus} \\
    -r $fasta \\
    $args2 \\
    $input \\
    -q ${prefix}.table \\
    --algo QualCal \\
    $dbsnp \\
    ${prefix}.table_post \\
    --algo ReadWriter ${prefix}.bam

sentieon driver \\
    -t ${task.cpus} \\
    $args3 \\
    --algo QualCal \\
    --plot \\
    --before ${prefix}.table \\
    --after ${prefix}.table_post \\
    ${prefix}.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
76
77
78
79
80
81
82
83
84
85
86
87
"""
touch ${prefix}.bam
touch ${prefix}.bam.bai
touch ${prefix}.table
touch ${prefix}.table_post
touch ${prefix}.csv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
mkdir bwa

if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then
    echo "Initializing SENTIEON_LICENSE env variable"
    source sentieon_init.sh SENTIEON_LICENSE_BASE64
fi

sentieon bwa index \\
    $args \\
    -p $prefix \\
    $fasta

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
    bwa: \$(echo \$(sentieon bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
END_VERSIONS
"""
42
43
44
45
46
47
48
49
50
"""
mkdir bwa

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
    bwa: \$(echo \$(sentieon bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
END_VERSIONS
"""
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
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`

if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then
    echo "Initializing SENTIEON_LICENSE env variable"
    source sentieon_init.sh SENTIEON_LICENSE_BASE64
fi

sentieon bwa mem \\
    -t $task.cpus \\
    \$INDEX \\
    $reads \\
    $args \\
    | sentieon \\
        util \\
        sort \\
        -r $fasta \\
        -o ${prefix}.bam \\
        -t $task.cpus \\
        $args2 \\
        --sam2bam \\
        -i -

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
    bwa: \$(echo \$(sentieon bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
END_VERSIONS
"""
58
59
60
61
62
63
64
65
66
67
"""
touch ${prefix}.bam
touch ${prefix}.bai

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
    bwa: \$(echo \$(sentieon bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
END_VERSIONS
"""
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then
    echo "Initializing SENTIEON_LICENSE env variable"
    source sentieon_init.sh SENTIEON_LICENSE_BASE64
fi

sentieon \\
    driver \\
    -t $task.cpus \\
    -r $fasta \\
    $input \\
    $args \\
    --algo GCBias --summary ${prefix}_gc_summary.txt ${prefix}_gc_metrics.txt \\
    --algo MeanQualityByCycle ${prefix}_mq_metrics.txt \\
    --algo QualDistribution ${prefix}_qd_metrics.txt \\
    --algo InsertSizeMetricAlgo ${prefix}_is_metrics.txt  \\
    --algo AlignmentStat ${prefix}_aln_metrics.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
55
56
57
58
59
60
61
62
63
64
65
66
67
"""
touch ${prefix}_mq_metrics.txt
touch ${prefix}_qd_metrics.txt
touch ${prefix}_gc_summary.txt
touch ${prefix}_gc_metrics.txt
touch ${prefix}_aln_metrics.txt
touch ${prefix}_is_metrics.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then
    echo "Initializing SENTIEON_LICENSE env variable"
    source sentieon_init.sh SENTIEON_LICENSE_BASE64
fi

sentieon \\
    driver \\
    -t $task.cpus \\
    $input \\
    $args \\
    --algo Dedup \\
    --score_info $score \\
    --metrics ${prefix}_metrics.txt \\
    ${prefix}.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
50
51
52
53
54
55
56
57
58
59
"""
touch ${prefix}.bam
touch ${prefix}.bam.bai
touch ${prefix}_metrics.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
sentieon driver \\
    -t $task.cpus \\
    -r $fasta \\
    --algo DNAModelApply \\
    --model $ml_model \\
    -v $vcf \\
    ${prefix}.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
41
42
43
44
45
46
47
48
49
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g" )
END_VERSIONS
"""
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
sentieon driver \\
    -t $task.cpus \\
    -r $fasta \\
    $args \\
    -i $bam \\
    --algo DNAscope \\
    $dbsnp \\
    $interval \\
    $args2 \\
    $model \\
    ${prefix}.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
53
54
55
56
57
58
59
60
61
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g" )
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then
    echo "Initializing SENTIEON_LICENSE env variable"
    source sentieon_init.sh SENTIEON_LICENSE_BASE64
fi

sentieon \\
    driver \\
    -t $task.cpus \\
    $input \\
    --algo LocusCollector \\
    --fun score_info $prefix

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
43
44
45
46
47
48
49
50
51
"""
touch ${prefix}.txt.gz
touch ${prefix}.txt.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then
    echo "Initializing SENTIEON_LICENSE env variable"
    source sentieon_init.sh SENTIEON_LICENSE_BASE64
fi

sentieon \\
    driver \\
    -t $task.cpus \\
    $input \\
    --algo ReadWriter \\
    ${prefix}.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
45
46
47
48
49
50
51
52
53
"""
touch ${prefix}.bam
touch ${prefix}.bam.bai

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then
    echo "Initializing SENTIEON_LICENSE env variable"
    source sentieon_init.sh SENTIEON_LICENSE_BASE64
fi

sentieon \\
    driver \\
    -t $task.cpus \\
    -r $fasta \\
    $input \\
    $interval \\
    $args \\
    --algo WgsMetricsAlgo ${prefix}.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
49
50
51
52
53
54
55
56
"""
touch ${prefix}_wgs_metrics.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    sentieon: \$(echo \$(sentieon driver --version 2>&1) | sed -e "s/sentieon-genomics-//g")
END_VERSIONS
"""
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
bcftools \\
    annotate \\
    $args \\
    $annotations_file \\
    $header_file \\
    --output ${prefix}.${extension} \\
    --threads $task.cpus \\
    $input

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$( bcftools --version |& sed '1!d; s/^.*bcftools //' )
END_VERSIONS
"""
55
56
57
58
59
60
61
62
"""
touch ${prefix}.${extension}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$( bcftools --version |& sed '1!d; s/^.*bcftools //' )
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
32
33
34
"""
bcftools concat \\
    --output ${prefix}.vcf.gz \\
    $args \\
    --threads $task.cpus \\
    ${vcfs}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
38
39
40
41
42
43
44
45
"""
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 38 of concat/main.nf
32
33
34
35
36
37
38
39
40
41
42
43
"""
bcftools filter \\
    --output ${prefix}.${extension} \\
    --threads ${task.cpus} \\
    $args \\
    $vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
56
57
58
59
60
61
62
63
"""
touch ${prefix}.${extension}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 56 of filter/main.nf
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
bcftools merge \\
    $args \\
    $regions \\
    --threads $task.cpus \\
    --output ${prefix}.${extension} \\
    $vcfs

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
56
57
58
59
60
61
62
63
"""
touch ${prefix}.${extension}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 56 of merge/main.nf
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
bcftools norm \\
    --fasta-ref ${fasta} \\
    --output ${prefix}.${extension}\\
    $args \\
    --threads $task.cpus \\
    ${vcf}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
52
53
54
55
56
57
58
59
"""
touch ${prefix}.${extension}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 52 of norm/main.nf
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
bcftools \\
    reheader \\
    $update_sequences \\
    $new_header \\
    $args \\
    --threads $task.cpus \\
    $vcf \\
    | bcftools view \\
    $args2 \\
    --output ${prefix}.${extension}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
60
61
62
63
64
65
66
67
"""
touch ${prefix}.${extension}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
bcftools \\
    roh \\
    $args \\
    $af_read \\
    $gen_map \\
    $reg_file \\
    $samp_file \\
    $targ_file \\
    -o ${prefix}.roh \\
    $vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
53
54
55
56
57
58
59
60
"""
touch ${prefix}.roh

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 53 of roh/main.nf
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
bcftools view \\
    --output ${prefix}.vcf.gz \\
    ${regions_file} \\
    ${targets_file} \\
    ${samples_file} \\
    $args \\
    --threads $task.cpus \\
    ${vcf}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
47
48
49
50
51
52
53
54
"""
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 47 of view/main.nf
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
mkdir bwa
bwa \\
    index \\
    $args \\
    -p bwa/${fasta.baseName} \\
    $fasta

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
END_VERSIONS
"""
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
mkdir bwa

touch bwa/genome.amb
touch bwa/genome.ann
touch bwa/genome.bwt
touch bwa/genome.pac
touch bwa/genome.sa

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bwa: \$(echo \$(bwa 2>&1) | sed 's/^.*Version: //; s/Contact:.*\$//')
END_VERSIONS
"""
22
23
24
25
26
27
28
29
30
31
32
33
"""
mkdir bwamem2
bwa-mem2 \\
    index \\
    $args \\
    $fasta -p bwamem2/${fasta}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //')
END_VERSIONS
"""
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
mkdir bwamem2
touch bwamem2/${fasta}.0123
touch bwamem2/${fasta}.ann
touch bwamem2/${fasta}.pac
touch bwamem2/${fasta}.amb
touch bwamem2/${fasta}.bwt.2bit.64

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //')
END_VERSIONS
"""
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'`

bwa-mem2 \\
    mem \\
    $args \\
    -t $task.cpus \\
    \$INDEX \\
    $reads \\
    | samtools $samtools_command $args2 -@ $task.cpus -o ${prefix}.bam -

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //')
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
47
48
49
50
51
52
53
54
"""
touch ${prefix}.bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
    bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //')
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
NextFlow From line 47 of mem/main.nf
31
32
33
34
35
36
37
38
39
40
41
"""
cadd.sh \\
    -o ${prefix}.tsv.gz \\
    $args \\
    $vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    cadd: $VERSION
END_VERSIONS
"""
NextFlow From line 31 of cadd/main.nf
47
48
49
50
51
52
53
54
"""
touch ${prefix}.tsv.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    cadd: $VERSION
END_VERSIONS
"""
NextFlow From line 47 of cadd/main.nf
38
39
40
41
42
43
44
45
46
47
48
49
"""
$command1 \\
    $args \\
    ${file_list.join(' ')} \\
    $command2 \\
    > ${prefix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
END_VERSIONS
"""
NextFlow From line 38 of cat/main.nf
54
55
56
57
58
59
60
61
"""
touch $prefix

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
END_VERSIONS
"""
NextFlow From line 54 of cat/main.nf
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""
chromograph \\
    $args \\
    $autozyg_param \\
    $coverage_param \\
    $exome_param \\
    $fracsnp_param \\
    $ideogram_param \\
    $regions_param \\
    $sites_param \\
    --outd ${prefix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    chromograph: \$(echo \$(chromograph --version 2>&1) | sed 's/chromograph //' )
END_VERSIONS
"""
87
88
89
90
91
92
93
94
"""
mkdir ${prefix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    chromograph: \$(echo \$(chromograph --version 2>&1) | sed 's/chromograph //' )
END_VERSIONS
"""
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
/opt/deepvariant/bin/run_deepvariant \\
    --ref=${fasta} \\
    --reads=${input} \\
    --output_vcf=${prefix}.vcf.gz \\
    --output_gvcf=${prefix}.g.vcf.gz \\
    ${args} \\
    ${regions} \\
    --intermediate_results_dir=. \\
    --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
"""
52
53
54
55
56
57
58
59
60
61
62
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
touch ${prefix}.g.vcf.gz
touch ${prefix}.g.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' )
END_VERSIONS
"""
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
echo "$bam\t${prefix}" > infile.txt
eKLIPse.py \\
    -in infile.txt \\
    -ref $ref_gb
mv eKLIPse_*/eKLIPse_deletions.csv eKLIPse_deletions.csv
mv eKLIPse_*/eKLIPse_genes.csv eKLIPse_genes.csv
mv eKLIPse_*/eKLIPse_${prefix}.png eKLIPse_${prefix}.png

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    eklipse: $VERSION
END_VERSIONS
"""
NextFlow From line 30 of eklipse/main.nf
48
49
50
51
52
53
54
55
56
57
"""
touch eKLIPse_deletions.csv
touch eKLIPse_genes.csv
touch eKLIPse_${prefix}.png

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    eklipse: $VERSION
END_VERSIONS
"""
NextFlow From line 48 of eklipse/main.nf
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
ExpansionHunter \\
    ${args} \\
    --reads ${bam} \\
    --output-prefix ${prefix} \\
    --reference ${fasta} \\
    --variant-catalog ${variant_catalog}

bgzip --threads ${task.cpus} ${args2} ${prefix}.vcf
bgzip --threads ${task.cpus} ${args2} ${prefix}.json

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    expansionhunter: \$( echo \$(ExpansionHunter --version 2>&1) | sed 's/^.*ExpansionHunter v//')
    bgzip: \$(echo \$(bgzip -h 2>&1) | sed 's/^.*Version: //;s/Usage:.*//')
END_VERSIONS
"""
49
50
51
52
53
54
55
56
57
58
"""
touch ${prefix}.vcf.gz
touch ${prefix}.json.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    expansionhunter: \$( echo \$(ExpansionHunter --version 2>&1) | sed 's/^.*ExpansionHunter v//')
    bgzip: \$(echo \$(bgzip -h 2>&1) | sed 's/^.*Version: //;s/Usage:.*//')
END_VERSIONS
"""
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
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
"""
46
47
48
49
50
51
52
53
54
"""
touch ${prefix}.html
touch ${prefix}.zip

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" )
END_VERSIONS
"""
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
gatk --java-options "-Xmx${avail_mem}M" BedToIntervalList \\
    --INPUT $bed \\
    --OUTPUT ${prefix}.interval_list \\
    --SEQUENCE_DICTIONARY $dict \\
    --TMP_DIR . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
47
48
49
50
51
52
53
54
"""
touch ${prefix}.interval_list

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
gatk --java-options "-Xmx${avail_mem}M" CollectReadCounts \\
    --input $input \\
    --intervals $intervals \\
    --output ${prefix}.$extension \\
    $reference \\
    --tmp-dir . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
60
61
62
63
64
65
66
67
"""
touch ${prefix}.${extension}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
29
30
31
32
33
34
35
36
37
38
39
40
"""
gatk --java-options "-Xmx${avail_mem}M" CreateSequenceDictionary \\
    --REFERENCE $fasta \\
    --URI $fasta \\
    --TMP_DIR . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
43
44
45
46
47
48
49
50
"""
touch ${fasta.baseName}.dict

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
gatk --java-options "-Xmx${avail_mem}M" DetermineGermlineContigPloidy \\
    ${input_list} \\
    --output ./ \\
    --output-prefix ${prefix} \\
    ${intervals} \\
    ${exclude} \\
    ${contig_ploidy} \\
    ${model} \\
    --tmp-dir . \\
    ${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
62
63
64
65
66
67
68
69
70
"""
touch ${prefix}-calls
touch ${prefix}-model

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""
gatk --java-options "-Xmx${avail_mem}M" FilterMutectCalls \\
    --variant $vcf \\
    --output ${prefix}.vcf.gz \\
    --reference $fasta \\
    $orientationbias_command \\
    $segmentation_command \\
    $estimate_command \\
    $table_command \\
    --tmp-dir . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
60
61
62
63
64
65
66
67
68
69
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
touch ${prefix}.vcf.gz.filteringStats.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
gatk --java-options "-Xmx${avail_mem}g" GermlineCNVCaller \\
    $input_list \\
    $ploidy_command \\
    $output_command \\
    --output-prefix $prefix \\
    $args \\
    $intervals_command \\
    $model_command

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
57
58
59
60
61
62
63
64
65
"""
mkdir -p ${prefix}-cnv-calls/${prefix}-calls
mkdir -p ${prefix}-cnv-model/${prefix}-model

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
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
"""

mkdir ${prefix}_split

gatk --java-options "-Xmx${avail_mem}M" IntervalListTools \\
    --INPUT $intervals \\
    --OUTPUT ${prefix}_split \\
    --TMP_DIR . \\
    $args

python3 <<CODE
import glob, os
# The following python code snippet rename the output files into different name to avoid overwriting or name conflict
intervals = sorted(glob.glob("*_split/*/*.interval_list"))
for i, interval in enumerate(intervals):
    (directory, filename) = os.path.split(interval)
    newName = os.path.join(directory, str(i + 1) + filename)
    os.rename(interval, newName)
CODE

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""
mkdir -p ${prefix}_split/temp_0001_of_6
mkdir -p ${prefix}_split/temp_0002_of_6
mkdir -p ${prefix}_split/temp_0003_of_6
mkdir -p ${prefix}_split/temp_0004_of_6
touch ${prefix}_split/temp_0001_of_6/1scattered.interval_list
touch ${prefix}_split/temp_0002_of_6/2scattered.interval_list
touch ${prefix}_split/temp_0003_of_6/3scattered.interval_list
touch ${prefix}_split/temp_0004_of_6/4scattered.interval_list

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
gatk --java-options "-Xmx${avail_mem}M" MergeBamAlignment \\
    --UNMAPPED_BAM $unmapped \\
    --ALIGNED_BAM $aligned \\
    --OUTPUT ${prefix}.bam \\
    --REFERENCE_SEQUENCE $fasta \\
    --TMP_DIR . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
49
50
51
52
53
54
55
56
"""
touch ${prefix}.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
gatk --java-options "-Xmx${avail_mem}M" MergeVcfs \\
    $input_list \\
    --OUTPUT ${prefix}.vcf.gz \\
    $reference_command \\
    --TMP_DIR . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
50
51
52
53
54
55
56
57
58
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""
gatk --java-options "-Xmx${avail_mem}M" Mutect2 \\
    $inputs \\
    --output ${prefix}.vcf.gz \\
    --reference $fasta \\
    $pon_command \\
    $gr_command \\
    $interval_command \\
    --tmp-dir . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
63
64
65
66
67
68
69
70
71
72
73
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
touch ${prefix}.vcf.gz.stats
touch ${prefix}.f1r2.tar.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 63 of mutect2/main.nf
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
gatk --java-options "-Xmx${avail_mem}g" PostprocessGermlineCNVCalls \\
    $calls_command \\
    $model_command \\
    $ploidy_command \\
    --output-genotyped-intervals ${prefix}_genotyped_intervals.vcf.gz \\
    --output-genotyped-segments ${prefix}_genotyped_segments.vcf.gz \\
    --output-denoised-copy-ratios ${prefix}_denoised.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
55
56
57
58
59
60
61
62
63
64
"""
touch ${prefix}_genotyped_intervals.vcf.gz
touch ${prefix}_genotyped_segments.vcf.gz
touch ${prefix}_denoised.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
gatk --java-options "-Xmx${avail_mem}M" PreprocessIntervals \\
    $include_command \\
    $exclude_command \\
    --reference $fasta \\
    --output ${prefix}.interval_list \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
53
54
55
56
57
58
59
60
"""
touch ${prefix}.interval_list

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
gatk --java-options "-Xmx${avail_mem}M" PrintReads \\
    $args \\
    --reference $fasta \\
    --input $input \\
    --read-index $index \\
    --output ${prefix}.${input.getExtension()}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
54
55
56
57
58
59
60
61
62
63
"""
touch ${prefix}.${input.getExtension()}
touch ${prefix}.${input.getExtension()}
touch ${prefix}.${input.getExtension()}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
30
31
32
33
34
35
36
37
38
39
40
41
"""
gatk --java-options "-Xmx${avail_mem}M" RevertSam \\
    --INPUT $bam \\
    --OUTPUT ${prefix}.reverted.bam \\
    --TMP_DIR . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
45
46
47
48
49
50
51
52
"""
touch ${prefix}.reverted.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
31
32
33
34
35
36
37
38
39
40
41
42
"""
gatk --java-options "-Xmx${avail_mem}M" SamToFastq \\
    --INPUT $bam \\
    $output \\
    --TMP_DIR . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
46
47
48
49
50
51
52
53
54
55
"""
touch ${prefix}.fastq.gz
touch ${prefix}_1.fastq.gz
touch ${prefix}_2.fastq.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
gatk --java-options "-Xmx${avail_mem}M" SelectVariants \\
    --variant $vcf \\
    --output ${prefix}.selectvariants.vcf.gz \\
    $interval \\
    --tmp-dir . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
48
49
50
51
52
53
54
55
56
"""
touch ${prefix}.selectvariants.vcf.gz
touch ${prefix}.selectvariants.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""
gatk --java-options "-Xmx${avail_mem}M" ShiftFasta \\
    --reference $fasta \\
    --output ${prefix}_shift.fasta \\
    --shift-back-output ${prefix}_shift.back_chain \\
    $args \\
    $seq_dict \\
    --tmp-dir .

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
54
55
56
57
58
59
60
61
62
63
64
65
66
"""
touch test.intervals
touch test_shift.back_chain
touch test_shift.dict
touch test.shifted.intervals
touch test_shift.fasta
touch test_shift.fasta.fai

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
gatk --java-options "-Xmx${avail_mem}M" SplitIntervals \\
    --output ${prefix} \\
    --intervals $intervals \\
    $reference \\
    --tmp-dir . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
50
51
52
53
54
55
56
57
58
59
"""
mkdir ${prefix}
touch ${prefix}/0000-scattered.interval_list
touch ${prefix}/0001-scattered.interval_list

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
gatk --java-options "-Xmx${avail_mem}M" VariantFiltration \\
    --variant $vcf \\
    --output ${prefix}.vcf.gz \\
    --reference $fasta \\
    --tmp-dir . \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
49
50
51
52
53
54
55
56
57
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
32
33
34
"""
genmod \\
    annotate \\
    $args \\
    --outfile ${prefix}_annotate.vcf \\
    $input_vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    genmod: \$(echo \$(genmod --version 2>&1) | sed 's/^.*genmod version: //' )
END_VERSIONS
"""
38
39
40
41
42
43
44
45
"""
touch ${prefix}_annotate.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    genmod: \$(echo \$(genmod --version 2>&1) | sed 's/^.*genmod version: //' )
END_VERSIONS
"""
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
genmod \\
    compound \\
    $args \\
    --processes ${task.cpus} \\
    --outfile ${prefix}_compound.vcf \\
    $input_vcf

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

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    genmod: \$(echo \$(genmod --version 2>&1) | sed 's/^.*genmod version: //' )
END_VERSIONS
"""
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
genmod \\
    models \\
    $args \\
    $pen_file \\
    $family_file \\
    --processes ${task.cpus} \\
    --outfile ${prefix}_models.vcf \\
    $input_vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    genmod: \$(echo \$(genmod --version 2>&1) | sed 's/^.*genmod version: //' )
END_VERSIONS
"""
45
46
47
48
49
50
51
52
"""
touch ${prefix}_models.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    genmod: \$(echo \$(genmod --version 2>&1) | sed 's/^.*genmod version: //' )
END_VERSIONS
"""
NextFlow From line 45 of models/main.nf
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
genmod \\
    score \\
    $args \\
    $family_file \\
    $config_file \\
    --outfile ${prefix}_score.vcf \\
    $input_vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    genmod: \$(echo \$(genmod --version 2>&1) | sed 's/^.*genmod version: //' )
END_VERSIONS
"""
44
45
46
47
48
49
50
51
"""
touch ${prefix}_score.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    genmod: \$(echo \$(genmod --version 2>&1) | sed 's/^.*genmod version: //' )
END_VERSIONS
"""
NextFlow From line 44 of score/main.nf
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
glnexus_cli \\
    --threads $task.cpus \\
    --mem-gbytes $avail_mem \\
    $args \\
    ${input.join(' ')} \\
    > ${prefix}.bcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    glnexus: \$( echo \$(glnexus_cli 2>&1) | head -n 1 | sed 's/^.*release v//; s/ .*\$//')
END_VERSIONS
"""
48
49
50
51
52
53
54
55
"""
touch ${prefix}.bcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    glnexus: \$( echo \$(glnexus_cli 2>&1) | head -n 1 | sed 's/^.*release v//; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 48 of glnexus/main.nf
24
25
26
27
28
29
30
31
"""
haplocheck --raw --out $prefix $vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    haplocheck: \$(echo \$(haplocheck --version 2>&1) | sed 's/.*\\([0-9].[0-9].[0-9]\\).*/\\1/' )
END_VERSIONS
"""
35
36
37
38
39
40
41
42
43
"""
touch ${prefix}.raw.txt
touch ${prefix}.html

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    haplocheck: \$(echo \$(haplocheck --version 2>&1) | sed 's/.*\\([0-9].[0-9].[0-9]\\).*/\\1/' )
END_VERSIONS
"""
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
haplogrep \\
    classify \\
    $args \\
    --in $inputfile \\
    --out ${prefix}.txt \\
    --format $format

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    haplogrep2: \$(echo \$(haplogrep --version 2>&1) | (sed 's/htt.*//') | (sed 's/.*v//'))
END_VERSIONS
"""
40
41
42
43
44
45
46
47
"""
touch ${prefix}.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    haplogrep2: \$(echo \$(haplogrep --version 2>&1) | (sed 's/htt.*//') | (sed 's/.*v//'))
END_VERSIONS
"""
24
25
26
27
28
29
30
31
32
33
34
35
"""
hmtnote \\
    annotate \\
    $vcf \\
    ${prefix}_annotated.vcf \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    hmtnote: \$(echo \$(hmtnote --version 2>&1) | sed 's/^.*hmtnote, version //; s/Using.*\$//' ))
END_VERSIONS
"""
38
39
40
41
42
43
44
"""
touch ${prefix}_annotated.vcf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
    hmtnote: \$(echo \$(hmtnote --version 2>&1) | sed 's/^.*hmtnote, version //; s/Using.*\$//' ))
END_VERSIONS
"""
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
configManta.py \
    ${input_files} \
    --reference $fasta \
    --runDir manta \
    $options_manta \
    $args

python manta/runWorkflow.py -m local -j $task.cpus

mv manta/results/variants/candidateSmallIndels.vcf.gz \
    ${prefix}.candidate_small_indels.vcf.gz
mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi \
    ${prefix}.candidate_small_indels.vcf.gz.tbi
mv manta/results/variants/candidateSV.vcf.gz \
    ${prefix}.candidate_sv.vcf.gz
mv manta/results/variants/candidateSV.vcf.gz.tbi \
    ${prefix}.candidate_sv.vcf.gz.tbi
mv manta/results/variants/diploidSV.vcf.gz \
    ${prefix}.diploid_sv.vcf.gz
mv manta/results/variants/diploidSV.vcf.gz.tbi \
    ${prefix}.diploid_sv.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    manta: \$( configManta.py --version )
END_VERSIONS
"""
65
66
67
68
69
70
71
72
73
74
75
76
77
"""
touch ${prefix}.candidate_small_indels.vcf.gz
touch ${prefix}.candidate_small_indels.vcf.gz.tbi
touch ${prefix}.candidate_sv.vcf.gz
touch ${prefix}.candidate_sv.vcf.gz.tbi
touch ${prefix}.diploid_sv.vcf.gz
touch ${prefix}.diploid_sv.vcf.gz.tbi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    manta: \$( configManta.py --version )
END_VERSIONS
"""
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""
mosdepth \\
    --threads $task.cpus \\
    $interval \\
    $reference \\
    $args \\
    $prefix \\
    $bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    mosdepth: \$(mosdepth --version 2>&1 | sed 's/^.*mosdepth //; s/ .*\$//')
END_VERSIONS
"""
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
"""
touch ${prefix}.global.dist.txt
touch ${prefix}.region.dist.txt
touch ${prefix}.summary.txt
touch ${prefix}.per-base.d4
touch ${prefix}.per-base.bed.gz
touch ${prefix}.per-base.bed.gz.csi
touch ${prefix}.regions.bed.gz
touch ${prefix}.regions.bed.gz.csi
touch ${prefix}.quantized.bed.gz
touch ${prefix}.quantized.bed.gz.csi
touch ${prefix}.thresholds.bed.gz
touch ${prefix}.thresholds.bed.gz.csi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    mosdepth: \$(mosdepth --version 2>&1 | sed 's/^.*mosdepth //; s/ .*\$//')
END_VERSIONS
"""
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
multiqc \\
    --force \\
    $args \\
    $config \\
    $extra_config \\
    .

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" )
END_VERSIONS
"""
43
44
45
46
47
48
49
50
51
52
"""
touch multiqc_data
touch multiqc_plots
touch multiqc_report.html

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" )
END_VERSIONS
"""
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
peddy \\
    $args \\
    --prefix $prefix \\
    --plot \\
    -p $task.cpus \\
    $vcf \\
    $ped

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    peddy: \$( peddy --version 2>&1 | sed 's/peddy, version //' )
END_VERSIONS
"""
44
45
46
47
48
49
50
51
52
53
"""
touch ${prefix}.ped_check.csv
touch ${prefix}.vs.html
touch ${prefix}.het_check.csv
touch ${prefix}.sex_check.csv
touch ${prefix}.peddy.ped
touch ${prefix}.html

touch versions.yml
"""
NextFlow From line 44 of peddy/main.nf
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
picard \\
    -Xmx${avail_mem}M \\
    AddOrReplaceReadGroups \\
    $args \\
    --INPUT ${bam} \\
    --OUTPUT ${prefix}.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard AddOrReplaceReadGroups --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
46
47
48
49
50
51
52
53
"""
touch ${prefix}.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard AddOrReplaceReadGroups --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""

$bait_intervallist_cmd
$target_intervallist_cmd

picard \\
    -Xmx${avail_mem}M \\
    CollectHsMetrics \\
    $args \\
    $reference \\
    --BAIT_INTERVALS $bait_interval_list \\
    --TARGET_INTERVALS $target_interval_list \\
    --INPUT $bam \\
    --OUTPUT ${prefix}.CollectHsMetrics.coverage_metrics


cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(echo \$(picard CollectHsMetrics --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
74
75
76
77
78
79
80
81
"""
touch ${prefix}.CollectHsMetrics.coverage_metrics

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(echo \$(picard CollectHsMetrics --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
picard \\
    -Xmx${avail_mem}M \\
    CollectMultipleMetrics \\
    $args \\
    --INPUT $bam \\
    --OUTPUT ${prefix}.CollectMultipleMetrics \\
    $reference

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard CollectMultipleMetrics --version 2>&1 | grep -o 'Version.*' | cut -f2- -d:)
END_VERSIONS
"""
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"""
touch ${prefix}.CollectMultipleMetrics.alignment_summary_metrics
touch ${prefix}.CollectMultipleMetrics.insert_size_metrics
touch ${prefix}.CollectMultipleMetrics.quality_distribution.pdf
touch ${prefix}.CollectMultipleMetrics.base_distribution_by_cycle_metrics
touch ${prefix}.CollectMultipleMetrics.quality_by_cycle_metrics
touch ${prefix}.CollectMultipleMetrics.read_length_histogram.pdf
touch ${prefix}.CollectMultipleMetrics.base_distribution_by_cycle.pdf
touch ${prefix}.CollectMultipleMetrics.quality_by_cycle.pdf
touch ${prefix}.CollectMultipleMetrics.insert_size_histogram.pdf
touch ${prefix}.CollectMultipleMetrics.quality_distribution_metrics

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(echo \$(picard CollectMultipleMetrics --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
picard \\
    -Xmx${avail_mem}M \\
    CollectWgsMetrics \\
    $args \\
    --INPUT $bam \\
    --OUTPUT ${prefix}.CollectWgsMetrics.coverage_metrics \\
    --REFERENCE_SEQUENCE ${fasta} \\
    $interval


cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard CollectWgsMetrics --version 2>&1 | grep -o 'Version.*' | cut -f2- -d:)
END_VERSIONS
"""
52
53
54
55
56
57
58
59
"""
touch ${prefix}.CollectWgsMetrics.coverage_metrics

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard CollectWgsMetrics --version 2>&1 | grep -o 'Version.*' | cut -f2- -d:)
END_VERSIONS
"""
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
picard \\
    -Xmx${avail_mem}M \\
    LiftoverVcf \\
    $args \\
    --INPUT $input_vcf \\
    --OUTPUT ${prefix}.lifted.vcf.gz \\
    --CHAIN $chain \\
    --REJECT ${prefix}.unlifted.vcf.gz \\
    --REFERENCE_SEQUENCE $fasta

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(echo \$(picard LiftoverVcf --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
52
53
54
55
56
57
58
59
60
"""
touch ${prefix}.lifted.vcf.gz
touch ${prefix}.unlifted.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(echo \$(picard LiftoverVcf --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""
picard \\
    -Xmx${avail_mem}M \\
    MarkDuplicates \\
    $args \\
    --INPUT $bam \\
    --OUTPUT ${prefix}.bam \\
    --REFERENCE_SEQUENCE $fasta \\
    --METRICS_FILE ${prefix}.MarkDuplicates.metrics.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(echo \$(picard MarkDuplicates --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
51
52
53
54
55
56
57
58
59
60
"""
touch ${prefix}.bam
touch ${prefix}.bam.bai
touch ${prefix}.MarkDuplicates.metrics.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(echo \$(picard MarkDuplicates --version 2>&1) | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
picard \\
    RenameSampleInVcf \\
    -Xmx${avail_mem}M \\
    --INPUT $vcf \\
    --OUTPUT ${prefix}_renam.vcf.gz \\
    $extended_args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard RenameSampleInVcf --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
49
50
51
52
53
54
55
"""
touch ${prefix}_renam.vcf.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard RenameSampleInVcf --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
picard \\
    SortVcf \\
    -Xmx${avail_mem}M \\
    --INPUT $vcf \\
    $args \\
    $seq_dict \\
    $reference \\
    --OUTPUT ${prefix}_sorted.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard SortVcf --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
52
53
54
55
56
57
58
59
60
61
"""
touch ${prefix}_sorted.vcf.gz
touch ${prefix}.bam.bai
touch ${prefix}.MarkDuplicates.metrics.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    picard: \$(picard SortVcf --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
NextFlow From line 52 of sortvcf/main.nf
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""
unset DISPLAY
mkdir -p tmp
export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp
qualimap \\
    --java-mem-size=$memory \\
    bamqc \\
    $args \\
    -bam $bam \\
    $regions \\
    -p $strandedness \\
    $collect_pairs \\
    -outdir $prefix \\
    -nt $task.cpus

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//')
END_VERSIONS
"""
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
"""
mkdir -p $prefix/css
mkdir $prefix/images_qualimapReport
mkdir $prefix/raw_data_qualimapReport
cd $prefix/css
touch agogo.css
touch basic.css
touch bgtop.png
touch comment-close.png
touch doctools.js
touch down-pressed.png
touch jquery.js
touch plus.png
touch qualimap_logo_small.png
touch searchtools.js
touch up.png
touch websupport.js
touch ajax-loader.gif
touch bgfooter.png
touch comment-bright.png
touch comment.png
touch down.png
touch file.png
touch minus.png
touch pygments.css
touch report.css
touch underscore.js
touch up-pressed.png
cd ../images_qualimapReport/
touch genome_coverage_0to50_histogram.png
touch genome_coverage_quotes.png
touch genome_insert_size_across_reference.png
touch genome_mapping_quality_histogram.png
touch genome_uniq_read_starts_histogram.png
touch genome_coverage_across_reference.png
touch genome_gc_content_per_window.png
touch genome_insert_size_histogram.png
touch genome_reads_clipping_profile.png
touch genome_coverage_histogram.png
touch genome_homopolymer_indels.png
touch genome_mapping_quality_across_reference.png
touch genome_reads_content_per_read_position.png
cd ../raw_data_qualimapReport
touch coverage_across_reference.txt
touch genome_fraction_coverage.txt
touch insert_size_histogram.txt
touch mapped_reads_nucleotide_content.txt
touch coverage_histogram.txt
touch homopolymer_indels.txt
touch mapped_reads_clipping_profile.txt
touch mapping_quality_across_reference.txt
touch duplication_rate_histogram.txt
touch insert_size_across_reference.txt
touch mapped_reads_gc-content_distribution.txt
touch mapping_quality_histogram.txt
cd ../
touch genome_results.txt
touch qualimapReport.html
cd ../

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//')
END_VERSIONS
"""
NextFlow From line 58 of bamqc/main.nf
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
rhocall \\
    annotate \\
    $args \\
    $az_bed \\
    -r $roh \\
    -o ${prefix}_rhocall.vcf \\
    $vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    rhocall: \$(echo \$(rhocall --version 2>&1) | sed 's/rhocall, version //' )
END_VERSIONS
"""
43
44
45
46
47
48
49
50
"""
touch ${prefix}_rhocall.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    rhocall: \$(echo \$(rhocall --version 2>&1) | sed 's/rhocall, version //' )
END_VERSIONS
"""
25
26
27
28
29
30
31
32
33
34
35
"""
samtools \\
    faidx \\
    $fasta \\
    $args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
40
41
42
43
44
45
46
47
48
49
"""
${fastacmd}
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 40 of faidx/main.nf
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
samtools \\
    merge \\
    --threads ${task.cpus-1} \\
    $args \\
    ${reference} \\
    ${prefix}.${file_type} \\
    $input_files

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
48
49
50
51
52
53
54
55
"""
touch ${prefix}.${file_type}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
NextFlow From line 48 of merge/main.nf
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
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
"""
41
42
43
44
45
46
47
48
"""
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 41 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
samtools \\
    view \\
    --threads ${task.cpus-1} \\
    ${reference} \\
    ${readnames} \\
    $args \\
    -o ${prefix}.${file_type} \\
    $input \\
    $args2

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
57
58
59
60
61
62
63
64
65
"""
touch ${prefix}.bam
touch ${prefix}.cram

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
NextFlow From line 57 of view/main.nf
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
echo $bam | tr ' ' '
' > manifest.txt
smn_caller.py \\
    $args \\
    --manifest manifest.txt \\
    --prefix $prefix \\
    --outDir "out" \\
    --threads $task.cpus

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    SMNCopyNumberCaller: $VERSION
END_VERSIONS
"""
44
45
46
47
48
49
50
51
52
53
"""
mkdir out
touch out/${prefix}.tsv
touch out/${prefix}.json

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    SMNCopyNumberCaller: $VERSION
END_VERSIONS
"""
25
26
27
28
29
30
31
32
33
34
35
"""
stranger \\
    $args \\
    $vcf \\
    $options_variant_catalog | gzip --no-name > ${prefix}.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    stranger: \$( stranger --version )
END_VERSIONS
"""
39
40
41
42
43
44
45
46
"""
touch ${prefix}.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    stranger: \$( stranger --version )
END_VERSIONS
"""
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
svdb \\
    --merge \\
    $args \\
    $prio \\
    --vcf $input \\
    > ${prefix}_sv_merge.vcf
bgzip ${prefix}_sv_merge.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    svdb: \$( echo \$(svdb) | head -1 | sed 's/usage: SVDB-\\([0-9]\\.[0-9]\\.[0-9]\\).*/\\1/' )
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
50
51
52
53
54
55
56
57
58
"""
touch ${prefix}_sv_merge.vcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    svdb: \$( echo \$(svdb) | head -1 | sed 's/usage: SVDB-\\([0-9]\\.[0-9]\\.[0-9]\\).*/\\1/' )
    samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
NextFlow From line 50 of merge/main.nf
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
svdb \\
    --query \\
    $in_occ \\
    $in_frq \\
    $out_occ \\
    $out_frq \\
    $args \\
    --db ${vcf_dbs.join(',')} \\
    --query_vcf $vcf \\
    --prefix ${prefix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    svdb: \$( echo \$(svdb) | head -1 | sed 's/usage: SVDB-\\([0-9]\\.[0-9]\\.[0-9]\\).*/\\1/' )
END_VERSIONS
"""
65
66
67
68
69
70
71
72
"""
touch ${prefix}_query.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    svdb: \$( echo \$(svdb) | head -1 | sed 's/usage: SVDB-\\([0-9]\\.[0-9]\\.[0-9]\\).*/\\1/' )
END_VERSIONS
"""
NextFlow From line 65 of query/main.nf
25
26
27
28
29
30
31
32
33
"""
bgzip  --threads ${task.cpus} -c $args $input > ${prefix}.${input.getExtension()}.gz
tabix $args2 ${prefix}.${input.getExtension()}.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
"""
37
38
39
40
41
42
43
44
45
46
"""
touch ${prefix}.${input.getExtension()}.gz
touch ${prefix}.${input.getExtension()}.gz.tbi
touch ${prefix}.${input.getExtension()}.gz.csi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
"""
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
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
tiddit \\
    --cov \\
    -o $prefix \\
    $args \\
    --bam $input \\
    $reference

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*tiddit-//; s/ .*\$//')
END_VERSIONS
"""
42
43
44
45
46
47
48
49
50
"""
touch ${prefix}.wig
touch ${prefix}.tab

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*tiddit-//; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 42 of cov/main.nf
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
$bwa_command

tiddit \\
    --sv \\
    $args \\
    --bam $input \\
    --ref $fasta \\
    -o $prefix

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*tiddit-//; s/ .*\$//')
END_VERSIONS
"""
46
47
48
49
50
51
52
53
54
"""
touch ${prefix}.vcf
touch ${prefix}.ploidies.tab

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*tiddit-//; s/ .*\$//')
END_VERSIONS
"""
NextFlow From line 46 of sv/main.nf
26
27
28
29
30
31
32
33
34
35
36
37
"""
wigToBigWig \\
    $args \\
    $wig \\
    $sizes \\
    ${prefix}.bw

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    ucsc: $VERSION
END_VERSIONS
"""
42
43
44
45
46
47
48
49
"""
touch ${prefix}.bw

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    ucsc: $VERSION
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
"""
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
24
25
26
27
28
29
30
31
32
33
34
"""
upd \\
    --vcf $vcf \\
    $args \\
    | sort -k 1,1 -k 2,2n >${prefix}.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    upd: \$( upd --version 2>&1 | sed 's/upd, version //' )
END_VERSIONS
"""
NextFlow From line 24 of upd/main.nf
38
39
40
41
42
43
44
45
"""
touch ${prefix}.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    upd: \$( upd --version 2>&1 | sed 's/upd, version //' )
END_VERSIONS
"""
NextFlow From line 38 of upd/main.nf
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
vcfanno \\
    -p ${task.cpus} \\
    ${args} \\
    ${lua_cmd} \\
    ${toml} \\
    ${vcf} \\
    > ${prefix}.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    vcfanno: \$(echo \$(vcfanno 2>&1 | grep version | cut -f3 -d' ' ))
END_VERSIONS
"""
44
45
46
47
48
49
50
51
"""
touch ${prefix}.vcf

cat <<-END_VERSIONS > versions.yml
"${task.process}":
    vcfanno: \$(echo \$(vcfanno 2>&1 | grep version | cut -f3 -d' ' ))
END_VERSIONS
"""
NextFlow From line 44 of vcfanno/main.nf
ShowHide 166 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

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 ...