Skip to content

Commit

Permalink
Add lexical matching command to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Sep 3, 2024
1 parent 0413f08 commit c858992
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/scripts/upheno_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,47 @@ def compute_upheno_statistics(upheno_config, pattern_directory, stats_directory,
stats_dir=stats_directory)


@upheno.command()
@click.option(
"--species-lexical",
"-s",
metavar="FILE",
required=True,
help="Species lexical file",
type=click.types.Path(),
)
@click.option(
"--mapping-logical",
"-m",
metavar="FILE",
required=True,
help="Mapping logical file",
type=click.types.Path(),
)
@click.option(
"--phenotypic-effect-terms",
"-p",
default=["abnormally", "abnormal", "aberrant", "variant"],
show_default=True,
multiple=True,
type=click.Choice(["abnormally", "abnormal", "aberrant", "variant"], case_sensitive=False),
help="Phenotypic Effect Terms: The terms passed in this parameter will be removed and the word 'abnormal' will be prepended the label",
)
@click.option(
"--output",
"-o",
metavar="FILE",
required=True,
help="Output Folder",
type=click.types.Path(),
)
def generate_cross_species_mappings(
species_lexical: click.Path, mapping_logical: click.Path, phenotypic_effect_terms: List[str], output: click.Path
) -> None:
"""Command to generate cross species mappings"""
lm = LexicalMapping(species_lexical, mapping_logical, stopwords=phenotypic_effect_terms)
lm.generate_mapping_files(output)

# Subcommand: help
@upheno.command()
@click.pass_context
Expand Down

0 comments on commit c858992

Please # to comment.