Louis Le Nézet
10/23/2024, 10:49 AMpath("*.{vcf,vcf.gz,bcf,bcf.gz}") + def extension + set vcf.gz as default
• Input fasta and fai as tuple tuple val(meta2), path(fasta), path(fai)
• Rename input to tuple val(meta), path(input), path(index)
• Export index tbi and csi as separated channels
• Update stub
• Check for name input / output collision
• Align + lint
Here are some questions:
• Should I add a index creation step before calling the tools
def index_names = index.findAll { file -> !(file instanceof List) }.collect { file -> file.name }
def create_input_index = input.collect { vcf -> index_names.contains(vcf.name + ".(tbi|csi)") ? "" : "tabix ${vcf}" }.join("\n ")
• The output vcf channel is written differently, which one is better ?
Personnaly I prefer 2 as it is more explicit
tuple val(meta), path("*.${extension}"), emit: vcf // 1
tuple val(meta), path("${prefix}.${extension}"), emit: vcf // 2
tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf // 3
• Should the optionality of an output be a closure
tuple val(meta), path("*.tbi") , emit: tbi, optional: {index_extension == "tbi"}Louis Le Nézet
10/23/2024, 10:51 AMBCFTOOLS_CSQ also set the extension through a function as follow:
String getVcfExtension(String args) {
return args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" :
args.contains("--output-type u") || args.contains("-Ou") ? "bcf" :
args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" :
args.contains("--output-type v") || args.contains("-Ov") ? "vcf" :
"vcf.gz";
}
I really like it, should I implement it for all ?
We could also do the same for the index detection.Matthias De Smet
10/23/2024, 10:56 AMLouis Le Nézet
10/23/2024, 11:03 AMBCFTOOLS_VIEW we would have 4 different channels vcf , vcf.gz , bcf , bcf.gz that would need to be .mix() afterwards ?
I would argue on my side that those 4 files contain the same information (therefore same type?) and only one of them can be created at once...Matthias De Smet
10/23/2024, 11:06 AMview can only output one type at the time, and it’s up to the pipeline dev to set this in the config. Afterwards only the desired channel should be used.Matthias De Smet
10/23/2024, 11:06 AMMatthias De Smet
10/23/2024, 11:07 AMMatthias De Smet
10/23/2024, 11:08 AMvcf output, since we have https://nf-co.re/docs/guidelines/components/modules#compression-of-input-and-output-filesLouis Le Nézet
10/23/2024, 11:08 AMLouis Le Nézet
10/23/2024, 11:09 AMAlso, I would opt to skip the plainShould we trigger a warning in this case ?output, since we havevcf
Matthias De Smet
10/23/2024, 11:09 AMMatthias De Smet
10/23/2024, 11:10 AMShould we trigger a warning in this case ?Possibly 🤷🏻
Matthias De Smet
10/23/2024, 11:11 AMLouis Le Nézet
10/23/2024, 11:11 AMMatthias De Smet
10/23/2024, 11:12 AMMatthias De Smet
10/23/2024, 11:13 AMMatthias De Smet
10/23/2024, 11:25 AMLouis Le Nézet
10/23/2024, 11:28 AM