diff --git a/CHANGELOG.md b/CHANGELOG.md index 53b8180..3221173 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm --- ## [Unreleased] +### Added +- NFTest test case --- diff --git a/nftest.yml b/nftest.yml new file mode 100644 index 0000000..b6d0856 --- /dev/null +++ b/nftest.yml @@ -0,0 +1,37 @@ +--- +global: + temp_dir: ./test/work + nf_config: test/global.config + remove_temp: true + clean_logs: true + +cases: + - name: test-call-gSNP-paired + message: Test call-gSNP pipeline with one normal and one tumor pair + nf_script: ./main.nf + nf_config: test/test-call-gSNP-paired.config + params_file: test/Illumina-paired.yaml + skip: false + verbose: true + asserts: + - actual: call-gSNP-*/NA24143/GATK-*/output/GATK-*_IlluminaTest_NA24143.g.vcf.gz + expect: /hot/software/pipeline/pipeline-call-gSNP/Nextflow/development/output/test-call-gSNP-paired/call-gSNP-10.1.0-rc.1/NA24143/GATK-4.5.0.0/output/GATK-4.5.0.0_IlluminaTest_NA24143.g.vcf.gz + script: test/assert-vcf.sh + - actual: call-gSNP-*/NA24143/GATK-*/output/GATK-*_IlluminaTest_NA24143_indel.vcf.gz + expect: /hot/software/pipeline/pipeline-call-gSNP/Nextflow/development/output/test-call-gSNP-paired/call-gSNP-10.1.0-rc.1/NA24143/GATK-4.5.0.0/output/GATK-4.5.0.0_IlluminaTest_NA24143_indel.vcf.gz + script: test/assert-vcf.sh + - actual: call-gSNP-*/NA24143/GATK-*/output/GATK-*_IlluminaTest_NA24143_snv.vcf.gz + expect: /hot/software/pipeline/pipeline-call-gSNP/Nextflow/development/output/test-call-gSNP-paired/call-gSNP-10.1.0-rc.1/NA24143/GATK-4.5.0.0/output/GATK-4.5.0.0_IlluminaTest_NA24143_snv.vcf.gz + script: test/assert-vcf.sh + - actual: call-gSNP-*/NA24143/GATK-*/output/GATK-*_IlluminaTest_NA24143.vcf.gz + expect: /hot/software/pipeline/pipeline-call-gSNP/Nextflow/development/output/test-call-gSNP-paired/call-gSNP-10.1.0-rc.1/NA24143/GATK-4.5.0.0/output/GATK-4.5.0.0_IlluminaTest_NA24143.vcf.gz + script: test/assert-vcf.sh + - actual: call-gSNP-*/NA24143/GATK-*/output/GATK-*_IlluminaTest_NA24143_VQSR-SNP-AND-INDEL.vcf.gz + expect: /hot/software/pipeline/pipeline-call-gSNP/Nextflow/development/output/test-call-gSNP-paired/call-gSNP-10.1.0-rc.1/NA24143/GATK-4.5.0.0/output/GATK-4.5.0.0_IlluminaTest_NA24143_VQSR-SNP-AND-INDEL.vcf.gz + script: test/assert-vcf.sh + - actual: call-gSNP-*/NA24143/GATK-*/output/GATK-*_IlluminaTest_NA24149.g.vcf.gz + expect: /hot/software/pipeline/pipeline-call-gSNP/Nextflow/development/output/test-call-gSNP-paired/call-gSNP-10.1.0-rc.1/NA24143/GATK-4.5.0.0/output/GATK-4.5.0.0_IlluminaTest_NA24149.g.vcf.gz + script: test/assert-vcf.sh + - actual: call-gSNP-*/NA24143/GATK-*/output/GATK-*_IlluminaTest_NA24143_genotype-count.tsv + expect: /hot/software/pipeline/pipeline-call-gSNP/Nextflow/development/output/test-call-gSNP-paired/call-gSNP-10.1.0-rc.1/NA24143/GATK-4.5.0.0/output/GATK-4.5.0.0_IlluminaTest_NA24143_genotype-count.tsv + method: md5 diff --git a/test/Illumina-paired.yaml b/test/Illumina-paired.yaml new file mode 100644 index 0000000..a833ea3 --- /dev/null +++ b/test/Illumina-paired.yaml @@ -0,0 +1,8 @@ +--- +patient_id: "NA24143" +input: + BAM: + normal: + - "/hot/software/pipeline/metapipeline-DNA/Nextflow/development/input/data/BAM/NA24149/BWA-MEM2-2.2.1_GATK-4.2.4.1_IlluminaSampleTest_NA24149.bam" + tumor: + - "/hot/software/pipeline/metapipeline-DNA/Nextflow/development/input/data/BAM/NA24143/BWA-MEM2-2.2.1_GATK-4.2.4.1_IlluminaSampleTest_NA24143.bam" diff --git a/test/assert-vcf.sh b/test/assert-vcf.sh new file mode 100755 index 0000000..202656f --- /dev/null +++ b/test/assert-vcf.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +function md5_vcf { + zcat "$1" | grep -v "^##" | md5sum | cut -d ' ' -f 1 +} + +received=$(md5_vcf "$1") +expected=$(md5_vcf "$2") + +if [ "$received" == "$expected" ] +then + echo "VCF files are equal." + exit 0 +else + echo "VCF files are not equal" >&2 + exit 1 +fi diff --git a/test/global.config b/test/global.config new file mode 100644 index 0000000..df1c860 --- /dev/null +++ b/test/global.config @@ -0,0 +1,9 @@ +docker { + enabled = true + + // Pass user's UID/GID and group IDs to Docker + uid_and_gid = "-u \$(id -u):\$(id -g)" + all_group_ids = "\$(for i in `id --real --groups`; do echo -n \"--group-add=\$i \"; done)" + + runOptions = "${uid_and_gid} ${all_group_ids}" +} diff --git a/test/test-call-gSNP-paired.config b/test/test-call-gSNP-paired.config new file mode 100644 index 0000000..41ab2b0 --- /dev/null +++ b/test/test-call-gSNP-paired.config @@ -0,0 +1,49 @@ +// EXECUTION SETTINGS AND GLOBAL DEFAULTS + +// External config files import. DO NOT MODIFY THESE LINES! +includeConfig "${projectDir}/config/default.config" +includeConfig "${projectDir}/config/methods.config" +includeConfig "${projectDir}/nextflow.config" + + +// Inputs/parameters of the pipeline +params { + dataset_id = 'IlluminaTest' + blcds_registered_dataset = false // if you want the output to be registered + + // Set to false to disable the publish rule and delete intermediate files as they're no longer needed + // Disable this option for large input BAMs where /scratch space may not be sufficient + save_intermediate_files = false + + // Whether to cache intermediate processes. Set to false by default + // To enable caching, uncomment this option and set to true + // cache_intermediate_pipeline_steps = false + + // Target intervals to process for DNA panel/targeted sequencing samples + // For WGS, leave this field blank. The intervals will be extracted automatically from the reference dictionary + // For WXS/WES and targeted sequencing samples: provide path to targets in .list, .intervals, BED file, or VCF file format + // Defaults to WGS mode + intervals = "" + + // Number of intervals to split into and any additional splitting arguments + scatter_count = 50 + split_intervals_extra_args = '' + + // Reference - Used here hg38 decoy version + // GATK requires the reference fasta to be accompanied by a .fai index and .dict dictionary associated with the fasta for fast random access + // These can be found in the same folder as the reference here: /hot/ref/reference/GRCh38-BI-20160721 + reference_fasta = "/hot/ref/reference/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta" + + // GATK bundle - Used here hg38 decoy version + bundle_mills_and_1000g_gold_standard_indels_vcf_gz = "/hot/ref/tool-specific-input/GATK/GRCh38/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz" + bundle_v0_dbsnp138_vcf_gz = "/hot/ref/tool-specific-input/GATK/GRCh38/resources_broad_hg38_v0_Homo_sapiens_assembly38.dbsnp138.vcf.gz" + bundle_hapmap_3p3_vcf_gz = "/hot/ref/tool-specific-input/GATK/GRCh38/hapmap_3.3.hg38.vcf.gz" + bundle_omni_1000g_2p5_vcf_gz = "/hot/ref/tool-specific-input/GATK/GRCh38/1000G_omni2.5.hg38.vcf.gz" + bundle_phase1_1000g_snps_high_conf_vcf_gz = "/hot/ref/tool-specific-input/GATK/GRCh38/1000G_phase1.snps.high_confidence.hg38.vcf.gz" + + // Base resource allocation updater + // See README for adding parameters to update the base resource allocations +} + +// Setup the pipeline config. DO NOT REMOVE THIS LINE! +methods.setup()