diff --git a/mhcflurry/batch_generator.py b/mhcflurry/batch_generator.py index 570cc8adcf430892e305d726bad8691ec0e8f9e9..ca51207201b98d83040a1ecefe37e35c23310666 100644 --- a/mhcflurry/batch_generator.py +++ b/mhcflurry/batch_generator.py @@ -103,7 +103,7 @@ class MultiallelicMassSpecBatchGenerator(object): batch_generator_batch_size=128, batch_generator_affinity_fraction=0.5) """ - Hyperperameters for batch generation for the ligandome predictor. + Hyperperameters for batch generation for the presentation predictor. """ def __init__(self, hyperparameters): diff --git a/mhcflurry/class1_presentation_neural_network.py b/mhcflurry/class1_presentation_neural_network.py index db3a25350476eabf937b8b29cceaeb6a65e188fa..897fafd854d437a269a83c59fb30cca2469dc9a7 100644 --- a/mhcflurry/class1_presentation_neural_network.py +++ b/mhcflurry/class1_presentation_neural_network.py @@ -195,22 +195,23 @@ class Class1PresentationNeuralNetwork(object): [node, auxiliary_input], name="affinities_with_auxiliary") layer = Dense(8, activation="tanh") - lifted = TimeDistributed(layer, name="ligandome_hidden1") + lifted = TimeDistributed(layer, name="presentation_hidden1") node = lifted(node) layer = Dense(1, activation="tanh") - lifted = TimeDistributed(layer, name="ligandome_output") - ligandome_adjustment = lifted(node) + lifted = TimeDistributed(layer, name="presentation_hidden2") + presentation_adjustment = lifted(node) def logit(x): import tensorflow as tf return - tf.log(1. / x - 1.) - ligandome_output_pre_sigmoid = Add()([ + presentation_output_pre_sigmoid = Add()([ Lambda(logit)(affinity_predictor_matrix_output), - ligandome_adjustment, + presentation_adjustment, ]) - ligandome_output = Activation("sigmoid")(ligandome_output_pre_sigmoid) + presentation_output = Activation("sigmoid", name="presentation_output")( + presentation_output_pre_sigmoid) self.network = Model( inputs=[ @@ -219,10 +220,10 @@ class Class1PresentationNeuralNetwork(object): ] + ([] if auxiliary_input is None else [auxiliary_input]), outputs=[ affinity_predictor_output, - ligandome_output, + presentation_output, affinity_predictor_matrix_output ], - name="ligandome", + name="presentation", ) self.network.summary() diff --git a/mhcflurry/class1_presentation_predictor.py b/mhcflurry/class1_presentation_predictor.py index 1471ad974dba121e5a6b07264c99f33febf32fcf..625b32f4fd7c70e8164b7ce4a026819e51569166 100644 --- a/mhcflurry/class1_presentation_predictor.py +++ b/mhcflurry/class1_presentation_predictor.py @@ -36,11 +36,11 @@ from .custom_loss import ( class Class1PresentationPredictor(object): def __init__( self, - class1_ligandome_neural_networks, + class1_presentation_neural_networks, allele_to_sequence, manifest_df=None, metadata_dataframes=None): - self.networks = class1_ligandome_neural_networks + self.networks = class1_presentation_neural_networks self.allele_to_sequence = allele_to_sequence self._manifest_df = manifest_df self.metadata_dataframes = ( diff --git a/mhcflurry/multiallelic_refinement_command.py b/mhcflurry/multiallelic_refinement_command.py index 1e47e77f5d7c6e0bbd40df8f56d3951d5833fa69..324efff0b16641ffc12e4e74d97cd05ee9f32748 100644 --- a/mhcflurry/multiallelic_refinement_command.py +++ b/mhcflurry/multiallelic_refinement_command.py @@ -57,17 +57,17 @@ parser.add_argument( parser.add_argument( "--hyperparameters", metavar="FILE.json", - help="Ligandome predictor hyperparameters") + help="presentation predictor hyperparameters") parser.add_argument( "--out-affinity-predictor-dir", metavar="DIR", required=True, help="Directory to write refined models") parser.add_argument( - "--out-ligandome-predictor-dir", + "--out-presentation-predictor-dir", metavar="DIR", required=True, - help="Directory to write ligandome predictors") + help="Directory to write preentation predictor") parser.add_argument( "--verbosity", type=int, @@ -89,8 +89,8 @@ def run(argv=sys.argv[1:]): args.out_affinity_predictor_dir = os.path.abspath( args.out_affinity_predictor_dir) - args.out_ligandome_predictor_dir = os.path.abspath( - args.out_ligandome_predictor_dir) + args.out_presentation_predictor_dir = os.path.abspath( + args.out_presentation_predictor_dir) configure_logging(verbose=args.verbosity > 1) diff --git a/test/test_class1_presentation_predictor.py b/test/test_class1_presentation_predictor.py index 768d270a42df15df2fbdfa0341b5eb6b14951a03..bbd0bf1e4385d53fed16a73b88d402945271c946 100644 --- a/test/test_class1_presentation_predictor.py +++ b/test/test_class1_presentation_predictor.py @@ -56,7 +56,6 @@ def data_path(name): return os.path.join(os.path.dirname(__file__), "data", name) - def setup(): global PAN_ALLELE_PREDICTOR_NO_MASS_SPEC global PAN_ALLELE_MOTIFS_WITH_MASS_SPEC_DF