Skip to content

Commit

Permalink
Revert "Add filter_NonPassCalls_BCFtools"
Browse files Browse the repository at this point in the history
This reverts commit 46e6c18.
  • Loading branch information
Pan authored and Pan committed Dec 18, 2021
1 parent 46e6c18 commit 7c8111d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 57 deletions.
25 changes: 6 additions & 19 deletions pipeline/call-sSV.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Starting workflow...
.stripIndent()

include { run_validate_PipeVal } from './modules/validation'
include { query_SampleName_BCFtools; filter_NonPassCalls_BCFtools } from './modules/bcftools'
include { query_SampleName_BCFtools } from './modules/bcftools'
include { call_sSV_Delly; filter_sSV_Delly } from './modules/delly'
include { generate_sha512; generate_sha512 as generate_sha512_NonPassFiltering } from './modules/sha512'
include { generate_sha512 } from './modules/sha512'

/**
* Check the params
Expand Down Expand Up @@ -89,7 +89,7 @@ input_validation = Channel

if (params.verbose){
input_validation.view()
}
}

/**
* Create input_paired_bams_ch to get the paired turmor sample and control sample
Expand All @@ -109,7 +109,7 @@ input_paired_bams_ch = Channel

if (params.verbose){
input_paired_bams_ch.view()
}
}

/**
* Create tumor_bams_ch to only get the turmor samples.
Expand All @@ -129,7 +129,7 @@ tumor_bams_ch = Channel

if (params.verbose){
tumor_bams_ch.view()
}
}

workflow{
/**
Expand Down Expand Up @@ -196,18 +196,5 @@ workflow{
/**
* Generate one sha512 checksum for the output files.
*/
generate_sha512(call_sSV_Delly.out.nt_call_bcf.mix(
call_sSV_Delly.out.nt_call_bcf_csi,
filter_sSV_Delly.out.somatic_bcf,
filter_sSV_Delly.out.somatic_bcf_csi))

/**
* Call "bcftools view -i 'FILTER=="PASS"' -O b -o "non_pass_filtered_${input_bcf}" $input_bcf"
* to filter out NonPass calls
* and further generate sha512 for the output
*/
if (params.non_pass_filtering) {
filter_NonPassCalls_BCFtools(filter_sSV_Delly.out.somatic_bcf)
generate_sha512_NonPassFiltering(filter_NonPassCalls_BCFtools.out.nonPassCallsFiltered.mix(filter_NonPassCalls_BCFtools.out.nonPassCallsFiltered_csi))
}
generate_sha512(call_sSV_Delly.out.nt_call_bcf.mix(call_sSV_Delly.out.nt_call_bcf_csi, filter_sSV_Delly.out.filtered_somatic_bcf, filter_sSV_Delly.out.filtered_somatic_bcf_csi))
}
2 changes: 0 additions & 2 deletions pipeline/config/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ params {
map_qual = 20
min_clique_size = 5
mad_cutoff = 15

non_pass_filtering = true
}

includeConfig "${projectDir}/config/methods.config"
Expand Down
31 changes: 0 additions & 31 deletions pipeline/modules/bcftools.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,4 @@ process query_SampleName_BCFtools {
paste ${tmp_samples} samples_type > "${tmp_samples}.tsv"
"""
}

process filter_NonPassCalls_BCFtools {
container params.docker_image_bcftools

publishDir "${params.output_dir}/output",
pattern: "${filename_base}_nonPassCallsFiltered.bcf*",
mode: "copy"

publishDir "${params.log_output_dir}/process-log",
pattern: ".command.*",
mode: "copy",
saveAs: { "${task.process.replace(':', '/')}/log${file(it).getName()}" }

input:
path input_bcf

output:
path ".command.*"
path "${filename_base}_nonPassCallsFiltered.bcf", emit: nonPassCallsFiltered
path "${filename_base}_nonPassCallsFiltered.bcf.csi", emit: nonPassCallsFiltered_csi

script:
filename_base = file(input_bcf).baseName
"""
set -euo pipefail
bcftools view -i 'FILTER=="PASS"' -O b -o "${filename_base}_nonPassCallsFiltered.bcf" $input_bcf
bcftools index "${filename_base}_nonPassCallsFiltered.bcf"
"""
}
9 changes: 4 additions & 5 deletions pipeline/modules/delly.nf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ process filter_sSV_Delly{
container params.docker_image_delly

publishDir "$params.output_dir/output",
pattern: "${filename_base}_somatic.bcf*",
pattern: "filtered_somatic_${tumor_sample_name}.bcf*",
mode: "copy"

publishDir "$params.log_output_dir/process-log",
Expand All @@ -69,14 +69,13 @@ process filter_sSV_Delly{
val tumor_sample_name

output:
path "${filename_base}_somatic.bcf", emit: somatic_bcf
path "${filename_base}_somatic.bcf.csi", emit: somatic_bcf_csi
path "filtered_somatic_${tumor_sample_name}.bcf", emit: filtered_somatic_bcf
path "filtered_somatic_${tumor_sample_name}.bcf.csi", emit: filtered_somatic_bcf_csi
path ".command.*"

script:
filename_base = file(input_bcf).baseName
"""
set -euo pipefail
delly filter -f somatic -s ${samples} -o ${filename_base}_somatic.bcf "$input_bcf"
delly filter -f somatic -s ${samples} -o filtered_somatic_${tumor_sample_name}.bcf "$input_bcf"
"""
}

0 comments on commit 7c8111d

Please sign in to comment.