diff --git a/README.md b/README.md index f78e361..d8c474b 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,6 @@ pip install text2term ``` ## Basic Examples -
- Examples of Programmatic Mapping - ### Examples of Programmatic Mapping text2term supports mapping strings specified in multiple input formats. In the first example, we map strings in a list to an ontology specified by its URL: @@ -40,10 +37,6 @@ dfd = text2term.map_terms(source_terms={"asthma":"disease", "acute bronchitis":[ target_ontology="http://purl.obolibrary.org/obo/mondo.owl") ``` -
- -
- Examples of Programmatic Caching ### Examples of Programmatic Caching text2term supports caching an ontology for repeated use. Here we cache an ontology and give it a name: @@ -63,12 +56,8 @@ More succinctly, we can use the returned `OntologyCache` object `mondo` as such: ```python dfo = mondo.map_terms(source_terms=["asthma", "acute bronchitis"]) ``` -
-
- Examples of Command Line Interface Use - ### Examples of Command Line Interface Use To show a help message describing all arguments type into a terminal: ```shell @@ -117,8 +106,6 @@ Now the ontology is cached and we can refer to it as the target ontology using t python text2term -s test/unstruct_terms.txt -t MONDO ``` -
- ## Programmatic Usage After installing and importing to a Python environment, the main function is `map_terms`: @@ -142,9 +129,6 @@ text2term.map_terms(source_terms, ``` The function returns a pandas `DataFrame` containing the generated ontology mappings. -
- Argument Details - ### Argument Details `source_terms`—Strings to be mapped to an ontology, which can be specified as a: @@ -188,10 +172,6 @@ When using the BioPortal or Zooma interfaces, the value for `target_ontology` sh `incl_unmapped`—Include unmapped terms in the output. If a term has been tagged 'Ignore' or has less than the `min_score`, it is included in the output data frame -
- -
- Ontology Caching ### Ontology Caching text2term supports caching ontologies for faster or repeated mapping to the same ontology. An ontology can be cached using the function: @@ -217,14 +197,12 @@ text2term.clear_cache(ontology_acronym='') If no arguments are specified, the entire cache will be cleared. Otherwise, only the ontology with the given acronym will be cleared. Finally, `cache_exists(ontology_acronym='')` is a simple function that returns `True` if the given acronym exists in the cache, and `False` otherwise. -**_Notes:_** -- The `cache_ontology` function returns an object that can be used to directly call the `map_terms` function, as well as `clear_cache` and `cache_exists`. These have the same arguments, except `ontology_target` is no longer specified and there is no `use_cache` option, since it is always True. -- While ontology URLs can be repeatedly used, acronyms must be distinct in a given environment. +> [!NOTE] +> The `cache_ontology` function returns an object that can be used to directly call the `map_terms` function, as well as `clear_cache` and `cache_exists`. These have the same arguments, except `ontology_target` is no longer specified and there is no `use_cache` option, since it is always True. -
+> [!CAUTION] +> While ontology URLs can be repeatedly used, acronyms must be distinct in a given environment. -
- Input Preprocessing ### Input Preprocessing text2term includes regular expression-based preprocessing functionality for input terms. There are functions that take the input terms and a collection of (user-defined) regular expressions, then match each term to each regular expression to simplify the input term. @@ -252,7 +230,6 @@ When the input to text2term is a table, any rows that contain `NA` values in the If an ignore tag `"ignore"` or `"Ignore"` is added to a term, that term will not be mapped to any terms in the ontology. It will only be included in the output if the `incl_unmapped` argument is True. The following values are regarded as ignore tags: `"ignore", "Ignore". -
## Command Line Interface Usage @@ -269,8 +246,6 @@ To display a help message with descriptions of tool arguments do: `-t TARGET` Path or URL of 'target' ontology to map source terms to. When the chosen mapper is BioPortal or Zooma, provide a comma-separated list of acronyms (eg 'EFO,HPO') or write `'all'` to search all ontologies -
- Optional Arguments ### Optional Arguments @@ -298,8 +273,6 @@ To display a help message with descriptions of tool arguments do: `-u` Include all unmapped terms in the output -
- ## Supported Mappers