Skip to content

Commit

Permalink
Remove phasing-only mode (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
seppinho authored Nov 21, 2023
1 parent c26720f commit c71eee1
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 51 deletions.
1 change: 0 additions & 1 deletion cloudgene.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ workflow:
values:
qconly: Quality Control Only
imputation: Quality Control & Imputation
phasing: Quality Control & Phasing Only

- id: aesEncryption
description: AES 256 encryption
Expand Down
9 changes: 1 addition & 8 deletions modules/local/compression/compression_encryption_vcf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,16 @@ process COMPRESSION_ENCRYPTION_VCF {
def info_name = "${prefix}.info"
def aes = params.encryption.aes ? "-mem=AES256" : ""
def panel_version = RefPanelUtil.loadFromFile(params.refpanel_yaml).id
def phasing_version = "no_phasing"
switch(params.phasing) {
case "eagle": phasing_version ="${params.eagle_version}"; break;
case "beagle": phasing_version ="${params.beagle_version}"; break;
}

"""
# concat info files
csvtk concat ${info_joined} > ${info_name}
bgzip ${info_name}
# concat dosage files and update header
# TODO: a new file is written with the new header, should we add this on a chunk level and ove this block to imputation module and re-header there?
bcftools concat -n ${imputed_joined} -o tmp_${imputed_name} -Oz
echo "##mis_pipeline=${params.pipeline_version}" > add_header.txt
echo "##mis_imputation=${params.imputation_version}" >> add_header.txt
echo "##mis_phasing=${phasing_version}" >> add_header.txt
echo "##mis_phasing=${params.phasing}" >> add_header.txt
echo "##mis_panel=${panel_version}" >> add_header.txt
bcftools annotate -h add_header.txt tmp_${imputed_name} -o ${imputed_name} -Oz
rm tmp_${imputed_name}
Expand Down
3 changes: 0 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ params {
r2Filter = 0
password = null
pipeline_version = 'michigan-imputationserver-1.6.0-rc5'
eagle_version = 'eagle-2.4'
beagle_version = 'beagle.18May20.d20.jar'
imputation_version = 'minimac4-1.0.2'

config = [
send_mail: false
Expand Down
Binary file not shown.
Binary file not shown.
35 changes: 0 additions & 35 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -279,45 +279,10 @@ nextflow_pipeline {

def header = getVcfHeader(path("${outputDir}/chr20.dose.vcf.gz"))
assert header.getOtherHeaderLine("mis_phasing").getValue() == params.phasing
assert header.getOtherHeaderLine("mis_imputation").getKey()
assert header.getOtherHeaderLine("mis_pipeline").getKey()
assert header.getOtherHeaderLine("mis_panel").getKey()
}

}

test("Should run phasing-only") {

when {
params {
project = "test-job"
build = "hg19"
files = "$projectDir/tests/input/chr20-phased/*.vcf.gz"
population = "eur"
mode = "phasing_only"
password = PASSWORD
refpanel_yaml = "$projectDir/tests/data/refpanels/hapmap2-chr20/cloudgene.yaml"
output = "${outputDir}"
}
}

then {
assert workflow.success

def quality_control_log = file("${outputDir}/cloudgene.report.json")
assert quality_control_log.exists()
assert quality_control_log.text.contains("Remaining sites in total: 7,735")

//TODO: add phasing only mode in workflow!
//def imputed_chr_20 = file("${outputDir}/chr_20.zip");
//assert imputed_chr_20.exists()
//ZipFile zipFile = new ZipFile(imputed_chr_20, PASSWORD.toCharArray());
//zipFile.extractAll("${outputDir}");



}

}

}
8 changes: 4 additions & 4 deletions workflows/imputationserver.nf
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,23 @@ workflow IMPUTATIONSERVER {

if (params.mode != 'qc-only') {

imputation_ch = QUALITY_CONTROL.out.qc_metafiles
phased_ch = QUALITY_CONTROL.out.qc_metafiles

if (params.phasing != 'no_phasing') {

PHASING(
imputation_ch
QUALITY_CONTROL.out.qc_metafiles
)

imputation_ch = PHASING.out.phased_ch
phased_ch = PHASING.out.phased_ch

}


if (params.mode == 'imputation') {

IMPUTATION(
imputation_ch
phased_ch
)

ENCRYPTION(
Expand Down

0 comments on commit c71eee1

Please sign in to comment.