changeset 3:4b5cfe8c2be1 draft

planemo upload for repository https://github.com/peterjc/galaxy_blast/tree/master/tools/make_nr commit 960f4708be7cdd486e4569e7b44eb856b2cad79d-dirty
author peterjc
date Fri, 22 Feb 2019 09:57:17 -0500
parents 398679d5f75d
children 4e8ccac06848
files tools/make_nr/make_nr.py tools/make_nr/tool_dependencies.xml
diffstat 2 files changed, 34 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/tools/make_nr/make_nr.py	Fri Nov 09 10:57:18 2018 -0500
+++ b/tools/make_nr/make_nr.py	Fri Feb 22 09:57:17 2019 -0500
@@ -45,17 +45,30 @@
 """
 
 parser = OptionParser(usage=usage)
-parser.add_option("-s", "--sep", dest="sep",
-                  default=";",
-                  help="Separator character for combining identifiers "
-                  "of duplicated records e.g. '|' or ';' (required)")
-parser.add_option("-a", "--alphasort", action="store_true",
-                  help="When merging duplicated records sort their "
-                  "identifiers alphabetically before combining them. "
-                  "Default is input file order.")
-parser.add_option("-o", "--output", dest="output",
-                  default="/dev/stdout", metavar="FILE",
-                  help="Output filename (defaults to stdout)")
+parser.add_option(
+    "-s",
+    "--sep",
+    dest="sep",
+    default=";",
+    help="Separator character for combining identifiers "
+    "of duplicated records e.g. '|' or ';' (required)",
+)
+parser.add_option(
+    "-a",
+    "--alphasort",
+    action="store_true",
+    help="When merging duplicated records sort their "
+    "identifiers alphabetically before combining them. "
+    "Default is input file order.",
+)
+parser.add_option(
+    "-o",
+    "--output",
+    dest="output",
+    default="/dev/stdout",
+    metavar="FILE",
+    help="Output filename (defaults to stdout)",
+)
 options, args = parser.parse_args()
 
 if not args:
@@ -66,7 +79,7 @@
     """Open a possibly gzipped text file."""
     with open(filename, "rb") as h:
         magic = h.read(2)
-    if magic == b'\x1f\x8b':
+    if magic == b"\x1f\x8b":
         return gzip.open(filename, "rt")
     else:
         return open(filename)
@@ -121,13 +134,14 @@
                             continue
                         # TODO - line wrapping
                         handle.write(">%s\n%s\n" % (title, seq))
-        sys.stderr.write("%i unique entries; removed %i duplicates "
-                         "leaving %i representative records\n"
-                         % (unique, len(duplicates), len(representatives)))
+        sys.stderr.write(
+            "%i unique entries; removed %i duplicates "
+            "leaving %i representative records\n"
+            % (unique, len(duplicates), len(representatives))
+        )
     else:
         os.symlink(os.path.abspath(input_fasta), output_fasta)
-        sys.stderr.write("No perfect duplicates in file, %i unique entries\n"
-                         % unique)
+        sys.stderr.write("No perfect duplicates in file, %i unique entries\n" % unique)
 
 
 make_nr(args, options.output, options.sep, options.alphasort)
--- a/tools/make_nr/tool_dependencies.xml	Fri Nov 09 10:57:18 2018 -0500
+++ b/tools/make_nr/tool_dependencies.xml	Fri Feb 22 09:57:17 2019 -0500
@@ -1,6 +1,6 @@
-<?xml version="1.0"?>
+<?xml version="1.0" ?>
 <tool_dependency>
     <package name="biopython" version="1.67">
-        <repository changeset_revision="fc45a61abc2f" name="package_biopython_1_67" owner="biopython" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+        <repository changeset_revision="fc45a61abc2f" name="package_biopython_1_67" owner="biopython" toolshed="https://testtoolshed.g2.bx.psu.edu"/>
     </package>
-</tool_dependency>
+</tool_dependency>
\ No newline at end of file