Skip to content

Commit

Permalink
Add phasing window to beagle
Browse files Browse the repository at this point in the history
  • Loading branch information
seppinho committed Jun 14, 2024
1 parent 1874b47 commit 6480436
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/local/phasing/beagle.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ process BEAGLE {
// replace X.nonPAR etc with X for phasing
def chr_cleaned = "${chr}".startsWith('X.') ? 'X' : "${chr}"
def chr_mapped = "${params.refpanel.build}" == 'hg38' ? 'chr' + "${chr_cleaned}" : "${chr_cleaned}"

def phasing_start = "${start}".toInteger() - "${params.phasing_window}".toInteger()
phasing_start = "$phasing_start" < 0 ? 1 : "$phasing_start"
def phasing_end = "${end}".toInteger() + "${params.phasing_window}".toInteger()

"""
java -jar /usr/bin/beagle.18May20.d20.jar \
ref=${bcf} \
gt=${chunkfile} \
out=${chunkfile_name}.phased \
nthreads=${task.cpus} \
chrom=${chr_mapped}:${start}-${end} \
chrom=${chr_mapped}:${phasing_start}-${phasing_end} \
map=${map_beagle} \
impute=false
"""
Expand Down

0 comments on commit 6480436

Please sign in to comment.