Пример #1
0
 def setUp(self):
     self.references, self.configuration, self.fastafile = self._load_references(
     )
     self.proteome_blastp_runner = BlastpRunner(
         runner=Runner(verbose=False),
         configuration=self.configuration,
         database=self.references.get_proteome_database())
     self.iedb_blastp_runner = BlastpRunner(
         runner=Runner(verbose=False),
         configuration=self.configuration,
         database=self.references.get_iedb_database())
Пример #2
0
class TestRunner(TestCase):
    def setUp(self):
        self.runner = Runner()

    def test_runner(self):
        output, errors = self.runner.run_command(cmd=["python", "-V"])
        self.assertTrue("Python 3.7" in output or "Python 3.6" in output
                        or "Python 3.8" in output)
        self.assertTrue(len(errors) == 0)

    def test_runner_failure(self):
        with self.assertRaises(Exception):
            self.runner.run_command(cmd=["nocommandwiththisname"])
 def setUp(self):
     self.references, self.configuration = integration_test_tools.load_references()
     self.fastafile = integration_test_tools.create_temp_aminoacid_fasta_file()
     self.runner = Runner()
     self.proteome_blastp_runner = BlastpRunner(
         runner=self.runner, configuration=self.configuration,
         database=os.path.join(self.references.proteome_db, "homo_sapiens"))
Пример #4
0
 def setUp(self):
     self.references, self.configuration, self.fastafile = self._load_references(
     )
     self.iedb_blastp_runner = BlastpRunner(
         runner=Runner(verbose=False),
         configuration=self.configuration,
         database=self.references.get_iedb_database())
     self.neoantigen_fitness_calculator = NeoantigenFitnessCalculator(
         iedb_blastp_runner=self.iedb_blastp_runner)
Пример #5
0
 def setUp(self):
     references, self.configuration = integration_test_tools.load_references(organism=ORGANISM_MUS_MUSCULUS)
     self.runner = Runner()
     self.available_alleles = references.get_available_alleles()
     self.test_mhc_one = integration_test_tools.get_h2_one_test(references.get_mhc_database())
     self.test_mhc_two = integration_test_tools.get_h2_two_test(references.get_mhc_database())
     self.mhc_parser = MhcParser.get_mhc_parser(references.get_mhc_database())
     self.proteome_blastp_runner = BlastpRunner(
         runner=self.runner, configuration=self.configuration,
         database=references.get_proteome_database())
Пример #6
0
 def setUp(self):
     self.references, self.configuration = integration_test_tools.load_references(
     )
     self.runner = Runner()
     self.prime = Prime(runner=self.runner,
                        configuration=self.configuration,
                        mhc_parser=HlaParser(
                            self.references.get_mhc_database()))
     self.hla_database = self.references.get_mhc_database()
     self.test_mhc_one = integration_test_tools.get_hla_one_test(
         self.hla_database)
     self.uniprot = Uniprot(self.references.uniprot_pickle)
Пример #7
0
 def setUp(self):
     self.references, self.configuration = integration_test_tools.load_references()
     self.runner = Runner()
     mhc_parser = MhcParser.get_mhc_parser(self.references.get_mhc_database())
     self.mixmhcpred = MixMHCpred(
         runner=self.runner, configuration=self.configuration, mhc_parser=mhc_parser
     )
     self.mixmhc2pred = MixMhc2Pred(
         runner=self.runner, configuration=self.configuration, mhc_parser=mhc_parser
     )
     self.hla_database = self.references.get_mhc_database()
     self.test_mhc_one = integration_test_tools.get_hla_one_test(self.hla_database)
     self.test_mhc_two = integration_test_tools.get_hla_two_test(self.hla_database)
     self.uniprot = Uniprot(self.references.uniprot_pickle)
Пример #8
0
    def __init__(
        self,
        references: ReferenceFolder,
        configuration: DependenciesConfiguration,
        tcell_predictor: TcellPrediction,
        self_similarity: SelfSimilarityCalculator,
        affinity_threshold =neofox.AFFINITY_THRESHOLD_DEFAULT
    ):
        """class to annotate neoantigens"""
        self.runner = Runner()
        self.configuration = configuration
        self.proteome_db = references.proteome_db
        self.available_alleles = references.get_available_alleles()
        self.tcell_predictor = tcell_predictor
        self.self_similarity = self_similarity
        self.organism = references.organism

        # NOTE: this one loads a big file, but it is faster loading it multiple times than passing it around
        self.uniprot = Uniprot(references.uniprot_pickle)

        # initialise proteome and IEDB BLASTP runners
        self.proteome_blastp_runner = BlastpRunner(
            runner=self.runner, configuration=configuration,
            database=references.get_proteome_database())
        self.iedb_blastp_runner = BlastpRunner(
            runner=self.runner, configuration=configuration,
            database=references.get_iedb_database())

        # NOTE: these resources do not read any file thus can be initialised fast
        self.dissimilarity_calculator = DissimilarityCalculator(
            proteome_blastp_runner=self.proteome_blastp_runner, affinity_threshold=affinity_threshold)
        self.neoantigen_fitness_calculator = NeoantigenFitnessCalculator(iedb_blastp_runner=self.iedb_blastp_runner)
        self.neoag_calculator = NeoagCalculator(
            runner=self.runner, configuration=configuration, affinity_threshold=affinity_threshold
        )
        self.differential_binding = DifferentialBinding(affinity_threshold=affinity_threshold)
        self.priority_score_calculator = PriorityScore()
        self.iedb_immunogenicity = IEDBimmunogenicity(affinity_threshold=affinity_threshold)
        self.amplitude = Amplitude()
        self.hex = Hex(runner=self.runner, configuration=configuration, references=references)
        self.mhc_database = references.get_mhc_database()
        self.mhc_parser = MhcParser.get_mhc_parser(self.mhc_database)

        self.resources_versions = references.get_resources_versions()
Пример #9
0
 def setUp(self):
     references, self.configuration = integration_test_tools.load_references(
     )
     self.runner = Runner()
     self.available_alleles_mhc1 = (
         references.get_available_alleles().get_available_mhc_i())
     self.available_alleles_mhc2 = (
         references.get_available_alleles().get_available_mhc_ii())
     self.hla_database = references.get_mhc_database()
     self.mhc_parser = MhcParser.get_mhc_parser(self.hla_database)
     self.test_mhc_one = integration_test_tools.get_hla_one_test(
         self.hla_database)
     self.test_mhc_two = integration_test_tools.get_hla_two_test(
         self.hla_database)
     self.uniprot = Uniprot(references.uniprot_pickle)
     self.proteome_blastp_runner = BlastpRunner(
         runner=self.runner,
         configuration=self.configuration,
         database=references.get_proteome_database())
Пример #10
0
 def __init__(self, reference_folder, install_r_dependencies=False):
     self.config = DependenciesConfigurationForInstaller()
     self.runner = Runner()
     self.reference_folder = reference_folder
     self.install_r_dependencies = install_r_dependencies
Пример #11
0
 def setUp(self):
     self.references, self.configuration = integration_test_tools.load_references(
     )
     self.fastafile = integration_test_tools.create_temp_aminoacid_fasta_file(
     )
     self.runner = Runner()
Пример #12
0
 def setUp(self):
     self.references, self.configuration = integration_test_tools.load_references()
     self.runner = Runner()
Пример #13
0
 def setUp(self):
     self.runner = Runner()