diff --git a/src/main/java/genepi/imputationserver/steps/QualityControlCommand.java b/src/main/java/genepi/imputationserver/steps/QualityControlCommand.java index 8fec0ec..4cf9ef6 100644 --- a/src/main/java/genepi/imputationserver/steps/QualityControlCommand.java +++ b/src/main/java/genepi/imputationserver/steps/QualityControlCommand.java @@ -434,4 +434,7 @@ protected TaskResults runTask(final OutputWriter output, ITask task) { } + public void setBuild(String build) { + this.build = build; + } } diff --git a/src/main/java/genepi/imputationserver/steps/fastqc/StatisticsTask.java b/src/main/java/genepi/imputationserver/steps/fastqc/StatisticsTask.java index 2e8b4dc..be3c1ff 100644 --- a/src/main/java/genepi/imputationserver/steps/fastqc/StatisticsTask.java +++ b/src/main/java/genepi/imputationserver/steps/fastqc/StatisticsTask.java @@ -239,7 +239,7 @@ public void processFile(VcfFile myvcfFile, LineWriter mafWriter, LineWriter excl } // load reference snp - SitesEntry refSnp = legendReader.findByPosition(myvcfFile.getChromosome(), snp.getStart()); + SitesEntry refSnp = legendReader.findByPosition(myvcfFile.getRawChromosome(), snp.getStart()); for (VcfChunk openChunk : chunks.values()) { if (snp.getStart() <= openChunk.getEnd() + phasingWindow) { diff --git a/src/test/java/genepi/imputationserver/steps/QualityControlCommandTest.java b/src/test/java/genepi/imputationserver/steps/QualityControlCommandTest.java index d11c446..3ab0be9 100644 --- a/src/test/java/genepi/imputationserver/steps/QualityControlCommandTest.java +++ b/src/test/java/genepi/imputationserver/steps/QualityControlCommandTest.java @@ -45,6 +45,38 @@ public void testQcStatistics() throws Exception { } + @Test + public void testQcStatisticsChr20Hg19() throws Exception { + + String inputFolder = "test-data/data/chr20-phased"; + + QualityControlCommand command = buildCommand(inputFolder); + command.setPopulation("eur"); + command.setReference("test-data/configs/hapmap-chr20/hapmap2.json"); + command.call(); + OutputReader log = new OutputReader(CLOUDGENE_LOG); + assertTrue(log.hasInMemory("Remaining sites in total: 7,735")); + + } + @Test + public void testQcStatisticsChr20Hg38() throws Exception { + + String inputFolder = "test-data/data/chr20-phased-hg38"; + + QualityControlCommand command = buildCommand(inputFolder); + command.setPopulation("eur"); + command.setBuild("hg38"); + //set the following file in hapmap2: hapmap_r22.chr20.CEU.hg38_impute.legend.gz + command.setReference("test-data/configs/hapmap-chr20-hg38/hapmap2.json"); + command.call(); + + OutputReader log = new OutputReader(CLOUDGENE_LOG); + log.view(); + assertTrue(log.hasInMemory("Remaining sites in total: 7,735")); + + } + + @Test public void testQcStatisticAllChunksExcluded() throws Exception { diff --git a/test-data/configs/hapmap-chr20-hg38/ref-panels/hapmap_r22.chr20.CEU.hg38_impute.legend.gz b/test-data/configs/hapmap-chr20-hg38/ref-panels/hapmap_r22.chr20.CEU.hg38_impute.legend.gz index f7fd78f..342f1c8 100644 Binary files a/test-data/configs/hapmap-chr20-hg38/ref-panels/hapmap_r22.chr20.CEU.hg38_impute.legend.gz and b/test-data/configs/hapmap-chr20-hg38/ref-panels/hapmap_r22.chr20.CEU.hg38_impute.legend.gz differ diff --git a/test-data/configs/hapmap-chr20-hg38/ref-panels/hapmap_r22.chr20.CEU.hg38_impute.legend.gz.tbi b/test-data/configs/hapmap-chr20-hg38/ref-panels/hapmap_r22.chr20.CEU.hg38_impute.legend.gz.tbi index 372c50e..b41f62b 100644 Binary files a/test-data/configs/hapmap-chr20-hg38/ref-panels/hapmap_r22.chr20.CEU.hg38_impute.legend.gz.tbi and b/test-data/configs/hapmap-chr20-hg38/ref-panels/hapmap_r22.chr20.CEU.hg38_impute.legend.gz.tbi differ