diff --git a/mhcflurry/class1_affinity_prediction/train_allele_specific_models_command.py b/mhcflurry/class1_affinity_prediction/train_allele_specific_models_command.py index 92a68f14925465295bcba67481f7a41874089288..6f0aa97529613321e2f3986a9d38201f3bd27983 100644 --- a/mhcflurry/class1_affinity_prediction/train_allele_specific_models_command.py +++ b/mhcflurry/class1_affinity_prediction/train_allele_specific_models_command.py @@ -2,6 +2,7 @@ Train Class1 single allele models. """ +import os import sys import argparse import json @@ -93,6 +94,11 @@ def run(argv=sys.argv[1:]): predictor = Class1AffinityPredictor() + if args.out_models_dir and not os.path.exists(args.out_models_dir): + print("Attempting to create directory: %s" % args.out_models_dir) + os.mkdir(args.out_models_dir) + print("Done.") + for (h, hyperparameters) in enumerate(hyperparameters_lst): n_models = hyperparameters.pop("n_models")