changeset 2:c8bda09480ae draft

"planemo upload for repository https://github.com/brinkmanlab/galaxy-tools/tree/master/make_unique_id commit 2e161ea2e4ddf5692f32ee389de42dc7c4fd5fa3"
author brinkmanlab
date Mon, 15 Jun 2020 19:04:53 -0400
parents 061c3402a977
children a2258ce2d58c
files make_unique_id.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/make_unique_id.py	Mon Jun 15 18:48:27 2020 -0400
+++ b/make_unique_id.py	Mon Jun 15 19:04:53 2020 -0400
@@ -29,14 +29,14 @@
     ids = defaultdict(int)
     
     def makeUnique(seq):
-        newid = seq.id[:28] # Genbank has a max length for the id and sequence length number, truncate the sequence id if too long
+        newid = seq.id[:16]  # Genbank has a max length for the id and sequence length number, truncate the sequence id if too long
         count = ids[newid]
         ids[newid] += 1
         if count:
             suffix = "_" + str(count)
             seqlenlen = len(str(len(seq)))
-            if len(newid) + len(suffix) + 1 + seqlenlen > 28:
-               newid = newid[:27 - seqlenlen - len(suffix)]
+            if len(newid) + len(suffix) + 1 + seqlenlen > 16:
+               newid = newid[:16 - seqlenlen - len(suffix)]
 
             newid += suffix
             seq.name += suffix
@@ -47,7 +47,6 @@
         seq.id = newid
         return seq
 
-
     paths = iter(sys.argv[2:])
 
     for input, output in zip(paths, paths):
@@ -57,4 +56,3 @@
             format
         )
 
-