From 672afedfe18bf9f1644366e55e2c2623f6d89fe8 Mon Sep 17 00:00:00 2001
From: Tim O'Donnell <timodonnell@gmail.com>
Date: Sat, 27 Jan 2018 22:22:50 -0500
Subject: [PATCH] update

---
 downloads-generation/models_class1/GENERATE.sh    |  3 ++-
 mhcflurry/class1_affinity_predictor.py            | 14 +++++---------
 mhcflurry/train_allele_specific_models_command.py | 10 +++++++++-
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/downloads-generation/models_class1/GENERATE.sh b/downloads-generation/models_class1/GENERATE.sh
index 8e4905fa..a63b17de 100755
--- a/downloads-generation/models_class1/GENERATE.sh
+++ b/downloads-generation/models_class1/GENERATE.sh
@@ -37,7 +37,8 @@ time mhcflurry-class1-train-allele-specific-models \
     --out-models-dir models \
     --percent-rank-calibration-num-peptides-per-length 1000000 \
     --min-measurements-per-allele 75 \
-    --parallelization-num-jobs 0
+    --train-num-jobs 0 \
+    --calibration-num-jobs 4
 
 cp $SCRIPT_ABSOLUTE_PATH .
 bzip2 LOG.txt
diff --git a/mhcflurry/class1_affinity_predictor.py b/mhcflurry/class1_affinity_predictor.py
index aee7d2e5..88c807af 100644
--- a/mhcflurry/class1_affinity_predictor.py
+++ b/mhcflurry/class1_affinity_predictor.py
@@ -933,11 +933,6 @@ class Class1AffinityPredictor(object):
 
         if worker_pool and len(alleles) > 1:
             # Run in parallel
-
-            # Performance hack.
-            for network in self.neural_networks:
-                network.peptides_to_network_input(encoded_peptides)
-
             do_work = partial(
                 _calibrate_percentile_ranks,
                 predictor=self,
@@ -969,13 +964,14 @@ def _calibrate_percentile_ranks(alleles, predictor, peptides, bins):
 
     Parameters
     ----------
-    alleles
-    predictor
-    peptides
-    bins
+    alleles : list of string
+    predictor : Class1AffinityPredictor
+    peptides : list of string or EncodableSequences
+    bins : object
 
     Returns
     -------
+    dict : allele -> percentile rank transform
 
     """
     result = {}
diff --git a/mhcflurry/train_allele_specific_models_command.py b/mhcflurry/train_allele_specific_models_command.py
index dfd77d4c..406da3e0 100644
--- a/mhcflurry/train_allele_specific_models_command.py
+++ b/mhcflurry/train_allele_specific_models_command.py
@@ -85,7 +85,15 @@ parser.add_argument(
     help="Keras verbosity. Default: %(default)s",
     default=0)
 parser.add_argument(
-    "--parallelization-num-jobs",
+    "--train-num-jobs",
+    default=1,
+    type=int,
+    metavar="N",
+    help="Parallelization jobs. Experimental. "
+    "Set to 1 for serial run. Set to 0 to use number of cores. "
+    "Default: %(default)s.")
+parser.add_argument(
+    "--calibration-num-jobs",
     default=1,
     type=int,
     metavar="N",
-- 
GitLab