Esempio n. 1
0
 def _build_cache(self, genotype_data_ids):
     for genotype_data_id in genotype_data_ids:
         genotype_data_study = \
             self.gpf_instance.get_genotype_data(genotype_data_id)
         assert genotype_data_study is not None, genotype_data_id
         DenovoGeneSetCollectionFactory.build_collection(
             genotype_data_study)
Esempio n. 2
0
def denovo_gene_sets(local_gpf_instance):
    return [
        DenovoGeneSetCollectionFactory.load_collection(
            local_gpf_instance.get_genotype_data("f1_group")),
        DenovoGeneSetCollectionFactory.load_collection(
            local_gpf_instance.get_genotype_data("f2_group")),
        DenovoGeneSetCollectionFactory.load_collection(
            local_gpf_instance.get_genotype_data("f3_group")),
    ]
Esempio n. 3
0
def calc_gene_sets(request, local_gpf_instance, genotype_data_names, cleanup):
    for dgs in genotype_data_names:
        genotype_data = local_gpf_instance.get_genotype_data(dgs)
        DenovoGeneSetCollectionFactory.build_collection(genotype_data)

    print("PRECALCULATION COMPLETE")

    def remove_gene_sets():
        for dgs in genotype_data_names:
            genotype_data = local_gpf_instance.get_genotype_data(dgs)
            os.remove(
                DenovoGeneSetCollectionFactory.denovo_gene_set_cache_file(
                    genotype_data.config, "phenotype"))

    if cleanup:
        request.addfinalizer(remove_gene_sets)
Esempio n. 4
0
 def remove_gene_sets():
     for dgs in genotype_data_names:
         genotype_data = fixtures_gpf_instance.get_genotype_data(dgs)
         # fmt:off
         cache_file = \
             DenovoGeneSetCollectionFactory.denovo_gene_set_cache_file(
                 genotype_data.config, "phenotype"
             )
         # fmt:on
         if os.path.exists(cache_file):
             os.remove(cache_file)
Esempio n. 5
0
def dae_calc_gene_sets(request, fixtures_gpf_instance, cleanup):
    genotype_data_names = ["f1_group", "f2_group", "f3_group"]
    for dgs in genotype_data_names:
        genotype_data = fixtures_gpf_instance.get_genotype_data(dgs)
        assert genotype_data is not None

        DenovoGeneSetCollectionFactory.build_collection(genotype_data)

    def remove_gene_sets():
        for dgs in genotype_data_names:
            genotype_data = fixtures_gpf_instance.get_genotype_data(dgs)
            # fmt:off
            cache_file = \
                DenovoGeneSetCollectionFactory.denovo_gene_set_cache_file(
                    genotype_data.config, "phenotype"
                )
            # fmt:on
            if os.path.exists(cache_file):
                os.remove(cache_file)

    if cleanup:
        request.addfinalizer(remove_gene_sets)
Esempio n. 6
0
    def _load_cache(self):
        for genotype_data_id in self.get_genotype_data_ids():
            genotype_data_study = \
                self.gpf_instance.get_genotype_data(genotype_data_id)
            assert genotype_data_study is not None, genotype_data_id

            denovo_gene_set_collection = \
                DenovoGeneSetCollectionFactory.load_collection(
                    genotype_data_study)

            self._denovo_gene_set_configs_cache[
                genotype_data_id] = denovo_gene_set_collection.config
            self._denovo_gene_set_collections_cache[
                genotype_data_id] = denovo_gene_set_collection
Esempio n. 7
0
 def remove_gene_sets():
     for dgs in genotype_data_names:
         genotype_data = local_gpf_instance.get_genotype_data(dgs)
         os.remove(
             DenovoGeneSetCollectionFactory.denovo_gene_set_cache_file(
                 genotype_data.config, "phenotype"))
Esempio n. 8
0
def denovo_gene_set_f4(local_gpf_instance):
    return DenovoGeneSetCollectionFactory.load_collection(
        local_gpf_instance.get_genotype_data("f4_trio"))