Skip to content

Pull request for bone scaffold - final #256

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/scaffoldmaker/annotation/bone_terms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Common resource for testing annotation terms.
"""

# convention: preferred name, preferred id, followed by any other ids and alternative names
bone_terms = [
#General bones
("Cancellous bone", "ILX:0491986"),
("Cortical bone", "ILX:0745808"),
# Geometric markers for bones
("Olecranon", "UBERON:0006810","ILX:0735843"),
("Coronoid process of ulna", "UBERON:0010994","ILX:0735423"),
("Greater tubercle of radius","ILX:0745221"),
("Medial epicondyle of radius","ILX:0748959"),
("Lateral epicondyle of radius", "ILX:0748301"),
("Intercondylar eminence of tibia", "ILX:0743525"),
("Inferior articular surface of tibia", "ILX:0748099"),
("Medial surface of tibia", "ILX:0747893"),
("Lateral surface of tibia", "ILX:0742857"),

]


def get_bone_term(name : str):
"""
Find term by matching name to any identifier held for a term.
Raise exception if name not found.
:return ( preferred name, preferred id )
"""
for term in bone_terms:
if name in term:
return ( term[0], term[1] )
raise NameError("Bone annotation term '" + name + "' not found.")
Loading