def prepare(args: dict, overwriting: bool):
    """Setup run by creating directories and log files.

    Args:
        args (dict): argparser arguments
        overwriting (bool): overwriting flag

    Returns:
        Tuple(DataFrame, DataFrame): Path to output and mapping_table subdirectories.
    """
    output_dir_lsh = make_dir(args, "results_tmp", "lsh_folding", overwriting)
    mapping_table_dir = make_dir(args, "mapping_table", None, overwriting)
    create_log_files(output_dir_lsh)
    create_log_files(mapping_table_dir)
    load_config(args)
    load_key(args)
    method_params_fp = ConfigDict.get_parameters()["fingerprint"]
    method_params_lsh = ConfigDict.get_parameters()["lsh"]
    method_params = {**method_params_fp, **method_params_lsh}
    key = SecretDict.get_secrets()["key"]
    lshf = LSHFoldingCalculator.from_param_dict(
        secret=key, method_param_dict=method_params, verbosity=0)
    outcols = ["fp_feat", "fp_val", "fold_id", "success", "error_message"]
    out_types = ["object", "object", "object", "bool", "object"]
    dt = DfTransformer(
        lshf,
        input_columns={"canonical_smiles": "smiles"},
        output_columns=outcols,
        output_types=out_types,
        success_column="success",
        nproc=args["number_cpu"],
        verbosity=0,
    )
    return output_dir_lsh, mapping_table_dir, dt
Exemplo n.º 2
0
def prepare(args: dict, overwriting: bool) -> Path:
    """Load config and key file,create output directories and setup log files.

    Args:
        args (dict): argparser dictionary

    Returns:
        Path: output directory path
    """

    output_dir = make_dir(args, "results_tmp", "thresholding", overwriting)
    create_log_files(output_dir)
    return output_dir
def prepare(args: dict, overwriting: bool):
    """Load config and key file,create output directories and setup log files.

    Args:
        args (dict): argparser dictionary

    Returns:
        Path: output directory path
    """

    output_dir = make_dir(args, "results_tmp", "activity_formatting",
                          overwriting)
    mapping_table_dir = make_dir(args, "mapping_table", None, overwriting)
    create_log_files(output_dir)
    return output_dir, mapping_table_dir
Exemplo n.º 4
0
def prepare(args: dict, overwriting: bool) -> Path:
    """
    Create output folder for matrices

    Args:
        args (dict): argparser dictionary
        overwriting (bool): overwriting argument

    Returns:
        Path: output path
    """
    output_dir = make_dir(args, "matrices", None, overwriting)
    results_dir = make_dir(args, "results", None, overwriting)

    create_log_files(output_dir)
    return output_dir, results_dir
Exemplo n.º 5
0
def prepare(args):
    """
    Prepare output directories and instantiate df tansformer object for scaffold based folding

    Args:
        args (dict): argparser arguments

    Returns:
        Tuple(Path, DfTransformer): Path to output directory and instatitaed DfTranfomer for sccaffold folding


    """
    output_dir = make_dir(args, "results_tmp", "folding", args["non_interactive"])
    mapping_table_dir = make_dir(args, "mapping_table", None, args["non_interactive"])

    create_log_files(output_dir)
    create_log_files(mapping_table_dir)

    load_config(args)
    load_key(args)
    key = SecretDict.get_secrets()["key"]
    method_params = ConfigDict.get_parameters()["scaffold_folding"]
    sa = ScaffoldFoldAssign.from_param_dict(
        secret=key, method_param_dict=method_params, verbosity=0
    )
    outcols = ["murcko_smiles", "sn_smiles", "fold_id", "success", "error_message"]
    out_types = ["object", "object", "int", "bool", "object"]
    dt = DfTransformer(
        sa,
        input_columns={"canonical_smiles": "smiles"},
        output_columns=outcols,
        output_types=out_types,
        success_column="success",
        nproc=args["number_cpu"],
        verbosity=0,
    )
    return output_dir, mapping_table_dir, dt