Thomas vor 4 Jahren
Ursprung
Commit
15cf1e9e50
2 geänderte Dateien mit 9 neuen und 2 gelöschten Zeilen
  1. 5 1
      index.js
  2. 4 1
      index.ts

+ 5 - 1
index.js

@@ -75,7 +75,7 @@ const denovoAssemblage = (reads, rnames, spadesPath) => {
         const args = isPairedEnd ? ['-1', tmpSubReads[0], '-2', tmpSubReads[1]] : ['-s', tmpSubReads[0]];
         const rsltDir = path_1.default.join(os_1.default.tmpdir(), (+new Date) + '_spades');
         yield async_exec(spadesPath, ['-t', threads, '--isolate', correction, ...args, '-o', rsltDir], console.log, console.log);
-        if (!isDone(rsltDir)) {
+        if (!isDone(rsltDir) && isPairedEnd) {
             yield rmList([rsltDir]);
             console.log('Trying meta');
             yield async_exec(spadesPath, ['-t', threads, '--meta', correction, ...args, '-o', rsltDir], console.log, console.log);
@@ -84,6 +84,10 @@ const denovoAssemblage = (reads, rnames, spadesPath) => {
                 reject('No convergence');
             }
         }
+        else if (!isDone(rsltDir) && !isPairedEnd) {
+            yield rmList([rsltDir, ...tmpSubReads]);
+            reject('No convergence');
+        }
         yield rmList(tmpSubReads);
         resolve(rsltDir);
     }));

+ 4 - 1
index.ts

@@ -77,7 +77,7 @@ const denovoAssemblage = (
         
         await async_exec(spadesPath, ['-t', threads, '--isolate', correction, ...args, '-o', rsltDir], console.log, console.log)
 
-        if(!isDone(rsltDir)) {
+        if(!isDone(rsltDir) && isPairedEnd) {
             await rmList([rsltDir])
             console.log('Trying meta')
             await async_exec(spadesPath, ['-t', threads, '--meta', correction, ...args, '-o', rsltDir], console.log, console.log)
@@ -85,6 +85,9 @@ const denovoAssemblage = (
                 await rmList([rsltDir, ...tmpSubReads])
                 reject('No convergence')
             }
+        } else if (!isDone(rsltDir) && !isPairedEnd) {
+            await rmList([rsltDir, ...tmpSubReads])
+            reject('No convergence')
         }
 
         await rmList(tmpSubReads)