Repository 'biopython_convert'
hg clone https://toolshed.g2.bx.psu.edu/repos/brinkmanlab/biopython_convert

Changeset 4:a5cb5e374399 (2021-02-04)
Previous changeset 3:d9ae46bb9f09 (2020-11-10) Next changeset 5:1c71c770bfd4 (2022-07-27)
Commit message:
"planemo upload for repository https://github.com/brinkmanlab/galaxy-tools/tree/master/biopython-convert commit afc9f4ade42686dcf53a2615d90e1e9962cf1561"
modified:
bioperl_compat.py
b
diff -r d9ae46bb9f09 -r a5cb5e374399 bioperl_compat.py
--- a/bioperl_compat.py Tue Nov 10 21:14:06 2020 +0000
+++ b/bioperl_compat.py Thu Feb 04 01:30:20 2021 +0000
[
@@ -1,11 +1,25 @@
 #!/usr/bin/env python
 import sys
 from biopython_convert import get_args, convert
-from Bio.SeqIO.InsdcIO import _InsdcWriter
+from Bio.SeqIO.InsdcIO import _InsdcWriter, EmblWriter
+import Bio
 
 # Quote anticodon qualifiers
 _InsdcWriter.FTQUAL_NO_QUOTE = tuple(v for v in _InsdcWriter.FTQUAL_NO_QUOTE if v not in ['anticodon', 'transl_except'])
 
+if Bio.__version__ == "1.78":
+    # TODO monkeypatch until https://github.com/biopython/biopython/pull/3476
+    _write_the_first_lines_orig = EmblWriter._write_the_first_lines
+
+    def _write_the_first_lines(self, record):
+        orig_type = record.annotations.get("molecule_type")
+        record.annotations["molecule_type"] = orig_type.upper()
+        ret = _write_the_first_lines_orig(self, record)
+        record.annotations["molecule_type"] = orig_type
+        return ret
+
+    EmblWriter._write_the_first_lines = _write_the_first_lines
+
 if __name__ == '__main__':
     convert(*get_args(sys.argv[1:]))