[med-svn] [Git][med-team/unicycler][master] 7 commits: New upstream version 0.5.1+dfsg

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Mon Nov 25 13:14:26 GMT 2024



Michael R. Crusoe pushed to branch master at Debian Med / unicycler


Commits:
0ab543f9 by Michael R. Crusoe at 2024-11-25T13:55:23+01:00
New upstream version 0.5.1+dfsg
- - - - -
bfe5efbb by Michael R. Crusoe at 2024-11-25T13:55:23+01:00
New upstream version

- - - - -
0dd5ec3d by Michael R. Crusoe at 2024-11-25T13:55:33+01:00
Update upstream source from tag 'upstream/0.5.1+dfsg'

Update to upstream version '0.5.1+dfsg'
with Debian dir d429a2f0a83344e61b9dacfe4a68f74af1b8a55d
- - - - -
b17afbcf by Michael R. Crusoe at 2024-11-25T13:55:33+01:00
Standards-Version: 4.7.0 (routine-update)

- - - - -
9e37a824 by Michael R. Crusoe at 2024-11-25T13:55:36+01:00
Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)

- - - - -
3233f1f9 by Michael R. Crusoe at 2024-11-25T14:14:09+01:00
Forwarded one patch upstream, marked the rest as not needing forwarding.

- - - - -
60d18f57 by Michael R. Crusoe at 2024-11-25T14:14:09+01:00
routine-update: Ready to upload to unstable

- - - - -


14 changed files:

- debian/changelog
- debian/control
- debian/patches/append_flags
- debian/patches/install_wo_extra_steps.patch
- debian/patches/spades.patch
- debian/rules
- test/test_assembly_graph_copy_depth.py
- test/test_misc.py
- test/test_spades_func.py
- unicycler/assembly_graph_copy_depth.py
- unicycler/misc.py
- unicycler/spades_func.py
- unicycler/unicycler.py
- unicycler/version.py


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+unicycler (0.5.1+dfsg-1) unstable; urgency=medium
+
+  * Team upload.
+  * New upstream version
+  * Standards-Version: 4.7.0 (routine-update)
+  * Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
+  * Forwarded one patch upstream, marked the rest as not needing forwarding.
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Mon, 25 Nov 2024 13:55:49 +0100
+
 unicycler (0.5.0+dfsg-1) unstable; urgency=medium
 
   [ Nilesh Patra ]


=====================================
debian/control
=====================================
@@ -5,7 +5,7 @@ Uploaders: Andreas Tille <tille at debian.org>,
 Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
-               dh-python,
+               dh-sequence-python3,
                python3-all,
                python3-setuptools,
                default-jdk <!nocheck>,
@@ -19,7 +19,7 @@ Build-Depends: debhelper-compat (= 13),
                spades (>= 3.14),
                libseqan2-dev,
                zlib1g-dev
-Standards-Version: 4.6.1
+Standards-Version: 4.7.0
 Vcs-Browser: https://salsa.debian.org/med-team/unicycler
 Vcs-Git: https://salsa.debian.org/med-team/unicycler.git
 Homepage: https://github.com/rrwick/Unicycler


=====================================
debian/patches/append_flags
=====================================
@@ -1,5 +1,6 @@
 From: Michael R. Crusoe <michael.crusoe at gmail.com>
 Subject: Inherit and use LDFLAGS and CPPFLAGS
+Forwarded: https://github.com/rrwick/Unicycler/pull/343
 --- a/Makefile
 +++ b/Makefile
 @@ -68,7 +68,7 @@ CXXFLAGS    ?= -Wall -Wextra -pedantic -


=====================================
debian/patches/install_wo_extra_steps.patch
=====================================
@@ -1,8 +1,7 @@
 Author: Liubov Chuprikova <chuprikovalv at gmail.com>
 Last-Update: Fri, 7 September 2018 18:46:31 +0200
-Description: Skip extra steps (make distclean and make) while installing as
-they were done earlier
-
+Description: Skip extra steps (make distclean and make) while installing as they were done earlier
+Forwarded: not-needed
 
 --- a/setup.py
 +++ b/setup.py


=====================================
debian/patches/spades.patch
=====================================
@@ -1,7 +1,7 @@
 Author: Andreas Tille <tille at debian.org>
 Last-Update: Fri, 25 May 2018 10:59:36 +0200
 Description: SPAdes is in Debian at /usr/bin/spades
-
+Forwarded: not-needed
 --- a/test/test_dependencies.py
 +++ b/test/test_dependencies.py
 @@ -42,7 +42,7 @@ class TestDependencies(unittest.TestCase


=====================================
debian/rules
=====================================
@@ -20,7 +20,7 @@ export PYBUILD_AFTER_TEST=rm {build_dir}/unicycler-runner.py; \
 export TERM=linux
 
 %:
-	dh $@ --with python3 --buildsystem=pybuild
+	dh $@ --buildsystem=pybuild
 
 override_dh_auto_clean:
 	find . -name __pycache__ -type d | xargs rm -rf


=====================================
test/test_assembly_graph_copy_depth.py
=====================================
@@ -48,7 +48,6 @@ class TestCopyDepth(unittest.TestCase):
         """
         Tests a particular part of the graph with merging and splitting.
         """
-        print(self.graph.copy_depths)
         self.assertEqual(len(self.graph.copy_depths[67]), 1)
         self.assertEqual(len(self.graph.copy_depths[165]), 1)
         self.assertEqual(len(self.graph.copy_depths[174]), 1)


=====================================
test/test_misc.py
=====================================
@@ -381,4 +381,7 @@ class TestMiscFunctions(unittest.TestCase):
         self.assertEqual(unicycler.misc.spades_status_from_version('3.15.3'), 'good')
 
     def test_spades_version_status_13(self):
-        self.assertEqual(unicycler.misc.spades_status_from_version('4.0.0'), 'too new')
+        self.assertEqual(unicycler.misc.spades_status_from_version('4.0.0'), 'good')
+
+    def test_spades_version_status_14(self):
+        self.assertEqual(unicycler.misc.spades_status_from_version('5.0.0'), 'too new')


=====================================
test/test_spades_func.py
=====================================
@@ -49,43 +49,50 @@ class TestSPAdesFunc(unittest.TestCase):
     def test_build_spades_command_1(self):
         command = unicycler.spades_func.build_spades_command('spades.py', 'out', 16, [21, 31, 41],
                                                              0, '1.fq.gz', '2.fq.gz', None, True,
-                                                             False, None)
+                                                             False, None, '3.15.5')
         self.assertEqual(command, ['spades.py', '-o', 'out', '-k', '21', '--threads', '16',
                                    '--isolate', '-1', '1.fq.gz', '-2', '2.fq.gz', '-m', '1024'])
 
     def test_build_spades_command_2(self):
         command = unicycler.spades_func.build_spades_command('spades.py', 'out', 16, [21, 31, 41],
                                                              1, '1.fq.gz', '2.fq.gz', None, True,
-                                                             False, None)
+                                                             False, None, '3.15.5')
         self.assertEqual(command, ['spades.py', '-o', 'out', '-k', '21,31', '--threads', '16',
                                    '--restart-from', 'k21', '-m', '1024'])
 
     def test_build_spades_command_3(self):
         command = unicycler.spades_func.build_spades_command('spades.py', 'out', 16, [21, 31, 41],
                                                              2, '1.fq.gz', '2.fq.gz', None, True,
-                                                             False, None)
+                                                             False, None, '3.15.5')
         self.assertEqual(command, ['spades.py', '-o', 'out', '-k', '21,31,41', '--threads', '16',
                                    '--restart-from', 'k31', '-m', '1024'])
 
     def test_build_spades_command_4(self):
         command = unicycler.spades_func.build_spades_command('spades.py', 'out', 16, [21, 31, 41],
                                                              0, None, None, 's.fq.gz', False, True,
-                                                             None)
+                                                             None, '3.15.5')
         self.assertEqual(command, ['spades.py', '-o', 'out', '-k', '21', '--threads', '16',
                                    '--isolate', '-s', 's.fq.gz', '-m', '1024'])
 
     def test_build_spades_command_5(self):
         command = unicycler.spades_func.build_spades_command('spades.py', 'out', 16, [21, 31, 41],
                                                              0, '1.fq.gz', '2.fq.gz', None, True,
-                                                             False, '-m 123')
+                                                             False, '-m 123', '3.15.5')
         self.assertEqual(command, ['spades.py', '-o', 'out', '-k', '21', '--threads', '16',
                                    '--isolate', '-1', '1.fq.gz', '-2', '2.fq.gz', '-m', '123'])
 
     def test_build_spades_command_6(self):
         command = unicycler.spades_func.build_spades_command('spades.py', 'out', 16, [21, 31, 41],
                                                              0, '1.fq.gz', '2.fq.gz', None, True,
-                                                             False, '--tmp-dir abc')
+                                                             False, '--tmp-dir abc', '3.15.5')
         self.assertEqual(command, ['spades.py', '-o', 'out', '-k', '21', '--threads', '16',
                                    '--isolate', '-1', '1.fq.gz', '-2', '2.fq.gz', '--tmp-dir',
                                    'abc', '-m', '1024'])
 
+    def test_build_spades_command_7(self):
+        command = unicycler.spades_func.build_spades_command('spades.py', 'out', 16, [21, 31, 41],
+                                                             0, '1.fq.gz', '2.fq.gz', None, True,
+                                                             False, None, '4.0.0')
+        self.assertEqual(command, ['spades.py', '-o', 'out', '-k', '21', '--threads', '16',
+                                   '--gfa11', '--isolate', '-1', '1.fq.gz', '-2', '2.fq.gz',
+                                   '-m', '1024'])


=====================================
unicycler/assembly_graph_copy_depth.py
=====================================
@@ -101,7 +101,10 @@ def determine_copy_depth_part_2(graph, tolerance, copy_depth_table):
     if log.logger.stdout_verbosity_level >= 3:
         copy_depth_table.append(['SPLITTING MULTIPLICITY', '', ''])
     if redistribute_copy_depths(graph, tolerance, copy_depth_table):
-        determine_copy_depth_part_2(graph, tolerance, copy_depth_table)
+        try:
+            determine_copy_depth_part_2(graph, tolerance, copy_depth_table)
+        except RecursionError:
+            pass
 
 
 def assign_single_copy_depth(graph, min_single_copy_length, copy_depth_table):


=====================================
unicycler/misc.py
=====================================
@@ -638,7 +638,7 @@ def print_table(table, alignments='', max_col_width=30, col_separation=3, indent
             for text, colour_name in sub_colour.items():
                 row_str = row_str.replace(text, colour(text, colour_name))
             if j < row_rows - 1 and UNDERLINE in row_str:
-                row_str = re.sub('\033\[4m', '', row_str)
+                row_str = re.sub('\033\\[4m', '', row_str)
             if return_str:
                 full_table_str += indenter + row_str + '\n'
             else:
@@ -740,8 +740,8 @@ def remove_formatting(text):
 
 def get_ascii_art():
     ascii_art = (bold_red("       __\n") +
-                 bold_red("       \ \___\n") +
-                 bold_red("        \ ___\\\n") +
+                 bold_red("       \\ \\___\n") +
+                 bold_red("        \\ ___\\\n") +
                  bold_red("        //\n") +
                  bold_red("   ____//      ") +
                  bold_yellow("_    _         _                     _\n") +
@@ -750,11 +750,11 @@ def get_ascii_art():
                  bold_red("//  \\//  \\\\   ") +
                  bold_yellow("| |  | | _ __   _   ___  _   _   ___ | |  ___  _ __\n") +
                  bold_red("||  (O)  ||   ") +
-                 bold_yellow("| |  | || '_ \ | | / __|| | | | / __|| | / _ \| '__|\n") +
-                 bold_red("\\\\    \_ //   ") +
+                 bold_yellow("| |  | || '_ \\ | | / __|| | | | / __|| | / _ \\| '__|\n") +
+                 bold_red("\\\\    \\_ //   ") +
                  bold_yellow("| |__| || | | || || (__ | |_| || (__ | ||  __/| |\n") +
                  bold_red(" \\\\_____//     ") +
-                 bold_yellow("\____/ |_| |_||_| \___| \__, | \___||_| \___||_|\n") +
+                 bold_yellow("\\____/ |_| |_||_| \\___| \\__, | \\___||_| \\___||_|\n") +
                  bold_yellow("                                        __/ |\n") +
                  bold_yellow("                                       |___/"))
     return ascii_art
@@ -812,7 +812,7 @@ def spades_path_and_version(spades_path):
     if 'python version' in out and 'is not supported' in out:
         return found_spades_path, '', 'Python problem'
 
-    # Make sure SPAdes is 3.13.1 or later
+    # Make sure SPAdes is 3.14.0 or later
     try:
         status = spades_status_from_version(version)
     except (ValueError, IndexError):
@@ -844,15 +844,15 @@ def spades_status_from_version(version):
     major_version = int(version.split('.')[0])
     if major_version < 3:
         return 'too old'
-    if major_version >= 4:
+    if major_version >= 5:
         return 'too new'
-    assert major_version == 3
+    assert major_version == 3 or major_version == 4
 
-    minor_version = int(version.split('.')[1])
-    if minor_version < 14:
-        return 'too old'
-    else:
-        return 'good'
+    if major_version == 3:
+        minor_version = int(version.split('.')[1])
+        if minor_version < 14:
+            return 'too old'
+    return 'good'
 
 
 def racon_path_and_version(racon_path):


=====================================
unicycler/spades_func.py
=====================================
@@ -32,7 +32,7 @@ class BadFastq(Exception):
 def get_best_spades_graph(short1, short2, short_unpaired, out_dir, read_depth_filter, verbosity,
                           spades_path, threads, keep, kmer_count, min_k_frac, max_k_frac, kmers,
                           expected_linear_seqs, largest_component, spades_graph_prefix,
-                          spades_options):
+                          spades_options, spades_version):
     """
     This function tries a SPAdes assembly at different k-mers and returns the best one.
     """
@@ -62,7 +62,7 @@ def get_best_spades_graph(short1, short2, short_unpaired, out_dir, read_depth_fi
 
     graph_files, insert_size_mean, insert_size_deviation = \
         run_spades_all_kmers(reads, spades_dir, kmer_range, threads, spades_path,
-                             spades_graph_prefix, spades_options)
+                             spades_graph_prefix, spades_options, spades_version)
 
     existing_graph_files = [x for x in graph_files if x is not None]
     if not existing_graph_files:
@@ -162,7 +162,7 @@ def get_best_spades_graph(short1, short2, short_unpaired, out_dir, read_depth_fi
 
 
 def run_spades_all_kmers(read_files, spades_dir, kmers, threads, spades_path, spades_graph_prefix,
-                         spades_options):
+                         spades_options, spades_version):
     """
     SPAdes is run with all k-mers up to the top one. For example:
       * round 1: 25
@@ -183,7 +183,7 @@ def run_spades_all_kmers(read_files, spades_dir, kmers, threads, spades_path, sp
         biggest_kmer = kmers[i]
         command = build_spades_command(spades_path, spades_dir, threads, kmers, i, short1, short2,
                                        unpaired, using_paired_reads, using_unpaired_reads,
-                                       spades_options)
+                                       spades_options, spades_version)
         log.log(' '.join(command))
         graph_file, insert_size_mean, insert_size_deviation = \
             run_spades_one_kmer(command, spades_dir, biggest_kmer)
@@ -218,10 +218,12 @@ def run_spades_all_kmers(read_files, spades_dir, kmers, threads, spades_path, sp
 
 
 def build_spades_command(spades_path, spades_dir, threads, kmers, i, short1, short2, unpaired,
-                         using_paired_reads, using_unpaired_reads, spades_options):
+                         using_paired_reads, using_unpaired_reads, spades_options, spades_version):
     kmer_string = ','.join([str(x) for x in kmers[:i+1]])
 
     command = [spades_path, '-o', spades_dir, '-k', kmer_string, '--threads', str(threads)]
+    if spades_version.startswith("4."):
+        command += ['--gfa11']
     if i == 0:  # first k-mer
         command += ['--isolate']
         if using_paired_reads:


=====================================
unicycler/unicycler.py
=====================================
@@ -59,7 +59,7 @@ def main():
 
     check_input_files(args)
     print_intro_message(args, full_command, out_dir_message)
-    check_dependencies(args, short_reads_available, long_reads_available)
+    spades_version = check_dependencies(args, short_reads_available, long_reads_available)
 
     counter = itertools.count(start=1)  # Files are numbered in chronological order.
     bridges = []
@@ -78,7 +78,7 @@ def main():
                                           args.spades_path, args.threads, args.keep,
                                           args.kmer_count, args.min_kmer_frac, args.max_kmer_frac,
                                           args.kmers, args.linear_seqs, args.largest_component,
-                                          spades_graph_prefix, args.spades_options)
+                                          spades_graph_prefix, args.spades_options, spades_version)
         determine_copy_depth(graph)
         if args.keep > 0 and not os.path.isfile(best_spades_graph):
             graph.save_to_gfa(best_spades_graph, save_copy_depth_info=True, newline=True,
@@ -715,6 +715,7 @@ def check_dependencies(args, short_reads_available, long_reads_available):
 
     quit_if_dependency_problem(spades_status, racon_status, makeblastdb_status, tblastn_status,
                                args)
+    return spades_version
 
 
 def quit_if_dependency_problem(spades_status, racon_status, makeblastdb_status, tblastn_status,
@@ -727,7 +728,7 @@ def quit_if_dependency_problem(spades_status, racon_status, makeblastdb_status,
     if spades_status == 'not found':
         quit_with_error('could not find SPAdes at ' + args.spades_path)
     if spades_status == 'too old' or spades_status == 'too new':
-        quit_with_error('Unicycler requires SPAdes v3.13.1 or later')
+        quit_with_error('Unicycler requires SPAdes v3.14.0 or later')
     if spades_status == 'Python problem':
         quit_with_error('SPAdes cannot run due to an incompatible Python version')
     if spades_status == 'bad':


=====================================
unicycler/version.py
=====================================
@@ -13,4 +13,4 @@ details. You should have received a copy of the GNU General Public License along
 not, see <http://www.gnu.org/licenses/>.
 """
 
-__version__ = '0.5.0'
+__version__ = '0.5.1'



View it on GitLab: https://salsa.debian.org/med-team/unicycler/-/compare/62572edf5e3c0fbfc06323616763f4b73900be6f...60d18f57f74f31233c8531408b0b2d9cd84aef7e

-- 
View it on GitLab: https://salsa.debian.org/med-team/unicycler/-/compare/62572edf5e3c0fbfc06323616763f4b73900be6f...60d18f57f74f31233c8531408b0b2d9cd84aef7e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20241125/1285bfe7/attachment-0001.htm>


More information about the debian-med-commit mailing list