changeset 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
files iedb_api.py iedb_api.xml test-data/seqs.fa test-data/seqs.tsv
diffstat 4 files changed, 19 insertions(+), 3 deletions(-) [+]
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)
--- a/iedb_api.xml	Fri Sep 11 21:02:34 2020 +0000
+++ b/iedb_api.xml	Sat Feb 13 00:06:36 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="iedb_api" name="IEDB" version="2.15.1">
+<tool id="iedb_api" name="IEDB" version="2.15.2">
     <description>MHC Binding prediction</description>
     <macros>
         <xml name="alleles" token_hla_regex="" token_hla_examples="" token_hlalen_examples=""> 
@@ -13,7 +13,7 @@
                    </param>
                </when>
                <when value="entry">
-                   <param name="allele_text" type="text" size="80" label="Alleles">
+                   <param name="allele_text" type="text" label="Alleles">
                        <help>Enter alleles separated by white space: @HLA_EXAMPLES@  (The peptide lengths may follow each allele: @HLALEN_EXAMPLES@)</help>
                        <validator type="regex" message="Doesn't appear to be a valid allele">^@HLA_REGEX@(\s+@HLA_REGEX@)*$</validator>
                    </param>
--- a/test-data/seqs.fa	Fri Sep 11 21:02:34 2020 +0000
+++ b/test-data/seqs.fa	Sat Feb 13 00:06:36 2021 +0000
@@ -2,3 +2,5 @@
 GHAHKVPRRLLKAAR
 >peptide2
 LKAADASADADGSGSGSGSG
+>peptide3
+KDLGYDYS
--- a/test-data/seqs.tsv	Fri Sep 11 21:02:34 2020 +0000
+++ b/test-data/seqs.tsv	Sat Feb 13 00:06:36 2021 +0000
@@ -1,2 +1,3 @@
 peptide1	16	GHAHKVPRRLLKAAR
 peptide2	21	LKAADASADADGSGSGSGSG
+peptide3	8	KDLGYDYS