def cpdb_method_analysis_launcher(
        self,
        raw_meta: pd.DataFrame,
        counts: pd.DataFrame,
        counts_data: str,
        threshold: float,
        result_precision: int,
        subsampler: Subsampler = None,
    ) -> (pd.DataFrame, pd.DataFrame, pd.DataFrame):

        if threshold < 0 or threshold > 1:
            raise ThresholdValueException(threshold)
        meta = method_preprocessors.meta_preprocessor(raw_meta)

        counts = self._counts_validations(counts, meta)

        if subsampler is not None:
            counts = subsampler.subsample(counts)
            meta = meta.filter(items=list(counts), axis=0)

        interactions = self.database_manager.get_repository(
            'interaction').get_all_expanded(include_gene=False)
        genes = self.database_manager.get_repository('gene').get_all_expanded()
        complex_composition = self.database_manager.get_repository(
            'complex').get_all_compositions()
        complex_expanded = self.database_manager.get_repository(
            'complex').get_all_expanded()

        means, significant_means, deconvoluted = cpdb_analysis_method.call(
            meta, counts, counts_data, interactions, genes, complex_expanded,
            complex_composition, self.separator, threshold, result_precision)

        return means, significant_means, deconvoluted
    def cpdb_statistical_analysis_launcher(
        self,
        raw_meta: pd.DataFrame,
        counts: pd.DataFrame,
        counts_data: str,
        iterations: int,
        threshold: float,
        threads: int,
        debug_seed: int,
        result_precision: int,
        pvalue: float,
        subsampler: Subsampler = None,
    ) -> (pd.DataFrame, pd.DataFrame, pd.DataFrame, pd.DataFrame):

        if threads < 1:
            core_logger.info('Using Default thread number: %s' %
                             self.default_threads)
            threads = self.default_threads

        if threshold < 0 or threshold > 1:
            raise ThresholdValueException(threshold)

        meta = method_preprocessors.meta_preprocessor(raw_meta)
        counts = self._counts_validations(counts, meta)

        if subsampler is not None:
            counts = subsampler.subsample(counts)
            meta = meta.filter(items=(list(counts)), axis=0)

        interactions = self.database_manager.get_repository(
            'interaction').get_all_expanded(include_gene=False)
        genes = self.database_manager.get_repository('gene').get_all_expanded()
        complex_composition = self.database_manager.get_repository(
            'complex').get_all_compositions()
        complex_expanded = self.database_manager.get_repository(
            'complex').get_all_expanded()

        deconvoluted, means, pvalues, significant_means = \
            cpdb_statistical_analysis_method.call(meta,
                                                  counts,
                                                  counts_data,
                                                  interactions,
                                                  genes,
                                                  complex_expanded,
                                                  complex_composition,
                                                  iterations,
                                                  threshold,
                                                  threads,
                                                  debug_seed,
                                                  result_precision,
                                                  pvalue,
                                                  self.separator)

        return pvalues, means, significant_means, deconvoluted