ols_lookup module

ols_lookup.calculate_overlap(str1, str2)[source]

Calculate the overlap between two strings.

Parameters: str1 (str): The first string. str2 (str): The second string.

Returns: float: The overlap between the two strings.

ols_lookup.fetch_searchStr_info(searchStr, type='class,individual', ontology_name=None)[source]

Fetch searchStr information from the EBI OLS4 API.

Parameters: searchStr (str): The search string. type (str): The type of search. Default is ‘class,individual’. ontology_name (str): The name of the ontology. Default is None.

Returns: dict: The JSON response from the API.

ols_lookup.find_best_match(part, labels)[source]

Find the best match for a given part in a list of labels.

Parameters: part (str): The part to match. labels (list): A list of labels.

Returns: str: The best match.

ols_lookup.generate_substrings(input_string)[source]

Generate all possible substrings from a given string.

Parameters: input_string (str): The input string.

Returns: list: A list of substrings.

ols_lookup.get_matching_entries(searchStr, type=None, ontology_name=None)[source]

Get matching entries for a given searchStr.

Parameters: searchStr (str): The search string. type (str): The type of search. Default is None. ontology_name (str): The name of the ontology. Default is None.

Returns: tuple: A tuple containing a list of labels and a list of entries.

ols_lookup.main(input_string, output_format, type=None, ontology_name=None)[source]

Main function to handle the input and output.

Parameters: input_string (str): The input string. output_format (str): The output format. type (str): The type of search. Default is None. ontology_name (str): The name of the ontology. Default is None.

ols_lookup.read_json_file(file_path)[source]

Read a JSON file and return the data.

Parameters: file_path (str): The path to the JSON file.

Returns: dict: The data from the JSON file.