@@ -30,47 +30,47 @@ workflow CHRCHECK {
30
30
}
31
31
32
32
// Check if channel is empty
33
- ch_vcf_branched = Channel . empty()
33
+ ch_vcf_split = Channel . empty()
34
34
// Extract the contig names from the VCF files
35
35
VCF_CHR_EXTRACT (ch_input. vcf. map{ meta , file , _index , _chr -> [meta, file] })
36
36
ch_versions = ch_versions. mix(VCF_CHR_EXTRACT . out. versions)
37
- ch_vcf_branched = checkChr(VCF_CHR_EXTRACT . out. chr, ch_input. vcf)
37
+ ch_vcf_split = checkChr(VCF_CHR_EXTRACT . out. chr, ch_input. vcf)
38
38
39
- ch_bam_branched = Channel . empty()
39
+ ch_bam_split = Channel . empty()
40
40
// Extract the contig names from the BAM files
41
41
BAM_CHR_EXTRACT (ch_input. bam. map{ meta , file , _index , _chr -> [meta, file] })
42
42
ch_versions = ch_versions. mix(BAM_CHR_EXTRACT . out. versions)
43
- ch_bam_branched = checkChr(BAM_CHR_EXTRACT . out. chr, ch_input. bam)
43
+ ch_bam_split = checkChr(BAM_CHR_EXTRACT . out. chr, ch_input. bam)
44
44
45
45
if (params. rename_chr == true ) {
46
46
ch_bam_renamed = Channel . empty()
47
47
// Rename the contigs in the BAM files
48
48
BAM_CHR_RENAME_SAMTOOLS (
49
- ch_bam_branched . to_rename. map{meta , bam , csi , _diff , prefix -> [meta, bam, csi, prefix]}
49
+ ch_bam_split . to_rename. map{meta , bam , csi , _diff , prefix -> [meta, bam, csi, prefix]}
50
50
)
51
51
ch_versions = ch_versions. mix(BAM_CHR_RENAME_SAMTOOLS . out. versions)
52
52
ch_bam_renamed = BAM_CHR_RENAME_SAMTOOLS . out. bam_renamed
53
53
54
54
ch_vcf_renamed = Channel . empty()
55
55
// Rename the contigs in the VCF files
56
- VCF_CHR_RENAME_BCFTOOLS (ch_vcf_branched . to_rename)
56
+ VCF_CHR_RENAME_BCFTOOLS (ch_vcf_split . to_rename)
57
57
ch_versions = ch_versions. mix(VCF_CHR_RENAME_BCFTOOLS . out. versions)
58
58
ch_vcf_renamed = VCF_CHR_RENAME_BCFTOOLS . out. vcf_renamed
59
59
} else {
60
- ch_vcf_branched . to_rename. map {
60
+ ch_vcf_split . to_rename. map {
61
61
def chr_names = it[3 ]. size() > params. max_chr_names ? it[3 ][0 .. params. max_chr_names - 1 ] + [' ...' ] : it[3 ]
62
62
error " Contig names: ${ chr_names} in VCF: ${ it[1]} are not present in reference genome with same writing. Please set `rename_chr` to `true` to rename the contigs."
63
63
}
64
- ch_bam_branched . to_rename. map {
64
+ ch_bam_split . to_rename. map {
65
65
def chr_names = it[3 ]. size() > params. max_chr_names ? it[3 ][0 .. params. max_chr_names - 1 ] + [' ...' ] : it[3 ]
66
66
error " Contig names: ${ chr_names} in BAM: ${ it[1]} are not present in reference genome with same writing. Please set `rename_chr` to `true` to rename the contigs."
67
67
}
68
68
ch_vcf_renamed = Channel . empty()
69
69
ch_bam_renamed = Channel . empty()
70
70
}
71
71
72
- ch_output = ch_bam_branched . no_rename
73
- .mix(ch_vcf_branched . no_rename)
72
+ ch_output = ch_bam_split . no_rename
73
+ .mix(ch_vcf_split . no_rename)
74
74
.mix(ch_bam_renamed)
75
75
.mix(ch_vcf_renamed)
76
76
emit :
0 commit comments