diff --git a/mhcflurry/predict_command.py b/mhcflurry/predict_command.py index 4a010402ecb357d296a574c2c89a93ec116051ad..edcc6af020e175bd5077f1e1a84e9e9b6d61553c 100644 --- a/mhcflurry/predict_command.py +++ b/mhcflurry/predict_command.py @@ -122,8 +122,19 @@ def run(argv=sys.argv[1:]): parser.error( "Specify either an input CSV file or both the " "--alleles and --peptides arguments") - - pairs = list(itertools.product(args.alleles, args.peptides)) + # split user specified allele and peptide strings in case they + # contain multiple entries separated by commas + alleles = [] + for allele_string in args.alleles: + alleles.extend([s.strip() for s in allele_string.split(",")]) + peptides = [] + for peptide in args.peptides: + peptides.extend(peptide.strip() for p in peptide.split(",")) + for peptide in peptides: + if not peptide.isalpha(): + raise ValueError( + "Unexpected character(s) in peptide '%s'" % peptide) + pairs = list(itertools.product(alleles, peptides)) df = pandas.DataFrame({ "allele": [p[0] for p in pairs], "peptide": [p[1] for p in pairs], diff --git a/requirements.txt b/requirements.txt index 78a52a934f1732bc8eb3d459bafa9c01f1d54728..e1768825d305e148f3429f64c7b54c4f60dd06dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ numpy>= 1.11 pandas>=0.13.1 appdirs theano>=0.8.2 -keras==1.1.0 +keras==1.2.0 fancyimpute>=0.0.12 scikit-learn h5py diff --git a/setup.py b/setup.py index 1571028c3d1d9af752101020f6395d04ebdc8a57..422d2ecac2080ecfbf524ea78f047c678f8ebb3e 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ if __name__ == '__main__': 'pandas>=0.13.1', 'appdirs', 'theano>=0.8.2', - 'keras==1.1.0', + 'keras==1.2.0', 'fancyimpute>=0.0.12', 'scikit-learn', 'h5py',