Exemplo n.º 1
0
def extract_figure3_data(input_folder: pathlib.Path,
                         output_folder: pathlib.Path) -> None:
    # STEP1: Loop through each DC method
    for dc_method in DC_METHODS:
        workflow = "denoise_cluster"
        module = dc_method
        process = "hashed_output"
        # STEP2: Extract the data
        output_subfolder = output_folder / module
        extract_data(input_folder, workflow, module, process, "",
                     output_subfolder)
def extract_figure4_data(input_folder: pathlib.Path,
                         output_folder: pathlib.Path) -> None:
    # STEP1: Loop through each TA method
    for ta_method in TA_METHODS:
        workflow = "tax_assignment"
        module = ta_method
        process = "taxonomy_tables"
        prev_process = "dada2-remove_bimera"
        # STEP2: Extract the data
        output_subfolder = output_folder / module
        extract_data(input_folder, workflow, module, process, prev_process,
                     output_subfolder)
Exemplo n.º 3
0
def extract_figure5_data(input_folder: pathlib.Path,
                         output_folder: pathlib.Path) -> None:
    # STEP1: Loop through each NI method
    for ni_type, ni_method in NI_METHODS:
        workflow = "network_inference"
        module = "network"
        process = make_process_string((ni_type, ni_method))
        prev_process = make_prevprocess_string(
            DC="dada2",
            CC="remove_bimera",
            TA="naive_bayes(gg_13_8_99)",
            OP="normalize_filter(on)",
            GROUP="group(Genus)",
            NI=ni_method,
        )
        # STEP2: Extract the data
        output_subfolder = output_folder / ni_method
        extract_data(input_folder, workflow, module, process, prev_process,
                     output_subfolder)
    def load_all_data(self):
        try:
            load_files=return_checked_values(self.listView_files)
        except Exception:
#            QtWidgets.QMessageBox.warning(self, 'Select a motor, propeller and plane.',
#                                            "The system of interest must be selected (different to being checked).",
#                                            QtWidgets.QMessageBox.Ok)
            return
        for file in load_files:
            if file in self.current_data_files:
                continue
            data_file=self.file_folder+"/" + file + ".csv"
            loaded_data=data_extraction.extract_data(data_file)
            self.current_data.append(loaded_data)
            self.current_data_files.append(file)
        self.pop_combo_box()
        return
def extract_step_data(step: str, input_folder: pathlib.Path,
                      output_folder: pathlib.Path):
    workflow = "network_inference"
    module = "network"
    default_dc = DEFAULT["DC"]
    default_cc = DEFAULT["CC"]
    default_ta = DEFAULT["TA"]
    default_op = DEFAULT["OP"]
    group_level = GROUP_LEVEL

    method_dict = dict()
    method_dict["GROUP"] = group_level
    if step == "default":
        method_dict["DC"] = default_dc
        method_dict["CC"] = default_cc
        method_dict["TA"] = default_ta
        method_dict["OP"] = default_op
        loop_list_1 = DC_METHODS
        loop_list_2 = NI_METHODS
    elif step == "DC":
        method_dict["CC"] = default_cc
        method_dict["TA"] = default_ta
        method_dict["OP"] = default_op
        loop_list_1 = DC_METHODS
        loop_list_2 = NI_METHODS
    elif step == "CC":
        method_dict["DC"] = default_dc
        method_dict["TA"] = default_ta
        method_dict["OP"] = default_op
        loop_list_1 = CC_METHODS
        loop_list_2 = NI_METHODS
    elif step == "TA":
        method_dict["DC"] = default_dc
        method_dict["CC"] = default_cc
        method_dict["OP"] = default_op
        loop_list_1 = TA_METHODS
        loop_list_2 = NI_METHODS
    elif step == "OP":
        method_dict["DC"] = default_dc
        method_dict["CC"] = default_cc
        method_dict["TA"] = default_ta
        loop_list_1 = OP_METHODS
        loop_list_2 = NI_METHODS
    elif step == "NI":
        method_dict["DC"] = default_dc
        method_dict["CC"] = default_cc
        method_dict["TA"] = default_ta
        method_dict["OP"] = default_op
        loop_list_1 = [m[1] for m in NI_METHODS]
        loop_list_2 = NI_METHODS
    else:
        raise ValueError(f"Unsupported step {step}")
    if step != "default":
        for method in loop_list_1:
            if method != DEFAULT[step]:
                method_dict[step] = method
                output_sub_folder = output_folder / method
                for ni_type, ni_method in loop_list_2:
                    if step == "NI" and ni_method != method:
                        continue
                    method_dict["NI"] = ni_method
                    process = make_process_string((ni_type, ni_method))
                    previous_process = make_prevprocess_string(**method_dict)
                    extract_data(
                        input_folder,
                        workflow,
                        module,
                        process,
                        previous_process,
                        output_sub_folder,
                    )
    else:
        output_sub_folder = output_folder / "default"
        for ni_type, ni_method in loop_list_2:
            method_dict["NI"] = ni_method
            process = make_process_string((ni_type, ni_method))
            previous_process = make_prevprocess_string(**method_dict)
            extract_data(
                input_folder,
                workflow,
                module,
                process,
                previous_process,
                output_sub_folder,
            )
Exemplo n.º 6
0
def extract_step_data(process: str, input_folder: pathlib.Path,
                      output_folder: pathlib.Path) -> None:
    workflow = "network_inference"
    module = "network"
    extract_data(input_folder, workflow, module, process, "", output_folder)
Exemplo n.º 7
0
# This script extracts NYSE (New York Stock Exchange) prices
# Author: fedimser

from data_extraction import extract_data

with open('nyse_symbols.txt') as f:
    nyse_symbols = [line.split()[0] for line in f.readlines()][1:]

extract_data(nyse_symbols[::50], dataset_name='nyse_each_50')
#extract_data(nyse_symbols[::10], dataset_name='nyse_each_10')
#extract_data(nyse_symbols, dataset_name='nyse')
 def load_data(self, file):
     data_file=self.file_folder+file
     print(data_file)
     loaded_data=data_extraction.extract_data(data_file)
     return loaded_data