nanoporetech / pomoxis

Analysis components from Oxford Nanopore Research
Other
92 stars 23 forks source link

long_fastx does not generate the other_*.fa file #47

Closed emiracherif closed 2 years ago

emiracherif commented 3 years ago

Hello, I'm using mini_assemble and I have an error message after the [racon::Polisher::polish] generating consensus step : "cat: other_KC_b01_draft_assm_trimmed.fa: No such file or directory"

Even if the long_fastx prog is launched :

The other_*.fa file is not generated.

I've looked into the different scripts and I can't find the issue! So any insights on how to resolve this would be more than welcome.

Thanks Emira PS: Here is the mini_assemble cmd: mini_assemble -i KC_b01_sup2kb.fastq -o KC_b01_draft -p KC_b01_draft_assm -t 22 -c -e 0.1 -x

ftostevin-ont commented 2 years ago

Thanks for the report, we have confirmed the bug. Until there is a new release available, the following patch should fix the issue:

diff --git a/pomoxis/util.py b/pomoxis/util.py
index 0b75b51..42a8e8f 100644
--- a/pomoxis/util.py
+++ b/pomoxis/util.py
@@ -211,6 +211,18 @@ def extract_long_reads():
             rec = record_dict[ids[i]]
             out.write(name, *rec)

+    if args.others is not None:
+        if args.bases is None:
+            others = np.argpartition(lengths, -max_reads)[:-max_reads]
+        else:
+            others = order[last:]
+
+        with FastxWrite(args.others, 'w') as out:
+            for i in others:
+                name = ids[i]
+                rec = record_dict[ids[i]]
+                out.write(name, *rec)
+
ftostevin-ont commented 2 years ago

This should be fixed in v0.3.9

emiracherif commented 2 years ago

Great thanks! I'll test it.