Skip to content

Commit

Permalink
Update modules/local/add_found_in_tag/main.nf
Browse files Browse the repository at this point in the history
Co-authored-by: Annick Renevey <[email protected]>
  • Loading branch information
fellen31 and rannick authored Jan 8, 2025
1 parent 67cb026 commit e75da99
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions modules/local/add_found_in_tag/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ process ADD_FOUND_IN_TAG {
stub:
def args2 = task.ext.args2 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def extension = args2.contains("--output-type b") || args2.contains("-Ob") ? "bcf.gz" :
args2.contains("--output-type u") || args2.contains("-Ou") ? "bcf" :
args2.contains("--output-type z") || args2.contains("-Oz") ? "vcf.gz" :
args2.contains("--output-type v") || args2.contains("-Ov") ? "vcf" :
"vcf"
def index = args2.contains("--write-index=tbi") || args2.contains("-W=tbi") ? "tbi" :
args2.contains("--write-index=csi") || args2.contains("-W=csi") ? "csi" :
args2.contains("--write-index") || args2.contains("-W") ? "csi" :
""
def create_cmd = extension.endsWith(".gz") ? "echo '' | gzip >" : "touch"
def create_index = extension.endsWith(".gz") && index.matches("csi|tbi") ? "touch ${prefix}.${extension}.${index}" : ""
def extension = args2.contains('--output-type b') || args2.contains('-Ob') ? 'bcf.gz' :
args2.contains('--output-type u') || args2.contains('-Ou') ? 'bcf' :
args2.contains('--output-type z') || args2.contains('-Oz') ? "vcf.gz" :
args2.contains('--output-type v') || args2.contains('-Ov') ? 'vcf' :
'vcf'
def index = args2.contains('--write-index=tbi') || args2.contains('-W=tbi') ? 'tbi' :
args2.contains('--write-index=csi') || args2.contains("-W=csi") ? 'csi' :
args2.contains('--write-index') || args2.contains("-W") ? 'csi' :
''
def create_cmd = extension.endsWith('.gz') ? "echo '' | gzip >" : 'touch'
def create_index = extension.endsWith('.gz') && index.matches("csi|tbi") ? "touch ${prefix}.${extension}.${index}" : ''

"""
${create_cmd} ${prefix}.${extension}
Expand Down

0 comments on commit e75da99

Please sign in to comment.