Skip to content

Commit

Permalink
Merge pull request #745 from SynBioHub/sequencesbol3
Browse files Browse the repository at this point in the history
added sequence for sbol3, added a different variation of encoding for…
  • Loading branch information
danielfang97 authored Sep 2, 2024
2 parents ae16727 + 43ef2d7 commit a77cfaa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default function SectionRenderer({ section, metadata }) {
}
})
}
console.log(section.text);
if (/SO:\s*(\d{7})/.test(section.text)) {
for (let key in sequenceOntology) {
if (section.text === key) {
Expand All @@ -96,7 +97,13 @@ export default function SectionRenderer({ section, metadata }) {
}
}
}
if (/http:\/\/edamontology\.org\/format_\d{4}/.test(section.text)) {
if (/^(http:\/\/edamontology\.org\/format_\d{4}|edam:format_\d{4})$/.test(section.text)) {
// Normalize the section.text to the full URL format
if (/^edam:format_\d{4}$/.test(section.text)) {
section.text = section.text.replace(/^edam:format_(\d{4})$/, 'http://edamontology.org/format_$1');
}

// Now proceed with checking against the keys in edamOntology
for (let key in edamOntology) {
if (section.text === key) {
section.text = edamOntology[key];
Expand Down
1 change: 0 additions & 1 deletion frontend/components/Viewing/PageJSON/Types/Sequence.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
{
"title": "Encoding",
"stripAfter": "/",
"text": "Encoding",
"predicates": [
],
"link": "$<encodingLink>"
Expand Down
50 changes: 31 additions & 19 deletions frontend/components/Viewing/PageJSON/Types/Sequence3.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,39 @@
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>",
"PREFIX purl: <http://purl.obolibrary.org/obo/>"
],
"metadata": [],
"metadata": [
{
"title": "Encoding",
"rootPredicate": "sbol:encoding",
"icon": "faCode",
"sections": [
{
"title": "Encoding",
"stripAfter": "/",
"predicates": [
],
"link": "$<encodingLink>"
},
{
"title": "encodingLink",
"predicates": [],
"hide": true
}
]
}
],
"tables": [
{
"icon": "faDna",
"title": "Sequence",
"rootPredicate": "sbol:elements",
"sections": [
{
"title": "Sequence",
"infoLink": "$<Encoding>",
"predicates": []
},
{
"title": "Encoding",
"rootPredicateOverride": "sbol:encoding",
"predicates": [
"rdf:resource"
],
"hide": true
}
]
"icon": "faDna",
"title": "Sequence",
"rootPredicate": "sbol:elements",
"sections": [
{
"title": "Sequence",
"infoLink": "https://sbols.org/v3#sequence",
"predicates": []
}
]
}
],
"pages": [
Expand Down

0 comments on commit a77cfaa

Please sign in to comment.