-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add NCBO BioPortal link (#2654)
- Loading branch information
1 parent
bb3a3ca
commit b6c78bc
Showing
2 changed files
with
44 additions
and
13 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
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,28 @@ | ||
module CustomFilter | ||
def make_bioportal_id(obo_id) | ||
return obo_id unless obo_id.is_a?(String) | ||
|
||
# ID requirements should be locked down moving forward, so additions to this table | ||
# should be rare | ||
special_cases = { | ||
'fbbt' => 'FB-BT', | ||
'ro' => 'OBOREL', | ||
'apollo_sv' => 'APOLLO-SV', | ||
'trans' => 'PTRANS', | ||
'wbls' => 'WB-LS', | ||
'fbdv' => 'FB-DV', | ||
'wbbt' => 'WB-BT', | ||
'wbphenotype' => 'WB-PHENOTYPE', | ||
'to' => 'PTO', | ||
'fbcv' => 'FB-CV', | ||
'mod' => 'PSIMOD', | ||
'pso' => 'PLANTSO' | ||
} | ||
|
||
return special_cases[obo_id] if special_cases.key? obo_id | ||
|
||
obo_id == obo_id.downcase ? obo_id.upcase : obo_id | ||
end | ||
end | ||
|
||
Liquid::Template.register_filter(CustomFilter) |