diff iedb_api.py @ 4:7ed6dda64a81 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/iedb_api commit 6aeacd9ee8abb962fd7037cc374598caa87e63b3"
author iuc
date Sat, 13 Feb 2021 00:06:36 +0000
parents e95d3221b7f0
children
line wrap: on
line diff
--- a/iedb_api.py	Fri Sep 11 21:02:34 2020 +0000
+++ b/iedb_api.py	Sat Feb 13 00:06:36 2021 +0000
@@ -73,8 +73,21 @@
     if length is not None:
         if prediction == 'bcell':
             params['window_size'] = str(length).encode()
+        elif length == 'asis':
+            params['length'] = str(length).encode()
         else:
-            params['length'] = str(length).encode()
+            slen = len(seq)
+            alleles = []
+            lengths = []
+            for i in zip(length.split(','), allele.split(',')):
+                if int(i[0]) <= slen:
+                    lengths.append(i[0])
+                    alleles.append(i[1])
+            if lengths:
+                params['length'] = str(','.join(lengths)).encode()
+                params['allele'] = str(','.join(alleles)).encode()
+            else:
+                return results
     req_data = urlencode(params)
     if debug:
         print('url %s %s' % (url, unquote(req_data)), file=sys.stderr)