Hi everyone, I’m trying to develop a bespoke tool for extracting sequences using Nextflow. Currently, I have this workflow:
workflow {
// Define the input channels
assembly_ch = Channel.fromPath(params.assemblies)
.ifEmpty { error "Cannot find any assemblies matching: ${params.assemblies}" }
query_ch = Channel.value(params.query)
// Create BLAST database for each assembly
blastdb_ch = assembly_ch | createBlastDB
// Move BLAST databases to the final directory
blastdb_ch | moveBlastDB
// Combine BLAST databases and query for the search process
blast_results_ch = blastdb_ch.combine(query_ch) | runBlastSearch
// Split the tuple into unfiltered and filtered BLAST results
blast_results_unfiltered_ch = blast_results_ch.map { it[0] }
blast_results_filtered_ch = blast_results_ch.map { it[1] }
// Move unfiltered BLAST results to "02_blastoutput"
blast_results_unfiltered_ch | moveBlastOutput
// Move filtered BLAST results to "03_blastoutput_filtered"
blast_results_filtered_ch | moveFilteredBlastOutput
// Extract sequences based on the filtered BLAST results
blast_results_filtered_ch.map { filtered_out ->
def base_name = filtered_out.baseName.replace("_vs_", "_blastdb_")
def fasta_file = "blastdb/${base_name}/${base_name}.fasta"
return tuple(filtered_out, fasta_file)
} | extractSequences
But I always get an error that is: “Multi-channel output cannot be applied to operator combine for which argument is already provided”. I’ve tried many things to address this, but it seems that I’ve hit a well. Can anyone help?