Skip to content

Commit

Permalink
vcf sort fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sorelfitzgibbon committed Aug 10, 2023
1 parent 836db28 commit 8816004
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions module/intersect-processes.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ process intersect_VCFs_BCFtools {
path "isec-1-or-more/*.txt", emit: isec

script:
vcf_list = vcfs.toSortedList().join(' ')
vcf_list = vcfs.join(' ')
regions_command = params.use_intersect_regions ? "--regions-file ${intersect_regions}" : ""
"""
set -euo pipefail
Expand Down Expand Up @@ -97,7 +97,7 @@ process concat_VCFs_BCFtools {
path ".command.*"

script:
vcf_list = vcfs.toSortedList().flatten().join(' ')
vcf_list = vcfs.join(' ')
"""
set -euo pipefail
# BCFtools concat to create a single VCF with all nfiles +2 variants
Expand Down
20 changes: 18 additions & 2 deletions module/intersect.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ workflow intersect {
script_dir_ch

main:
vcfs_ch = tool_vcfs
.map {
it.sort { a, b ->
def toolA = file(a).getName()
def toolB = file(b).getName()
return toolA.compareTo(toolB)
}
}
intersect_VCFs_BCFtools(
tool_vcfs,
vcfs_ch,
tool_indices,
params.intersect_regions,
params.intersect_regions_index
Expand All @@ -25,8 +33,16 @@ workflow intersect {
script_dir_ch,
intersect_VCFs_BCFtools.out.isec,
)
consensus_vcfs_ch = intersect_VCFs_BCFtools.out.consensus_vcf
.map {
it.sort { a, b ->
def toolA = file(a).getName()
def toolB = file(b).getName()
return toolA.compareTo(toolB)
}
}
concat_VCFs_BCFtools(
intersect_VCFs_BCFtools.out.consensus_vcf,
consensus_vcfs_ch,
intersect_VCFs_BCFtools.out.consensus_idx
)
compress_index_VCF(concat_VCFs_BCFtools.out.concat_vcf
Expand Down

0 comments on commit 8816004

Please sign in to comment.