From 00f0f3453abda7c774dceead2eb0164d59fc7baa Mon Sep 17 00:00:00 2001
From: Tim O'Donnell <timodonnell@gmail.com>
Date: Mon, 19 Feb 2018 22:06:13 -0500
Subject: [PATCH] fix

---
 mhcflurry/select_allele_specific_models_command.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mhcflurry/select_allele_specific_models_command.py b/mhcflurry/select_allele_specific_models_command.py
index 78650c16..de379cbe 100644
--- a/mhcflurry/select_allele_specific_models_command.py
+++ b/mhcflurry/select_allele_specific_models_command.py
@@ -267,10 +267,10 @@ class ConsensusModelSelector(object):
         self.predictor = predictor
         self.model_selection_kwargs = model_selection_kwargs
 
-        # Run predictions for one allele so self.peptides caches the encoding.
-        self.predictor.predict(
-            allele=self.predictor.supported_alleles[0],
-            peptides=self.peptides)
+        # Encode the peptides for each neural network, so the encoding
+        # becomes cached.
+        for network in predictor.neural_networks:
+            network.peptides_to_network_input(self.peptides)
 
     def usable_for_allele(self, allele):
         return True
-- 
GitLab