Thomas 7 сар өмнө
parent
commit
8f2710b5ae

+ 4 - 3
src/commands/dorado.rs

@@ -279,7 +279,8 @@ impl Dorado {
 
         // Get the sequencing kit from the first pod5 file
         let muxed_pod_dir = &cases.first().unwrap().pod_dir;
-        let pod_path = fs::read_dir(muxed_pod_dir)?
+        let pod_path = fs::read_dir(muxed_pod_dir)
+            .map_err(|e| anyhow::anyhow!("Failed to read pod5 dir: {}.\n\t{e}", muxed_pod_dir.display()))?
             .filter_map(|p| p.ok())
             .map(|p| p.path())
             .filter(|p| p.extension().unwrap() == "pod5")
@@ -298,8 +299,8 @@ impl Dorado {
             format!("samtools view -h -@ {samtools_view_threads} -b -o {muxed_bam}");
         let pipe = format!("{dorado} | {samtools_view}");
         info!("Running: {pipe}");
-        let pipe_cmd = cmd!("bash", "-c", pipe);
-        pipe_cmd.run()?;
+        let pipe_cmd = cmd!("bash", "-c", &pipe);
+        pipe_cmd.run().map_err(|e| anyhow::anyhow!("Failed to run pipe: {pipe}.\n\t{}", e.to_string()))?;
 
         info!("Basecalling ✅");