Ejemplo n.º 1
0
Archivo: ncf.py Proyecto: strny/miXGENE
    def execute(self, exp, *args, **kwargs):
        self.set_out_var("result", None)
        self.collect_options()

        mRNA_train_es = self.get_input_var("mRNA_train_es")
        mRNA_test_es = self.get_input_var("mRNA_test_es")

        miRNA_train_es = self.get_input_var("miRNA_train_es")
        miRNA_test_es = self.get_input_var("miRNA_test_es")

        self.celery_task = wrapper_task.s(
            apply_ncf_classifier,
            exp=exp, block=self,

            mRNA_train_es=mRNA_train_es, mRNA_test_es=mRNA_test_es,
            miRNA_train_es=miRNA_train_es, miRNA_test_es=miRNA_test_es,

            classifier_name=self.classifier_name,
            classifier_options=self.classifier_options,
            fit_options=self.fit_options,

            base_folder=exp.get_data_folder(),
            base_filename="%s_%s" % (self.uuid, self.classifier_name),
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 2
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        cs = self.get_input_var("cs")
        """:type :ComoduleSet"""
        es = self.get_input_var("es")
        """:type :ExpressionSet"""
        # gene_platform = self.upload_gene2gene_platform
        gene2gene = self.get_input_var("gene2gene")
        """:type :BinaryInteraction"""
        # gene_platform = gene_platform.get_file()
        # with open(gene_platform.path) as f:
        #     for line in f:
        #         gene_platform = line.split(',')
        #         self.clean_errors()

        self.celery_task = wrapper_task.s(
            compute_edges,
            exp,
            self,
            m_rna_es=es,
            comodule_set=cs,
            gene2gene=gene2gene,
            # gene_platform = gene_platform,
            base_filename="%s_pattern_edges" % self.uuid)
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 3
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        cs = self.get_input_var("cs")
        """:type :ComoduleSet"""
        es = self.get_input_var("es")
        """:type :ExpressionSet"""
        # gene_platform = self.upload_gene2gene_platform
        gene2gene = self.get_input_var("gene2gene")
        """:type :BinaryInteraction"""
        # gene_platform = gene_platform.get_file()
        # with open(gene_platform.path) as f:
        #     for line in f:
        #         gene_platform = line.split(',')
        #         self.clean_errors()

        self.celery_task = wrapper_task.s(
            compute_edges,
            exp, self,
            m_rna_es = es,
            comodule_set = cs,
            gene2gene = gene2gene,
            # gene_platform = gene_platform,
            base_filename="%s_pattern_edges" % self.uuid
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 4
0
 def process_upload(self, exp, *args, **kwargs):
     """
         @param exp: Experiment
     """
     self.clean_errors()
     # sep = getattr(self, "csv_sep", " ")
     # platform = getattr(self, "platform", " ")
     try:
         if len(self.pheno_matrices) != len(self.es_matrices):
             raise RuntimeError("Different number of phenotypes and expression sets")
         self.labels = es_matrix_names = sorted(self.es_matrices)
         pheno_matrix_names = sorted(self.pheno_matrices)
         self.pheno_by_es_names = {
             es_name: pheno_name for
             es_name, pheno_name
             in zip(es_matrix_names, pheno_matrix_names)
         }
         self.clean_errors()
         self.celery_task = wrapper_task.s(
             bunch_upload_task,
             exp,
             self,
             success_action="processing_done",
             error_action="error_on_processing"
         )
         exp.store_block(self)
         self.celery_task.apply_async()
     except Exception as e:
         exp.log(self.uuid, e, severity="CRITICAL")
         log.exception(e)
         self.errors.append(e)
         self.do_action("error_on_processing", exp, e)
Ejemplo n.º 5
0
    def execute(self, exp, *args, **kwargs):
        self.set_out_var("result", None)
        self.collect_options()

        mRNA_train_es = self.get_input_var("mRNA_train_es")
        mRNA_test_es = self.get_input_var("mRNA_test_es")

        miRNA_train_es = self.get_input_var("miRNA_train_es")
        miRNA_test_es = self.get_input_var("miRNA_test_es")

        self.celery_task = wrapper_task.s(
            apply_ncf_classifier,
            exp=exp,
            block=self,
            mRNA_train_es=mRNA_train_es,
            mRNA_test_es=mRNA_test_es,
            miRNA_train_es=miRNA_train_es,
            miRNA_test_es=miRNA_test_es,
            classifier_name=self.classifier_name,
            classifier_options=self.classifier_options,
            fit_options=self.fit_options,
            base_folder=exp.get_data_folder(),
            base_filename="%s_%s" % (self.uuid, self.classifier_name),
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 6
0
 def process_upload(self, exp, *args, **kwargs):
     self.clean_errors()
     self.celery_task = wrapper_task.s(
         user_upload_complex_task,
         exp,
         self
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 7
0
 def start_preprocess(self, exp, *args, **kwargs):
     self.celery_task_preprocess = wrapper_task.s(
         preprocess_soft,
         exp,
         self,
         source_file=self.source_file,
         success_action="successful_preprocess",
         error_action="error_during_preprocess")
     exp.store_block(self)
     self.celery_task_preprocess.apply_async()
Ejemplo n.º 8
0
 def start_preprocess(self, exp, *args, **kwargs):
     self.celery_task_preprocess = wrapper_task.s(
         preprocess_soft,
         exp, self,
         source_file=self.source_file,
         success_action="successful_preprocess",
         error_action="error_during_preprocess"
     )
     exp.store_block(self)
     self.celery_task_preprocess.apply_async()
Ejemplo n.º 9
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     self.celery_task = wrapper_task.s(global_test_task,
                                       exp,
                                       self,
                                       es=self.get_input_var("es"),
                                       gene_sets=self.get_input_var("gs"),
                                       table_result=self.result)
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 10
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     self.celery_task = wrapper_task.s(
         global_test_task,
         exp, self,
         es=self.get_input_var("es"),
         gene_sets=self.get_input_var("gs"),
         table_result=self.result
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 11
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        es = self.get_input_var("es")

        self.celery_task = wrapper_task.s(
            quant_norm_task,
            exp, self,
            es=es,
            base_filename="%s_%s_flt" % (self.uuid, 'quantile_norm')
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 12
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     # import ipdb; ipdb.set_trace()
     self.celery_task = wrapper_task.s(
         merge_two_es,
         exp, self,
         es_1 = self.get_input_var("es_1"),
         es_2 = self.get_input_var("es_2"),
         base_filename="%s_merged" % self.uuid,
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 13
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        es = self.get_input_var("es")
        gs = self.get_input_var("gs")

        base_filename = "%s_gs_agg" % (self.uuid, )

        self.celery_task = wrapper_task.s(do_gs_agg, exp, self, es, gs,
                                          self.agg_method, base_filename)

        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 14
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        es = self.get_input_var("es")

        self.celery_task = wrapper_task.s(zscore_task,
                                          exp,
                                          self,
                                          es=es,
                                          base_filename="%s_%s_flt" %
                                          (self.uuid, 'zscore'))
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 15
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     # import ipdb; ipdb.set_trace()
     self.celery_task = wrapper_task.s(
         merge_two_es,
         exp,
         self,
         es_1=self.get_input_var("es_1"),
         es_2=self.get_input_var("es_2"),
         base_filename="%s_merged" % self.uuid,
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 16
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     es = self.get_input_var("es")
     # T = self.get_input_var("T")
     self.celery_task = wrapper_task.s(
         threshold_task,
         exp, self,
         es=es,
         T=self.T,
         base_filename="%s_%s_thr" % (self.uuid, 'threshold')
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 17
0
 def start_fetch(self, exp, *args, **kwargs):
     """
         @param exp: Experiment
     """
     self.clean_errors()
     self.celery_task_fetch = wrapper_task.s(
         fetch_geo_gse, exp, self,
         geo_uid=self.geo_uid,
         success_action="successful_fetch", error_action="error_during_fetch",
         ignore_cache=False
     )
     exp.store_block(self)
     self.celery_task_fetch.apply_async()
Ejemplo n.º 18
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     es = self.get_input_var("es")
     # T = self.get_input_var("T")
     self.celery_task = wrapper_task.s(threshold_task,
                                       exp,
                                       self,
                                       es=es,
                                       T=self.T,
                                       base_filename="%s_%s_thr" %
                                       (self.uuid, 'threshold'))
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 19
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     self.celery_task = wrapper_task.s(
         feature_selection_by_cut,
         exp=exp, block=self,
         src_es=self.get_input_var("es"),
         rank_table=self.get_input_var("rank_table"),
         cut_property=self.cut_property,
         threshold=self.threshold,
         cut_direction=self.cut_direction,
         base_filename="%s_feature_selection" % self.uuid,
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 20
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     gs, ann = self.get_input_var("gs"), self.get_input_var("ann")
     # import ipdb; ipdb.set_trace()
     self.celery_task = wrapper_task.s(map_gene_sets_to_probes,
                                       exp,
                                       self,
                                       base_dir=exp.get_data_folder(),
                                       base_filename="%s_merged" %
                                       self.uuid,
                                       ann_gene_sets=ann.gene_sets,
                                       src_gene_sets=gs)
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 21
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        es = self.get_input_var("es")

        self.celery_task = wrapper_task.s(
            filter_task,
            exp, self,
            filter_type=self.filter_method,
            q=self.q,
            es=es,
            base_filename="%s_%s_flt" % (self.uuid, self.filter_method)
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 22
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        self.collect_options()

        self.celery_task = wrapper_task.s(apply_ranking,
                                          exp=exp,
                                          block=self,
                                          es=self.get_input_var("es"),
                                          ranking_name=self.ranking_name,
                                          result_table=self.result,
                                          options=self.ranking_options)
        exp.store_block(self)
        self.celery_task.apply_async()
        log.debug("Sent ranking computation to queue")
Ejemplo n.º 23
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     gs = self.get_input_var("gs")
     h2 = self.get_input_var("H2_genes")
     self.celery_task = wrapper_task.s(
         enrichment_task,
         exp, self,
         gs = gs,
         H2 = h2,
         T=self.T,
         base_filename="%s_%s_enrich" % (self.uuid, 'enrichment')
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 24
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     gs = self.get_input_var("gs")
     cs = self.get_input_var("cs")
     self.celery_task = wrapper_task.s(
         enrichment_no_t_task,
         exp, self,
         T = self.T,
         gs = gs,
         cs = cs,
         base_filename="%s_%s_enrich" % (self.uuid, 'enrichment_cont')
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 25
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     gs = self.get_input_var("gs")
     cs = self.get_input_var("patterns")
     self.celery_task = wrapper_task.s(enrichment_no_t_task,
                                       exp,
                                       self,
                                       T=self.T,
                                       gs=gs,
                                       patterns=cs,
                                       base_filename="%s_%s_enrich" %
                                       (self.uuid, 'enrichment_cont'))
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 26
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        gs, ann = self.get_input_var("gs"), self.get_input_var("ann")
        # import ipdb; ipdb.set_trace()
        self.celery_task = wrapper_task.s(
            map_gene_sets_to_probes,
            exp, self,
            base_dir=exp.get_data_folder(),
            base_filename="%s_merged" % self.uuid,
            ann_gene_sets=ann.gene_sets,
            src_gene_sets=gs

        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 27
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        self.collect_options()

        self.celery_task = wrapper_task.s(
            apply_ranking,
            exp=exp, block=self,
            es=self.get_input_var("es"),
            ranking_name=self.ranking_name,
            result_table=self.result,
            options=self.ranking_options
        )
        exp.store_block(self)
        self.celery_task.apply_async()
        log.debug("Sent ranking computation to queue")
Ejemplo n.º 28
0
 def execute(self, exp, *args, **kwargs):
     self.clean_errors()
     self.celery_task = wrapper_task.s(
         feature_selection_by_cut,
         exp=exp,
         block=self,
         src_es=self.get_input_var("es"),
         rank_table=self.get_input_var("rank_table"),
         cut_property=self.cut_property,
         threshold=self.threshold,
         cut_direction=self.cut_direction,
         base_filename="%s_feature_selection" % self.uuid,
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 29
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()

        self.celery_task = wrapper_task.s(
            pattern_filter_task,
            exp,
            self,
            m_rna_es=self.get_input_var("mRNA"),
            mi_rna_es=self.get_input_var("miRNA"),
            gene_sets=self.get_input_var("gs"),
            metric=self.metric,
            n_best=self.n_best,
            base_filename="%s_comodule_sets" % self.uuid)
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 30
0
 def start_fetch(self, exp, *args, **kwargs):
     """
         @param exp: Experiment
     """
     self.clean_errors()
     self.celery_task_fetch = wrapper_task.s(
         fetch_geo_gse,
         exp,
         self,
         geo_uid=self.geo_uid,
         success_action="successful_fetch",
         error_action="error_during_fetch",
         ignore_cache=False)
     exp.store_block(self)
     self.celery_task_fetch.apply_async()
Ejemplo n.º 31
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()

        self.celery_task = wrapper_task.s(
            pattern_filter_task,
            exp, self,
            m_rna_es = self.get_input_var("mRNA"),
            mi_rna_es = self.get_input_var("miRNA"),
            gene_sets = self.get_input_var("gs"),
            metric = self.metric,
            n_best = self.n_best,
            base_filename="%s_comodule_sets" % self.uuid
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 32
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        cs_1 = self.get_input_var("cs_1")
        cs_2 = self.get_input_var("cs_2")

        self.celery_task = wrapper_task.s(merge_comodules_task,
                                          exp,
                                          self,
                                          cs_1=cs_1,
                                          cs_2=cs_2,
                                          cs_1_name=self.cs_1_name,
                                          cs_2_name=self.cs_2_name,
                                          base_filename="%s_%s_thr" %
                                          (self.uuid, 'merge_cs'))
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 33
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        es = self.get_input_var("es")
        gs = self.get_input_var("gs")

        base_filename = "%s_gs_agg" % (self.uuid, )

        self.celery_task = wrapper_task.s(
            do_gs_agg,
            exp, self,
            es, gs, self.agg_method,
            base_filename
        )

        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 34
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        cs_1 = self.get_input_var("cs_1")
        cs_2 = self.get_input_var("cs_2")

        self.celery_task = wrapper_task.s(
            merge_comodules_task,
            exp, self,
            cs_1=cs_1,
            cs_2=cs_2,
            cs_1_name=self.cs_1_name,
            cs_2_name=self.cs_2_name,
            base_filename="%s_%s_thr" % (self.uuid, 'merge_cs')
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 35
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        mRNA_es = self.get_input_var("mRNA_es")
        miRNA_es = self.get_input_var("miRNA_es")
        interaction_matrix = self.get_input_var("interaction")

        self.celery_task = wrapper_task.s(
            filter_by_bi,
            exp, self,
            m_rna_es=mRNA_es,
            mi_rna_es=miRNA_es,
            interaction_matrix=interaction_matrix,
            base_filename="%s_filtered_by_BI" % self.uuid,
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 36
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        mRNA_es = self.get_input_var("mRNA_es")
        miRNA_es = self.get_input_var("miRNA_es")
        interaction_matrix = self.get_input_var("interaction")

        self.celery_task = wrapper_task.s(
            filter_by_bi,
            exp,
            self,
            m_rna_es=mRNA_es,
            mi_rna_es=miRNA_es,
            interaction_matrix=interaction_matrix,
            base_filename="%s_filtered_by_BI" % self.uuid,
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 37
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()

        self.inner_output_manager.reset()
        es_dict = {inp_name: self.get_input_var(inp_name) for inp_name in self.es_inputs}

        self.celery_task = wrapper_task.s(
            generate_cv_folds,
            exp,
            self,
            folds_num=self.folds_num,
            repeats_num=self.repeats_num,
            es_dict=es_dict,
            inner_output_es_names_map=self.inner_output_es_names_map,
            success_action="on_folds_generation_success",
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 38
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        train_es = self.get_input_var("train_es")
        test_es = self.get_input_var("test_es")

        gene_sets = self.get_input_var("gs")

        self.celery_task = wrapper_task.s(
            agg_task_cv,
            exp, self,
            train_es=train_es,
            test_es=test_es,
            gene_sets=gene_sets,
            method=self.agg_method,
            base_filename="%s_%s_agg" % (self.uuid, "pca_cv")
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 39
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        train_es = self.get_input_var("train_es")
        test_es = self.get_input_var("test_es")

        gene_sets = self.get_input_var("gs")

        self.celery_task = wrapper_task.s(
            agg_task_cv,
            exp, self,
            train_es=train_es,
            test_es=test_es,
            gene_sets=gene_sets,
            method=self.agg_method,
            base_filename="%s_%s_agg" % (self.uuid, "pca_cv")
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 40
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        exp.log(self.uuid, "Execute called")

        self.celery_task = wrapper_task.s(
            pattern_search,
            exp, self,
            m_rna_es = self.get_input_var("mRNA"),
            mi_rna_es = self.get_input_var("miRNA"),
            gene2gene=self.get_input_var("gene2gene"),
            miRNA2gene=self.get_input_var("miRNA2gene"),
            radius=self.d,
            min_imp=self.min_imp,
            metric=self.get_input_var("metric"),
            base_filename="%s_comodule_sets" % self.uuid,
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 41
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        mRNA_es = self.get_input_var("mRNA_es")
        miRNA_es = self.get_input_var("miRNA_es")
        interaction_matrix = self.get_input_var("interaction")

        self.celery_task = wrapper_task.s(
            aggregation_task,
            exp, self,
            mode=self.mode,
            c=self.c,
            m_rna_es=mRNA_es,
            mi_rna_es=miRNA_es,
            interaction_matrix=interaction_matrix,
            base_filename="%s_%s_agg" % (self.uuid, self.mode)
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 42
0
 def execute(self, exp, *args, **kwargs):
     # self.celery_task = wrapper_task.s(
     #
     # )
     self.inner_output_manager.reset()
     es_dict = {
         inp_name: self.get_input_var(inp_name)
         for inp_name in self.es_inputs
     }
     self.celery_task = wrapper_task.s(
         prepare_folds,
         exp,
         self,
         features=self.features,
         es_dict=es_dict,
         inner_output_es_names_map=self.inner_output_es_names_map,
         success_action="on_folds_generation_success")
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 43
0
 def execute(self, exp, *args, **kwargs):
     # self.celery_task = wrapper_task.s(
     #
     # )
     self.inner_output_manager.reset()
     es_dict = {
         inp_name: self.get_input_var(inp_name)
         for inp_name in self.es_inputs
     }
     self.celery_task = wrapper_task.s(
         prepare_folds,
         exp, self,
         features=self.features,
         es_dict=es_dict,
         inner_output_es_names_map=self.inner_output_es_names_map,
         success_action="on_folds_generation_success"
     )
     exp.store_block(self)
     self.celery_task.apply_async()
Ejemplo n.º 44
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        exp.log(self.uuid, "Execute called")

        self.celery_task = wrapper_task.s(
            pattern_search,
            exp,
            self,
            m_rna_es=self.get_input_var("mRNA"),
            mi_rna_es=self.get_input_var("miRNA"),
            gene2gene=self.get_input_var("gene2gene"),
            miRNA2gene=self.get_input_var("miRNA2gene"),
            radius=self.d,
            min_imp=self.min_imp,
            number_of_genes=self.genes_num,
            metric=self.get_input_var("metric"),
            base_filename="%s_comodule_sets" % self.uuid,
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 45
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()

        self.inner_output_manager.reset()
        es_dict = {
            inp_name: self.get_input_var(inp_name)
            for inp_name in self.es_inputs
        }

        self.celery_task = wrapper_task.s(
            generate_cv_folds,
            exp,
            self,
            folds_num=self.folds_num,
            repeats_num=self.repeats_num,
            es_dict=es_dict,
            inner_output_es_names_map=self.inner_output_es_names_map,
            success_action="on_folds_generation_success",
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 46
0
    def process_upload(self, exp, *args, **kwargs):
        """
            @param exp: Experiment
        """
        self.clean_errors()
        try:
            if len(self.pheno_matrices) != len(self.es_mRNA_matrices):
                raise RuntimeError("Different number of phenotypes and mRNA expression sets")
            if self.es_miRNA_matrices:
                if len(self.pheno_matrices) != len(self.es_miRNA_matrices):
                    raise RuntimeError("Different number of phenotypes and miRNA expression sets")
            self.labels = es_mRNA_matrix_names = sorted(self.es_mRNA_matrices)
            es_miRNA_matrix_names = sorted(self.es_miRNA_matrices)
            pheno_matrix_names = sorted(self.pheno_matrices)
            if len(es_miRNA_matrix_names) == 0:
                es_miRNA_matrix_names = len(es_mRNA_matrix_names) * [None]
            self.pheno_by_es_names = {
                pheno_name: es_name for
                es_name, pheno_name
                in zip(zip(es_mRNA_matrix_names, es_miRNA_matrix_names), pheno_matrix_names)
            }

            self.clean_errors()
            self.celery_task = wrapper_task.s(
                bunch_upload_task,
                exp,
                self,
                success_action="processing_done",
                error_action="error_on_processing"
            )
            exp.store_block(self)
            self.celery_task.apply_async()
        except Exception as e:
            exp.log(self.uuid, e, severity="CRITICAL")
            log.exception(e)
            self.errors.append(e)
            self.do_action("error_on_processing", exp, e)
Ejemplo n.º 47
0
    def execute(self, exp, *args, **kwargs):
        self.clean_errors()
        mRNA = self.get_input_var("mRNA")
        miRNA = self.get_input_var("miRNA")
        #DNAmethyl = self.get_input_var("DNAmethyl")
        Gene2Gene = self.get_input_var("Gene2Gene")
        miRNA2gene = self.get_input_var("miRNA2gene")
        #Gene2DNAmethyl = self.get_input_var("Gene2DNAmethyl")

        self.celery_task = wrapper_task.s(
            nimfa_snmnmf_task,
            exp,
            self,
            mRNA=mRNA,
            miRNA=miRNA,
            #DNAmethyl = DNAmethyl,
            gene2gene=Gene2Gene,
            miRNA2gene=miRNA2gene,
            #gene2DNAmethylation = Gene2DNAmethyl,
            params={'l1': self.l1, 'l2': self.l2, 'g1': self.g1, 'g2': self.g2, 'rank': self.rank},
            base_filename="%s_nimfa_snmnmf" % self.uuid
        )
        exp.store_block(self)
        self.celery_task.apply_async()
Ejemplo n.º 48
0
 def process_upload(self, exp, *args, **kwargs):
     self.clean_errors()
     self.celery_task = wrapper_task.s(user_upload_complex_task, exp, self)
     exp.store_block(self)
     self.celery_task.apply_async()