Skip to content

Commit 1404f3b

Browse files
committed
Remove Markdown CPTAC link, omit blank pathway annotations
1 parent 4fe5487 commit 1404f3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/js/kit/pathway-viewer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ function addHeader(pwId, pathwayJson, pathwayContainer, showClose=true) {
158158

159159
function removeCptacAssayPortalClause(inputText) {
160160
const regex = /Proteins on this pathway have targeted assays available via the \[https:\/\/assays\.cancer\.gov\/available_assays\?wp_id=WP\d+\s+CPTAC Assay Portal\]/g;
161-
return inputText.replace(regex, '');
161+
const regex2 = /Proteins on this pathway have targeted assays available via the \[CPTAC Assay Portal\]\(https:\/\/assays\.cancer\.gov\/available_assays\?wp_id=WP\d+\)/g;
162+
163+
return inputText.replace(regex, '').replace(regex2, '');
162164
}
163165

164166
function convertMediaWikiLinks(inputText) {
@@ -209,7 +211,7 @@ function getPathwayAnnotations(pathwayJson) {
209211
const keys = Object.keys(entitiesById).filter(k => k.startsWith('http://identifiers.org'));
210212
const sentenceCases = {
211213
'Cell Type': 'Cell type'
212-
}
214+
};
213215
const ontologies = [
214216
'Cell Type'
215217
// 'Disease', 'Pathway Ontology' // maybe later
@@ -226,6 +228,8 @@ function getPathwayAnnotations(pathwayJson) {
226228
const safeOntology = ontology.replaceAll(' ', '_');
227229
const cls = `class="ideoPathwayOntology__${safeOntology}"`;
228230

231+
if (links === '') return '';
232+
229233
return `<div ${cls}>${refinedOntology}: ${links}</div>`;
230234
});
231235

0 commit comments

Comments
 (0)