# HG changeset patch # User iuc # Date 1599858154 0 # Node ID e95d3221b7f064e1a82859eef6439cea60f094e8 # Parent a09849898387530405ddf4eb564baff89c6ccb82 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/iedb_api commit 863578373c7dadc5880633115b0c348f73dac782" diff -r a09849898387 -r e95d3221b7f0 iedb_api.py --- a/iedb_api.py Wed Jul 29 17:29:56 2020 -0400 +++ b/iedb_api.py Fri Sep 11 21:02:34 2020 +0000 @@ -35,7 +35,7 @@ 'bcell': range(8, 16)} -def parse_alleles(allelefile, lengths): +def parse_alleles(allelefile, query_lengths): alleles = [] lengths = [] with open(allelefile, 'r') as fh: @@ -47,8 +47,11 @@ for alen in fields[1:]: alleles.append(allele) lengths.append(alen) - elif lengths: - for alen in str(lengths).split(','): + elif query_lengths: + lens = [] + for ql in query_lengths: + lens.extend(str(ql).split(',')) + for alen in lens: alleles.append(allele) lengths.append(alen) else: @@ -157,8 +160,7 @@ parser.add_argument('-l', '--length', action="append", default=[], - help='lengths for which to make predictions, ' - '1 per allele') + help='lengths for which to make predictions for alleles') parser.add_argument('-w', '--window_size', type=int, default=None, @@ -166,7 +168,7 @@ parser.add_argument('-i', '--input', default=None, help='Input file for peptide sequences ' - '(fasta or tabular)') + + '(fasta or tabular)') parser.add_argument('-c', '--column', default=None, help='Peptide Column in a tabular input file') @@ -205,7 +207,7 @@ if not (args.sequence or args.input): warn_err('NO Sequences given: ' - 'either -s sequence or -i input_file is required\n', + + 'either -s sequence or -i input_file is required\n', exit_code=1) if args.output is not None: @@ -228,7 +230,8 @@ if args.allele: for i, allele in enumerate(args.allele): alleles.append(allele) - alen = args.length[i] if i < len(args.length) else args.length[-1] + alen = args.length[i] if i < len(args.length)\ + else args.length[-1] lengths.append(alen) allele = ','.join(alleles) if alleles else None length = ','.join(lengths) if lengths else None @@ -238,7 +241,8 @@ args.prediction # results - results = {'prediction': {'header': None, 'entries': []}, 'detail': {'header': None, 'entries': []}} + results = {'prediction': {'header': None, 'entries': []}, + 'detail': {'header': None, 'entries': []}} if args.sequence: for i, seq in enumerate(args.sequence): diff -r a09849898387 -r e95d3221b7f0 iedb_api.xml --- a/iedb_api.xml Wed Jul 29 17:29:56 2020 -0400 +++ b/iedb_api.xml Fri Sep 11 21:02:34 2020 +0000 @@ -1,4 +1,4 @@ - + MHC Binding prediction @@ -43,6 +43,7 @@ #else: -A '$entered_alleles' #end if + -l '$prediction.lengths' #end if #if $sequence.seqsrc == 'fasta': @@ -95,6 +96,8 @@ + + @@ -261,7 +264,7 @@ - + @@ -284,6 +287,7 @@ + diff -r a09849898387 -r e95d3221b7f0 test-data/alleles.tsv --- a/test-data/alleles.tsv Wed Jul 29 17:29:56 2020 -0400 +++ b/test-data/alleles.tsv Fri Sep 11 21:02:34 2020 +0000 @@ -1,2 +1,2 @@ -HLA-A*01:01,9 -HLA-A*03:01,10 +HLA-A*01:01 +HLA-A*03:01 diff -r a09849898387 -r e95d3221b7f0 test-data/alleles_len.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/alleles_len.tsv Fri Sep 11 21:02:34 2020 +0000 @@ -0,0 +1,2 @@ +HLA-A*01:01,9 +HLA-A*03:01,10