Пример #1
0
def remove_temp_file():
    removed_files = clean_temp_folder(default_temp_folder,
                                      default_temp_max_days,
                                      default_temp_max_files)
    if removed_files:
        app_logger.info(
            f"Remove temporary output files older than {default_temp_max_days} days..."
        )
        for removed_file in removed_files:
            app_logger.info(f"File removed: {removed_file}")
    else:
        app_logger.debug(f"No outdated temporary files to be removed.")
Пример #2
0
def test_input_rule(test_file):
    app_logger.debug("SETUP TESTS...")
    app_logger.info(test_file)
    in_file = None
    if test_file:
        in_file = get_abs_path(test_file)
    if not in_file:
        in_file = get_abs_path(
            r"lynx/configurations/rules/input/LipidLynxX.json")
    app_logger.info(f"Test file {in_file}")
    rule = InputRules(test_file)
    app_logger.debug(f"Got infile {in_file}")
    app_logger.debug(f"test input rule {rule.sources}")
    if rule.is_validated is False:
        raise Exception(f"FAILED: test input rule {rule.sources}")
    else:
        app_logger.info(f"PASSED: test input rule  {rule.sources}")
    app_logger.info(f"test PASSED")
Пример #3
0
def test_output_rule(test_file):
    app_logger.debug("SETUP TESTS...")
    app_logger.info(test_file)
    in_file = None
    if test_file:
        in_file = get_abs_path(test_file)
    if not in_file:
        in_file = get_abs_path(
            r"lynx/configurations/rules/output/LipidLynxX.json")
    app_logger.info(f"Test file {in_file}")
    rule = OutputRules(test_file)
    app_logger.debug(f"Got Output infile {in_file}")
    app_logger.debug(f"test Output rule {rule.nomenclature}")
    if rule.is_structure_valid is False:
        raise Exception(f"FAILED: test Rule {rule.nomenclature}")
    else:
        app_logger.info(f"PASSED: test Rule {rule.nomenclature}")
        app_logger.info(
            f"Supported LMSD classes: {rule.supported_lmsd_classes}")
    app_logger.info(f"test PASSED")
Пример #4
0
                "MOD_ELEMENTS": {
                    "H": -2
                },
                "MOD_MASS_SHIFT": 0,
            },
            "5.01_OH": {
                "MOD_CV": "OH",
                "MOD_LEVEL": 5,
                "MOD_COUNT": 1,
                "MOD_SITE": ["12"],
                "MOD_SITE_INFO": ["R"],
                "MOD_ORDER": 5.01,
                "MOD_ELEMENTS": {
                    "O": 1
                },
                "MOD_MASS_SHIFT": 16,
            },
        },
    }

    usr_mod_obj = Modifications(usr_mod_info)
    app_logger.debug(usr_mod_obj)
    mod_json = usr_mod_obj.to_json()

    usr_sum_mods_obj = merge_mods([usr_mod_obj, usr_mod_obj])

    app_logger.debug(usr_sum_mods_obj)
    sum_mod_json = usr_sum_mods_obj.to_json()

    app_logger.info("FINISHED")
Пример #5
0
                        "MOD_MASS_SHIFT": 0,
                    },
                    "5.01_OH": {
                        "MOD_CV": "OH",
                        "MOD_LEVEL": 4,
                        "MOD_COUNT": 1,
                        "MOD_SITE": ["12"],
                        "MOD_SITE_INFO": [""],
                        "MOD_ORDER": 5.01,
                        "MOD_ELEMENTS": {
                            "O": 1
                        },
                        "MOD_MASS_SHIFT": 16,
                    },
                },
            },
            "NUM_C": 18,
            "NUM_DB": 2,
            "NUM_O": 0,
        },
    }
    # for r in usr_res_info:
    #     usr_res_obj = Residue(usr_res_info[r])
    #     logger.debug(usr_res_obj.linked_ids)
    #     # usr_res_json = res_obj.to_json()

    usr_res_obj = merge_residues(usr_res_info)
    app_logger.debug(usr_res_obj.linked_ids)
    # usr_res_json = res_obj.to_json()
    app_logger.info("FINISHED")