# HG changeset patch # User peterjc # Date 1701337768 0 # Node ID 17caf7a7c2c595d0908fd91a8e8802e71776fb3f # Parent fcdf11fb34defb9a2d4ac302a62735eb874a695e Bump Biopython dependency diff -r fcdf11fb34de -r 17caf7a7c2c5 tools/seq_length/README.rst --- a/tools/seq_length/README.rst Thu May 17 08:13:25 2018 -0400 +++ b/tools/seq_length/README.rst Thu Nov 30 09:49:28 2023 +0000 @@ -1,7 +1,7 @@ Galaxy tool to rename FASTA, QUAL, FASTQ or SFF sequences ========================================================= -This tool is copyright 2011-2017 by Peter Cock, The James Hutton Institute +This tool is copyright 2011-2023 by Peter Cock, The James Hutton Institute (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. See the licence text below. @@ -67,6 +67,7 @@ - Fix requesting SFF format. v0.0.4 - Report mean, minimum and maximum sequence lengths (via stdout). - Option to compute median and N50 as well. +v0.0.5 - Bump dependency to current Biopython for Python 3 fixes. ======= ====================================================================== diff -r fcdf11fb34de -r 17caf7a7c2c5 tools/seq_length/seq_length.py --- a/tools/seq_length/seq_length.py Thu May 17 08:13:25 2018 -0400 +++ b/tools/seq_length/seq_length.py Thu Nov 30 09:49:28 2023 +0000 @@ -10,7 +10,7 @@ Cock et al 2009. Biopython: freely available Python tools for computational molecular biology and bioinformatics. Bioinformatics 25(11) 1422-3. -http://dx.doi.org/10.1093/bioinformatics/btp163 pmid:19304878. +https://doi.org/10.1093/bioinformatics/btp163 pmid:19304878. This script is copyright 2018 by Peter Cock, The James Hutton Institute UK. All rights reserved. See accompanying text file for licence details (MIT @@ -29,20 +29,45 @@ """ parser = OptionParser(usage=usage) -parser.add_option('-i', '--input', dest='input', - default=None, help='Input sequence filename (FASTA, FASTQ, etc)', - metavar="FILE") -parser.add_option('-f', '--format', dest='format', - default=None, help='Input sequence format (FASTA, QUAL, FASTQ, SFF)') -parser.add_option('-o', '--output', dest='output', - default=None, help='Output filename (tabular)', - metavar="FILE") -parser.add_option("-s", "--stats", dest="stats", - default=False, action="store_true", - help="Compute statistics (median, N50 - will require much more RAM).") -parser.add_option("-v", "--version", dest="version", - default=False, action="store_true", - help="Show version and quit") +parser.add_option( + "-i", + "--input", + dest="input", + default=None, + help="Input sequence filename (FASTA, FASTQ, etc)", + metavar="FILE", +) +parser.add_option( + "-f", + "--format", + dest="format", + default=None, + help="Input sequence format (FASTA, QUAL, FASTQ, SFF)", +) +parser.add_option( + "-o", + "--output", + dest="output", + default=None, + help="Output filename (tabular)", + metavar="FILE", +) +parser.add_option( + "-s", + "--stats", + dest="stats", + default=False, + action="store_true", + help="Compute statistics (median, N50 - will require much more RAM).", +) +parser.add_option( + "-v", + "--version", + dest="version", + default=False, + action="store_true", + help="Show version and quit", +) options, args = parser.parse_args() if options.version: @@ -125,11 +150,14 @@ if sys.version_info[0] >= 3: from statistics import median - for test in [{1: 4, 2: 3}, - {1: 4, 3: 6}, - {1: 4, 5: 4}, - {0: 5, 1: 1, 2: 1, 3: 5}, - {0: 5, 1: 1, 2: 1, 3: 1, 4: 5}]: + + for test in [ + {1: 4, 2: 3}, + {1: 4, 3: 6}, + {1: 4, 5: 4}, + {0: 5, 1: 1, 2: 1, 3: 5}, + {0: 5, 1: 1, 2: 1, 3: 1, 4: 5}, + ]: test_list = [] for v, c in test.items(): test_list.extend([v] * c) @@ -158,7 +186,7 @@ """ # Continuing the above example, input L would be {2:3, 3:2, 4:1, 8:2} # and L' becomes {2:6, 3:6, 4:4, 8:16}} as tally tables. - l_prime = dict((v, v * c) for v, c in counts_dict.items()) + l_prime = {v: v * c for v, c in counts_dict.items()} return median_from_counts_dict(l_prime) @@ -208,7 +236,9 @@ else: length_min = min(length_min, length) length_max = max(length_max, length) -print("%i sequences, total length %i, mean %0.1f" % (count, total, float(total) / count)) +print( + "%i sequences, total length %i, mean %0.1f" % (count, total, float(total) / count) +) if not count: pass elif not stats: diff -r fcdf11fb34de -r 17caf7a7c2c5 tools/seq_length/seq_length.xml --- a/tools/seq_length/seq_length.xml Thu May 17 08:13:25 2018 -0400 +++ b/tools/seq_length/seq_length.xml Thu Nov 30 09:49:28 2023 +0000 @@ -1,8 +1,7 @@ - + from FASTA, QUAL, FASTQ, or SFF file - - biopython + biopython python $__tool_directory__/seq_length.py --version @@ -75,7 +74,7 @@ Cock et al (2009). Biopython: freely available Python tools for computational molecular biology and bioinformatics. Bioinformatics 25(11) 1422-3. -http://dx.doi.org/10.1093/bioinformatics/btp163 pmid:19304878. +https://doi.org/10.1093/bioinformatics/btp163 pmid:19304878. This tool is available to install into other Galaxy Instances via the Galaxy Tool Shed at http://toolshed.g2.bx.psu.edu/view/peterjc/seq_length diff -r fcdf11fb34de -r 17caf7a7c2c5 tools/seq_length/tool_dependencies.xml --- a/tools/seq_length/tool_dependencies.xml Thu May 17 08:13:25 2018 -0400 +++ b/tools/seq_length/tool_dependencies.xml Thu Nov 30 09:49:28 2023 +0000 @@ -1,6 +1,6 @@ - + - + - + \ No newline at end of file