Skip to content

Commit e78618f

Browse files
author
kevinmhadi
committed
Fix to SV chimera filter
1 parent 4693455 commit e78618f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

modules/local/process.nf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ process SV_CHIMERA_FILTER {
1919
def prefix = task.ext.prefix ?: "${meta.id}"
2020
def out_vcf = vcf.getName().replaceFirst(/\.vcf(\.gz|\.bgz)?$/, '.ffpe_filtered.vcf.gz')
2121
"""
22-
bcftools view -Oz -i "(FORMAT/SR[1] + FORMAT/RP[1]) > 6 && (INFO/AS) >= 1 && (FORMAT/QUAL[1]) >= 150" ${vcf} > ${out_vcf}
22+
# Detect tumor sample name (first sample listed = tumor by GRIDSS/SvABA convention)
23+
tumor_idx=\$(( \$(bcftools query -l ${vcf} | wc -l) - 1 ))
24+
bcftools view -Oz \\
25+
-i "(FORMAT/SR[\${tumor_idx}] + FORMAT/RP[\${tumor_idx}]) > 6 && (INFO/AS) >= 1 && (FORMAT/QUAL[\${tumor_idx}]) >= 150" \\
26+
${vcf} > ${out_vcf}
27+
# bcftools view -Oz -i "(FORMAT/SR[1] + FORMAT/RP[1]) > 6 && (INFO/AS) >= 1 && (FORMAT/QUAL[1]) >= 150" ${vcf} > ${out_vcf}
2328
2429
bcftools index --tbi ${out_vcf}
2530

0 commit comments

Comments
 (0)