@@ -66,12 +66,51 @@ nextflow_pipeline {
6666 }
6767
6868 }
69-
69+
7070 test("Should run with phased data") {
7171
7272 when {
7373 params {
74- project = "test-job"
74+ project = "testPipelineWithPhased"
75+ build = "hg19"
76+ files = "$projectDir/tests/input/chr20-phased/*.vcf.gz"
77+ population = "eur"
78+ password = PASSWORD
79+ refpanel_yaml = "$projectDir/tests/data/refpanels/hapmap2-chr20/cloudgene.yaml"
80+ output = "${outputDir}"
81+ phasing = "no_phasing"
82+ }
83+ }
84+
85+ then {
86+ assert workflow.success
87+
88+ def quality_control_log = file("${outputDir}/cloudgene.report.json")
89+ assert quality_control_log.exists()
90+ assert quality_control_log.text.contains("Remaining sites in total: 7,735")
91+
92+ def imputed_chr_20 = file("${outputDir}/chr_20.zip");
93+ assert imputed_chr_20.exists()
94+ ZipFile zipFile = new ZipFile(imputed_chr_20, PASSWORD.toCharArray());
95+ zipFile.extractAll("${outputDir}");
96+ def file = path("${outputDir}/chr20.dose.vcf.gz").vcf
97+ assert file.getChromosome() == "20"
98+ assert file.getNoSamples() == 51;
99+ assert file.isPhased()
100+ assert file.getNoSnps() == TOTAL_REFPANEL_CHR20_B37 + ONLY_IN_INPUT
101+
102+ //check correct number of snps in info.gz file
103+ assert path("${outputDir}/chr20.info.gz").linesGzip.size() == 1 + TOTAL_REFPANEL_CHR20_B37 + ONLY_IN_INPUT
104+
105+ }
106+
107+ }
108+
109+ test("Should run with phased data and meta option") {
110+
111+ when {
112+ params {
113+ project = "testPipelineWithPhasedAndMetaOption"
75114 build = "hg19"
76115 files = "$projectDir/tests/input/chr20-phased/*.vcf.gz"
77116 population = "eur"
@@ -94,6 +133,8 @@ nextflow_pipeline {
94133 ZipFile zipFile = new ZipFile(imputed_chr_20, PASSWORD.toCharArray());
95134 zipFile.extractAll("${outputDir}");
96135 def file = path("${outputDir}/chr20.dose.vcf.gz").vcf
136+ def fileMeta = path("${outputDir}/chr20.empiricalDose.vcf.gz").vcf
137+ assert fileMeta.getNoSnps() == 7735
97138 assert file.getChromosome() == "20"
98139 assert file.getNoSamples() == 51;
99140 assert file.isPhased()
0 commit comments