Skip to content

Commit

Permalink
Note pathways in tooltip for interacting genes
Browse files Browse the repository at this point in the history
  • Loading branch information
eweitz committed May 8, 2020
1 parent 58b932e commit 0198e9b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion examples/vanilla/related-genes.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ <h1>Related genes | Ideogram</h1>

let annots = [];
let geneList = Object.keys(interactions);
const pathwaysBase = 'https://www.wikipathways.org/index.php/Pathway:';

if (geneList.length === 0) return annots

Expand All @@ -276,7 +277,20 @@ <h1>Related genes | Ideogram</h1>
color: 'purple'
}
annots.push(annot)
annotDescriptions[hit.symbol] = hit.name;

const ixns = interactions[hit.symbol];

const links = ixns.map(ixn => {
const url = `${pathwaysBase}${ixn.pathwayId}`
return `<a href="${url}" target="_blank">${ixn.name}</a>`;
}).join('<br/>')

const description = `
${hit.name}<br/><br/>
Interacts in pathways:<br/>
${links}`;

annotDescriptions[hit.symbol] = description;
})

return annots;
Expand Down

0 comments on commit 0198e9b

Please sign in to comment.