-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
160 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Cell and Cell Line Lexicon | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import semra | ||
import biolexica | ||
from pathlib import Path | ||
|
||
HERE = Path(__file__).parent.resolve() | ||
TERMS_PATH = HERE.joinpath("terms.tsv.gz") | ||
|
||
PRIORITY = ["mesh", "efo", "cellosaurus", "ccle", "depmap", "bto", "cl", "clo"] | ||
BIOLEXICA_CONFIG = [ | ||
biolexica.Input(source="mesh", processor="pyobo", ancestors=["mesh:D002477"]), # cells | ||
biolexica.Input(source="efo", processor="pyobo", ancestors=["efo:0000324"]), | ||
biolexica.Input(source="cellosaurus", processor="pyobo"), | ||
# Input(source="ccle", processor="pyobo"), | ||
biolexica.Input(source="bto", processor="pyobo"), | ||
biolexica.Input(source="cl", processor="pyobo"), | ||
biolexica.Input(source="clo", processor="pyobo"), | ||
] | ||
|
||
SEMRA_CONFIG = semra.Configuration( | ||
name="Cell and Cell Line Mappings", | ||
description="Originally a reproduction of the EFO/Cellosaurus/DepMap/CCLE scenario " | ||
"posed in the Biomappings paper, this configuration imports several different cell and " | ||
"cell line resources and identifies mappings between them.", | ||
inputs=[ | ||
semra.Input(source="biomappings"), | ||
semra.Input(source="gilda"), | ||
semra.Input(prefix="cellosaurus", source="pyobo", confidence=0.99), | ||
semra.Input(prefix="bto", source="bioontologies", confidence=0.99), | ||
semra.Input(prefix="cl", source="bioontologies", confidence=0.99), | ||
semra.Input(prefix="clo", source="custom", confidence=0.99), | ||
semra.Input(prefix="efo", source="pyobo", confidence=0.99), | ||
semra.Input( | ||
prefix="depmap", | ||
source="pyobo", | ||
confidence=0.99, | ||
extras={"version": "22Q4", "standardize": True, "license": "CC-BY-4.0"}, | ||
), | ||
semra.Input( | ||
prefix="ccle", | ||
source="pyobo", | ||
confidence=0.99, | ||
extras={"version": "2019"}, | ||
), | ||
], | ||
add_labels=False, | ||
priority=PRIORITY, | ||
keep_prefixes=PRIORITY, | ||
remove_imprecise=False, | ||
mutations=[ | ||
semra.Mutation(source="efo", confidence=0.7), | ||
semra.Mutation(source="bto", confidence=0.7), | ||
semra.Mutation(source="cl", confidence=0.7), | ||
semra.Mutation(source="clo", confidence=0.7), | ||
semra.Mutation(source="depmap", confidence=0.7), | ||
semra.Mutation(source="ccle", confidence=0.7), | ||
semra.Mutation(source="cellosaurus", confidence=0.7), | ||
], | ||
raw_pickle_path=HERE.joinpath("mappings_raw.pkl.gz"), | ||
processed_pickle_path=HERE.joinpath("mappings_processed.pkl.gz"), | ||
priority_pickle_path=HERE.joinpath("mappings_prioritized.pkl"), | ||
) | ||
|
||
|
||
def _main() -> None: | ||
mappings = SEMRA_CONFIG.get_mappings() | ||
biolexica.assemble_terms( | ||
inputs=BIOLEXICA_CONFIG, | ||
mappings=mappings, | ||
output_path=TERMS_PATH, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
_main() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import semra | ||
import biolexica | ||
from pathlib import Path | ||
|
||
HERE = Path(__file__).parent.resolve() | ||
TERMS_PATH = HERE.joinpath("terms.tsv.gz") | ||
|
||
PRIORITY = [ | ||
"doid", | ||
"mondo", | ||
"hp", | ||
"symp", | ||
"mesh", | ||
"efo", | ||
] | ||
BIOLEXICA_CONFIG = [ | ||
biolexica.Input(source="doid", processor="pyobo"), | ||
biolexica.Input(source="mondo", processor="pyobo"), | ||
biolexica.Input(source="hp", processor="pyobo"), | ||
biolexica.Input(source="symp", processor="pyobo"), | ||
# TODO get subsets of MeSH (C for diseases, F for Psychiatry/Psychology, | ||
# and maybe others. See https://meshb.nlm.nih.gov/treeView) | ||
biolexica.Input(source="mesh", processor="pyobo"), | ||
biolexica.Input(source="efo", processor="pyobo"), # TODO find subset of EFO | ||
# biolexica.Input(source="umls", processor="pyobo"), # TODO find subset of UMLS | ||
# biolexica.Input(source="ncit", processor="pyobo"), # TODO find subset of NCIT | ||
] | ||
|
||
SEMRA_CONFIG = semra.Configuration( | ||
name="Cell and Cell Line Mappings", | ||
description="Originally a reproduction of the EFO/Cellosaurus/DepMap/CCLE scenario " | ||
"posed in the Biomappings paper, this configuration imports several different cell and " | ||
"cell line resources and identifies mappings between them.", | ||
inputs=[ | ||
semra.Input(source="biomappings"), | ||
semra.Input(source="gilda"), | ||
semra.Input(prefix="doid", source="pyobo", confidence=0.99), | ||
semra.Input(prefix="mondo", source="pyobo", confidence=0.99), | ||
semra.Input(prefix="hp", source="pyobo", confidence=0.99), | ||
semra.Input(prefix="symp", source="pyobo", confidence=0.99), | ||
semra.Input(prefix="mesh", source="pyobo", confidence=0.99), | ||
semra.Input(prefix="efo", source="pyobo", confidence=0.99), | ||
], | ||
add_labels=False, | ||
priority=PRIORITY, | ||
keep_prefixes=PRIORITY, | ||
remove_imprecise=False, | ||
mutations=[ | ||
semra.Mutation(source="doid", confidence=0.7), | ||
semra.Mutation(source="mondo", confidence=0.7), | ||
semra.Mutation(source="hp", confidence=0.7), | ||
semra.Mutation(source="symp", confidence=0.7), | ||
], | ||
raw_pickle_path=HERE.joinpath("mappings_raw.pkl.gz"), | ||
processed_pickle_path=HERE.joinpath("mappings_processed.pkl.gz"), | ||
priority_pickle_path=HERE.joinpath("mappings_prioritized.pkl"), | ||
) | ||
|
||
|
||
def _main() -> None: | ||
mappings = SEMRA_CONFIG.get_mappings() | ||
biolexica.assemble_terms( | ||
inputs=BIOLEXICA_CONFIG, | ||
mappings=mappings, | ||
output_path=TERMS_PATH, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
_main() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters