Skip to content

Commit

Permalink
added filter to only have MONDO terms in validate result
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Aug 28, 2023
1 parent 09a2e41 commit 1cb01f2
Show file tree
Hide file tree
Showing 6 changed files with 866 additions and 706 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ tests/input/example-relation-graph.tsv.gz
**/__pycache__/**
tmp/*
!tmp/.keep
!tmp/mondo_validate.tsv
!tmp/mondo_validate*
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ tmp/mondo.db:
tmp/mondo_lexmatch.sssom.tsv: tmp/mondo.db
runoak -i sqlite:$< lexmatch -o $@ -R $(RULES_FILE)

tmp/mondo_validate.tsv: tmp/mondo.db
tmp/mondo_validate_full.tsv: tmp/mondo.db
runoak -i sqlite:$< validate -o $@

tmp/mondo_validate.tsv: tmp/mondo_validate_full.tsv
mondoqc validate $< -o $@

lexmatch: tmp/mondo_lexmatch.sssom.tsv
validate: tmp/mondo_validate.tsv
clear-tmp:
Expand Down
5 changes: 3 additions & 2 deletions src/mondolib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def main(verbose: int, quiet: bool):

@main.command("validate")
@click.argument("input")
def click_validate(input: str):
@click.option("-o", "--output", help="Output file path")
def click_validate(input: str, output:str):
"""Run the mondolib's demo command."""
validate(input)
validate(input, output)


if __name__ == "__main__":
Expand Down
7 changes: 5 additions & 2 deletions src/mondolib/main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
"""Main python file."""
import pandas as pd


def demo():
"""Define API."""
print("Hello, World!")


def validate(input: str):
def validate(input: str, output: str):
"""Validate."""
print(input)
df = pd.read_csv(input, sep="\t", index_col=None)
mondo_df = df.loc[df["subject"].str.startswith("MONDO:")]
mondo_df.to_csv(output, sep="\t", index=False)


def update():
Expand Down
Loading

0 comments on commit 1cb01f2

Please sign in to comment.