Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mondo cross mappings into mapping commons #41

Open
matentzn opened this issue Nov 20, 2023 · 0 comments
Open

Add mondo cross mappings into mapping commons #41

matentzn opened this issue Nov 20, 2023 · 0 comments
Assignees

Comments

@matentzn
Copy link
Member

Right now, Mondo mappings are MONDO ids to external. We would like to add external-external mappings to the Monarch mapping commons. Here is some code using semra that can roughly achieve this but may need tweaks.

import pandas as pd
from semra.api import infer_chains, infer_reversible
from semra.io import from_sssom_df, get_sssom_df

data = [
    ["UBERON:1", "skos:exactMatch", "FBbt:9"],
    ["UBERON:1", "skos:exactMatch", "WBbt:6"],
]

# replace the following with mondo mappings
df = pd.DataFrame(data=data, columns=["subject_id", "predicate_id", "object_id"])

mappings = from_sssom_df(df, mapping_set_name="test")
mappings = infer_reversible(mappings, progress=False)
mappings = infer_chains(mappings, progress=False)

df = get_sssom_df(mappings)
msdf = MappingSetDataFrame(df=df, converter=get_converter())
msdf.standardize_references()
msdf.clean_prefix_map()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants