Skip to content
Snippets Groups Projects
Commit 9ef82bae authored by Alex Rubinsteyn's avatar Alex Rubinsteyn
Browse files

allow commas in peptide and allele strings for mhcflurry-predict, incrememented keras version

parent c116016a
No related merge requests found
...@@ -122,8 +122,19 @@ def run(argv=sys.argv[1:]): ...@@ -122,8 +122,19 @@ def run(argv=sys.argv[1:]):
parser.error( parser.error(
"Specify either an input CSV file or both the " "Specify either an input CSV file or both the "
"--alleles and --peptides arguments") "--alleles and --peptides arguments")
# split user specified allele and peptide strings in case they
pairs = list(itertools.product(args.alleles, args.peptides)) # 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({ df = pandas.DataFrame({
"allele": [p[0] for p in pairs], "allele": [p[0] for p in pairs],
"peptide": [p[1] for p in pairs], "peptide": [p[1] for p in pairs],
......
...@@ -2,7 +2,7 @@ numpy>= 1.11 ...@@ -2,7 +2,7 @@ numpy>= 1.11
pandas>=0.13.1 pandas>=0.13.1
appdirs appdirs
theano>=0.8.2 theano>=0.8.2
keras==1.1.0 keras==1.2.0
fancyimpute>=0.0.12 fancyimpute>=0.0.12
scikit-learn scikit-learn
h5py h5py
......
...@@ -53,7 +53,7 @@ if __name__ == '__main__': ...@@ -53,7 +53,7 @@ if __name__ == '__main__':
'pandas>=0.13.1', 'pandas>=0.13.1',
'appdirs', 'appdirs',
'theano>=0.8.2', 'theano>=0.8.2',
'keras==1.1.0', 'keras==1.2.0',
'fancyimpute>=0.0.12', 'fancyimpute>=0.0.12',
'scikit-learn', 'scikit-learn',
'h5py', 'h5py',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment