diff CSP2/subworkflows/fetchData/main.nf @ 27:792274118b2e

"planemo upload"
author rliterman
date Wed, 04 Dec 2024 12:50:59 -0500
parents 5c609acba34e
children 893a6993efe3
line wrap: on
line diff
--- a/CSP2/subworkflows/fetchData/main.nf	Tue Dec 03 16:35:35 2024 -0500
+++ b/CSP2/subworkflows/fetchData/main.nf	Wed Dec 04 12:50:59 2024 -0500
@@ -21,8 +21,6 @@
 
 // Set SKESA cores to 4 or fewer
 skesa_cpus = (params.cores as Integer) >= 4 ? 4 : params.cores as Integer
-println "params.cores: ${params.cores}"
-println "skesa_cpus: ${skesa_cpus}"
 
 workflow {
     main:
@@ -274,12 +272,16 @@
         } else{
             error "$fasta_dir is not a valid directory or file..."
         }
+
         fasta_data = ch_fasta
-        .filter { file(it).exists() }
+        .map { filePath ->
+            if (!file(filePath).exists()) { error "$filePath is not a valid directory or file..." }
+            return filePath }
         .map { filePath ->
             def fileName = file(filePath).getBaseName()
             def sampleName = fileName.replaceAll(trim_this, "")
-            tuple(sampleName, filePath)}
+            tuple(sampleName, filePath)
+        }
     }
 }
 workflow processSNPDiffs{
@@ -315,8 +317,10 @@
         }
 
         snpdiffs_data = ch_snpdiffs
-            .filter { file(it).exists() }
-            .collect() | getSNPDiffsData | splitCsv | collect | flatten | collate(19)
+        .map { filePath ->
+            if (!file(filePath).exists()) { error "$filePath is not a valid directory or file..." }
+            return filePath }
+        .collect() | getSNPDiffsData | splitCsv | collect | flatten | collate(19)
 
         // (1) SNPDiffs_File, (2) Query_ID, (3) Query_Assembly, (4) Query_Contig_Count, (5) Query_Assembly_Bases, 
         // (6) Query_N50, (7) Query_N90, (8) Query_L50, (9) Query_L90, (10) Query_SHA256,
@@ -495,10 +499,8 @@
     assembled_data = assembly_output.map{it->tuple(it[0],it[3])}
 }
 process skesaAssemble{
-    // label 'skesaMem'
-
-    cpus = skesa_cpus
-    
+    //label 'skesaMem'
+  
     input:
     tuple val(sample_name),val(read_type),val(read_location)