Skip to content
Snippets Groups Projects
Commit 4ea4173a authored by Tim O'Donnell's avatar Tim O'Donnell
Browse files

Refactor to simplify directory structure

parent 6f6070b2
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,8 @@ coverage.xml
# Sphinx documentation
docs/_build/
docs/_static
docs/_templates
# PyBuilder
target/
......
......@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from .class1_affinity_prediction.class1_neural_network import (
Class1NeuralNetwork)
from .class1_affinity_prediction.class1_affinity_predictor import (
from mhcflurry.class1_affinity_predictor import (
Class1AffinityPredictor)
from mhcflurry.class1_neural_network import (
Class1NeuralNetwork)
__version__ = "1.0.0"
......
from __future__ import absolute_import
from .class1_neural_network import Class1NeuralNetwork
from .class1_affinity_predictor import Class1AffinityPredictor
__all__ = [
'Class1NeuralNetwork',
'Class1AffinityPredictor',
]
import collections
import time
import hashlib
import json
from os.path import join, exists
from six import string_types
import logging
import warnings
import sys
import time
import warnings
from os.path import join, exists
import mhcnames
import numpy
import pandas
from numpy.testing import assert_equal
from six import string_types
import mhcnames
from ..encodable_sequences import EncodableSequences
from ..downloads import get_path
from ..common import random_peptides
from ..percent_rank_transform import PercentRankTransform
from ..regression_target import to_ic50
from .class1_neural_network import Class1NeuralNetwork
from mhcflurry.class1_neural_network import Class1NeuralNetwork
from mhcflurry.common import random_peptides
from mhcflurry.downloads import get_path
from mhcflurry.encodable_sequences import EncodableSequences
from mhcflurry.percent_rank_transform import PercentRankTransform
from mhcflurry.regression_target import to_ic50
class Class1AffinityPredictor(object):
......
......@@ -7,10 +7,10 @@ import pandas
from mhcflurry.hyperparameters import HyperparameterDefaults
from ..encodable_sequences import EncodableSequences
from ..amino_acid import available_vector_encodings, vector_encoding_length
from ..regression_target import to_ic50, from_ic50
from ..common import random_peptides, amino_acid_distribution
from mhcflurry.encodable_sequences import EncodableSequences
from mhcflurry.amino_acid import available_vector_encodings, vector_encoding_length
from mhcflurry.regression_target import to_ic50, from_ic50
from mhcflurry.common import random_peptides, amino_acid_distribution
class Class1NeuralNetwork(object):
......
......@@ -47,7 +47,7 @@ import logging
import pandas
from .downloads import get_path
from .class1_affinity_prediction import Class1AffinityPredictor
from .class1_affinity_predictor import Class1AffinityPredictor
parser = argparse.ArgumentParser(
......
......@@ -2,21 +2,20 @@
Train Class1 single allele models.
"""
import argparse
import os
import signal
import sys
import argparse
import yaml
import time
import signal
import traceback
from multiprocessing import Pool
import pandas
import yaml
from mhcnames import normalize_allele_name
from .class1_affinity_predictor import Class1AffinityPredictor
from ..common import configure_logging
from mhcflurry.class1_affinity_predictor import Class1AffinityPredictor
from mhcflurry.common import configure_logging
parser = argparse.ArgumentParser(usage=__doc__)
......@@ -89,6 +88,7 @@ parser.add_argument(
"Set to 1 for serial run. Set to 0 to use number of cores. "
"Default: %(default)s.")
def run(argv=sys.argv[1:]):
# On sigusr1 print stack trace
print("To show stack trace, run:\nkill -s USR1 %d" % os.getpid())
......
......@@ -2,7 +2,7 @@ import numpy
import pandas
numpy.random.seed(0)
from mhcflurry import Class1NeuralNetwork
from mhcflurry.class1_neural_network import Class1NeuralNetwork
from nose.tools import eq_
from numpy import testing
......
from numpy.testing import assert_equal
from mhcflurry.class1_affinity_prediction import Class1NeuralNetwork
from mhcflurry.class1_neural_network import Class1NeuralNetwork
def test_all_combinations_of_hyperparameters():
......
import tempfile
import shutil
import os
import json
import os
import shutil
import tempfile
from numpy.testing import assert_array_less, assert_equal
from mhcflurry.class1_affinity_prediction import (
train_allele_specific_models_command, Class1AffinityPredictor)
from mhcflurry import train_allele_specific_models_command
from mhcflurry import Class1AffinityPredictor
from mhcflurry.downloads import get_path
HYPERPARAMETERS = [
{
"n_models": 2,
......
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