Skip to content

Commit

Permalink
Skip phasing when not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
seppinho committed Nov 17, 2023
1 parent 3a2cfef commit bead927
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion modules/local/phasing/beagle.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ process BEAGLE {
tag "${chunkfile}"

input:
tuple val(chr), path(bcf), val(start), val(end), val(phasing_status), path(chunkfile), val(snps), val(in_reference), path(map_beagle)
tuple val(chr), path(bcf), val(start), val(end), val(phasing_status), path(chunkfile), path(map_beagle)
val phasing_method

output:
Expand Down
2 changes: 1 addition & 1 deletion modules/local/phasing/eagle.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ process EAGLE {
tag "${chunkfile}"

input:
tuple val(chr), path(bcf), path(bcf_csi), val(start), val(end), val(phasing_status), path(chunkfile), val(snps), val(in_reference)
tuple val(chr), path(bcf), path(bcf_csi), val(start), val(end), val(phasing_status), path(chunkfile)
path map_eagle

output:
Expand Down
15 changes: 6 additions & 9 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ nextflow_pipeline {
password = PASSWORD
refpanel_yaml = "$projectDir/tests/data/refpanels/hapmap2-chr20/cloudgene.yaml"
output = "${outputDir}"
phasing = "no_phasing"
}
}

Expand All @@ -92,19 +93,15 @@ nextflow_pipeline {
assert imputed_chr_20.exists()
ZipFile zipFile = new ZipFile(imputed_chr_20, PASSWORD.toCharArray());
zipFile.extractAll("${outputDir}");

//TODO: this is from imputationserver-utils.jar. How to include? use alternative?
/*VcfFile file = VcfFileUtil.load("${outputDir}/chr20.dose.vcf.gz", 100000000, false);

def file = path("${outputDir}/chr20.dose.vcf.gz").vcf
assert file.getChromosome() == "20"
assert file.getNoSamples() == 51;
assert file.isPhased()
assert file.getNoSnps() == TOTAL_REFPANEL_CHR20_B37 + ONLY_IN_INPUT*/

assert file.getNoSnps() == TOTAL_REFPANEL_CHR20_B37 + ONLY_IN_INPUT
//check correct number of snps in info.gz file
//TODO: phasing executed every time, therefore ONLY_IN_INPUT is currently not available
// assert path("${outputDir}/chr20.info.gz").linesGzip.size() == 1 + TOTAL_REFPANEL_CHR20_B37 + ONLY_IN_INPUT
assert path("${outputDir}/chr20.info.gz").linesGzip.size() == 1 + TOTAL_REFPANEL_CHR20_B37
assert path("${outputDir}/chr20.info.gz").linesGzip.size() == 1 + TOTAL_REFPANEL_CHR20_B37 + ONLY_IN_INPUT

}

}
Expand Down
17 changes: 13 additions & 4 deletions workflows/imputationserver.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,26 @@ workflow IMPUTATIONSERVER {
INPUT_VALIDATION.out,
legend_files_ch.collect()
)
//TODO: add phasing only mode

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

PHASING(
QUALITY_CONTROL.out.qc_metafiles
imputation_ch = QUALITY_CONTROL.out.qc_metafiles

if ("${params.phasing}" != 'no_phasing') {

PHASING(
imputation_ch
)

imputation_ch = PHASING.out.phased_ch

}


if ("${params.mode}" == 'imputation') {

IMPUTATION(
PHASING.out.phased_ch
imputation_ch
)

ENCRYPTION(
Expand Down
2 changes: 1 addition & 1 deletion workflows/quality_control.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ workflow QUALITY_CONTROL {
chunks_csv_index
.combine(chunks_vcf_index, by: 0)
.map{
row-> tuple(row[1], row[2], row[3], row[4], file(row[8]), row[6], row[7])
row-> tuple(row[1], row[2], row[3], row[4], file(row[8]))
}
.set { metafiles_ch }

Expand Down

0 comments on commit bead927

Please sign in to comment.