Skip to content
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
4 changes: 3 additions & 1 deletion client/src/components/EdgeTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default function EdgeTab({
setInteractionSource("BioGRID");
} else if (source === "tf-link") {
setInteractionSource("TFLink");
} else if (source === "atrm") {
setInteractionSource("ATRM");
} else {
setInteractionSource("");
}
Expand All @@ -67,7 +69,7 @@ export default function EdgeTab({
return evidence.split(";").map(i => `https://pubmed.ncbi.nlm.nih.gov/${i}`);
} else if (evidence.startsWith("WB")) {
return [`http://api.wormbase.org/species/all/interaction/${evidence}`];
} else {
} else {
return [];
}
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function Footer() {
return (
<div className="footer-container">
<footer className="footer">
<p className="footer-title">ProteinWeaver © 2023</p>
<p className="footer-title">ProteinWeaver © 2025</p>
{/* Terms of Service */}
<Link to={"/tos"}>TOS</Link>
<p> | </p>
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/GraphSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function GraphSummary({
setSourceNodeLink(
`https://bsubcyc.org/gene?orgid=BSUB&id=${sourceNode.id.replace('_', '')}#tab=GO`
);
} else if (txid === "txid7955" || txid === "txid559292") {
} else if (txid === "txid7955" || txid === "txid559292" || txid === "txid3702") {
setSourceNodeLink(
`https://www.uniprot.org/uniprotkb/${sourceNode.id}/entry#function`
);
Expand All @@ -59,7 +59,7 @@ export default function GraphSummary({
`https://amigo.geneontology.org/amigo/gene_product/WB:${sourceNode.id}`
);
}
}, [txid]);
}, [searchExecuted]);

// Keep track of the proteins in the query
useEffect(() => {
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/MotifTab.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import React, { useState, useEffect } from "react";
import MotifTable from "./MotifTable";


// Constants for motif enrichment scores
// Format { "txidXXXX" : [(N.proteinClique/global.ppiDegree), (N.interactCoReg/global.mixedDegree), (N.feedFwdLoop/global.grnDegree), (N.coRegInteract/global.mixedDegree), (N.mixedFeedback/global.mixedDegree)] }
const txidMapping = {
"txid7227": [(1267922 / 466108), (5049 / 501168), (3706 / 35060), (3236 / 501168), (1439 / 501168)],
"txid224308": [(43088 / 12882), (164 / 24150), (972 / 11268), (1359 / 24150), (65 / 24150)],
"txid7955": [(319540 / 90006), (960 / 141926), (2257 / 51920), (523 / 141926), (14 / 141926)],
"txid559292": [(1816919 / 328864), (171664 / 803494), (1036451 / 474630), (522163 / 803494), (76231 / 803494)],
"txid6239": [(16880 / 27830), (28856 / 184276), (457362 / 156446), (82309 / 184276), (18579 / 184276)],
"txid3702": [(318826 / 102768), (215 / 105518), (158 / 2750), (78 / 105518), (47 / 105518)]
};

export default function MotifTab({ nodeList, query, searchExecuted }) {
Expand Down
13 changes: 12 additions & 1 deletion client/src/components/NodeTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function NodeTab({ currentNode, query, goTerm, predictionValue, s
"txid7955": `https://www.uniprot.org/uniprotkb/${currentNode.id}/entry`,
"txid559292": `https://www.uniprot.org/uniprotkb/${currentNode.id}/entry`,
"txid6239": `https://www.wormbase.org/species/c_elegans/gene/${currentNode.id}`,
"txid3702": `https://www.uniprot.org/uniprotkb/${currentNode.id}/entry`,
};
setSelectedDbLink(speciesLinkMap[txid] || "");
}
Expand Down Expand Up @@ -53,6 +54,16 @@ export default function NodeTab({ currentNode, query, goTerm, predictionValue, s
Alternate Name(s): {currentNode.alt_name}
</h5>
)}
{currentNode.alt_id && currentNode.alt_id !== currentNode.label && (
<h5 className="node-tab-text">
Alternate ID(s): {currentNode.alt_id}
</h5>
)}
{currentNode.alt_gene_id && currentNode.alt_gene_id !== currentNode.label && (
<h5 className="node-tab-text">
Alternate Gene ID(s): {currentNode.alt_gene_id}
</h5>
)}
<Degree id={currentNode.id} />
<h5 className="node-tab-text">
Prediction Rank: {predictionValue.rank}
Expand All @@ -76,7 +87,7 @@ export default function NodeTab({ currentNode, query, goTerm, predictionValue, s
</p>
) : (
<p className="go-annotation-info">
*{currentNode.label} is <b>{currentNode.go_protein.replaceAll("_", " ")}</b> {goTerm.name}.
*{currentNode.label} is <b>{currentNode.go_protein?.replaceAll("_", " ") || "unavailable"}</b> {goTerm.name}.
</p>
)}
</div>
Expand Down
46 changes: 45 additions & 1 deletion client/src/components/Query.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,12 @@ export default function Query() {
const proteinNames = data.map((item) => item.name);
const proteinIds = data.map((item) => item.id);
const proteinAltNames = data.map((item) => item.alt_name);
const proteinAltIds = data.map((item) => item.alt_id);
const geneAltIds = data.map((item) => item.gene_alt_id);
const geneNames = data.map((item) => item.gene_name);
const proteinMerged = [
...new Set(
proteinNames.concat(proteinIds).concat(proteinAltNames).concat(geneNames)
proteinNames.concat(proteinIds).concat(proteinAltNames).concat(geneNames).concat(proteinAltIds).concat(geneAltIds)
),
].filter((item) => item !== undefined);
setProteinOptions(proteinMerged);
Expand Down Expand Up @@ -848,6 +850,48 @@ export default function Query() {
setExState(String(i));
break;
}
} else if (query.species == "txid3702") {
switch (i) {
case 1:
setQuery({
mode: "path",
species: "txid3702",
protein: "NPR1",
goTerm: "immune response",
k: "7",
ppi: true,
regulatory: true,
});
setActiveModeButton("path");
setExState(String(i));
break;
case 2:
setQuery({
mode: "node",
species: "txid3702",
protein: "TGA3",
goTerm: "response to stimulus",
k: "10",
ppi: true,
regulatory: true,
});
setActiveModeButton("node");
setExState(String(i));
break;
case 3:
setQuery({
mode: "node",
species: "txid3702",
protein: "RAD51",
goTerm: "homologous recombination",
k: "6",
ppi: true,
regulatory: true,
});
setActiveModeButton("node");
setExState(String(i));
break;
}
}
};

Expand Down
5 changes: 5 additions & 0 deletions client/src/components/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export default function SearchBar({
spName = "S. cerevisiae";
} else if (query.species == "txid6239") {
spName = "C. elegans";
} else if (query.species == "txid3702") {
spName = "A. thaliana";
}

return (
Expand Down Expand Up @@ -100,6 +102,9 @@ export default function SearchBar({
<option value="txid6239">
C. elegans (6239)
</option>
<option value="txid3702">
A. thaliana (3702)
</option>
</select>
</div>
<button
Expand Down
85 changes: 49 additions & 36 deletions client/src/tools/Parser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ export function NetworkParserPath(data) {
const parsedData = { nodes: [], edges: [], nodeList: [], edgeList: [] };

const getNodeLabel = (node) => {
const { name, id, alt_name, gene_name } = node.properties;
const { name, id, alt_name, gene_name, alt_id, alt_gene_id } = node.properties;
if (name && name !== "-") return name;
if (gene_name && gene_name !== "-") return gene_name;
return alt_name || id;
if (alt_name && alt_name !== "-") return alt_name;
if (id && id !== "-") return id;
if (alt_id && alt_id !== "-") return alt_id;
return alt_id || alt_gene_id;
};

const createNodeEntry = (node, nodeType, degree) => ({
data: {
id: node.properties.id,
label: getNodeLabel(node),
degree: degree.low,
alt_name: node.properties.alt_name,
gene_name: node.properties.gene_name,
alt_name: node.properties.alt_name,
alt_id: node.properties.alt_id,
alt_gene_id: node.properties.alt_gene_id,
type: nodeType,
},
});
Expand Down Expand Up @@ -140,34 +145,33 @@ export function EdgeDataParser(networkData, edgeData, ppi, regulatory) {
const sharedEdgeExists = networkData.edgeList.includes(endNode + startNode);

// Handle edge existence
if (edgeExists) {
// Handle ProPro edges
if (relType === "ProPro" && ppi && edgeExists) {
processProProEdge(startNode, endNode, relType, evidence, dataSource);
}
// Handle Reg edges
else if (relType === "Reg" && regulatory && edgeExists) {
processRegEdge(startNode, endNode, relType, evidence, dataSource, regType);
}
// Handle ProGo edges
else if (relType === "ProGo") {
processProGoEdge(startNode, properties.relationship);
if (relType === "ProGo") {
processProGoEdge(startNode, properties.relationship);
} else
if (edgeExists) {
// Handle ProPro edges
if (relType === "ProPro" && ppi && edgeExists) {
processProProEdge(startNode, endNode, relType, evidence, dataSource);
}
// Handle Reg edges
else if (relType === "Reg" && regulatory && edgeExists) {
processRegEdge(startNode, endNode, relType, evidence, dataSource, regType);
}
} else if (sharedEdgeExists) {
// Edge exists but in reversed order, label it as "shared"
if (relType === "ProPro" && ppi && sharedEdgeExists) {
processProProEdge(startNode, endNode, relType, evidence, dataSource);
} else if (relType === "Reg" && sharedEdgeExists) {
processRegEdge(startNode, endNode, relType, evidence, dataSource, regType, "shared");
}
} else if (!edgeExists) {
// Edge exists but in reversed order, label it as "shared"
if (relType === "ProPro") {
processProProEdge(startNode, endNode, relType, evidence, dataSource, "shared");
} else if (relType === "Reg") {
processRegEdge(startNode, endNode, relType, evidence, dataSource, regType, "shared");
}
}
} else if (sharedEdgeExists) {
// Edge exists but in reversed order, label it as "shared"
if (relType === "ProPro" && ppi && sharedEdgeExists) {
processProProEdge(startNode, endNode, relType, evidence, dataSource);
} else if (relType === "Reg" && sharedEdgeExists) {
processRegEdge(startNode, endNode, relType, evidence, dataSource, regType, "shared");
}
} else if (!edgeExists) {
// Edge exists but in reversed order, label it as "shared"
if (relType === "ProPro") {
processProProEdge(startNode, endNode, relType, evidence, dataSource, "shared");
} else if (relType === "Reg") {
processRegEdge(startNode, endNode, relType, evidence, dataSource, regType, "shared");
}
}
}

networkData.edgeList = tempEdgeList;
Expand All @@ -179,19 +183,24 @@ export function NetworkParserNode(data, k) {
const parsedData = { nodes: [], edges: [], nodeList: [], edgeList: [] };

const getNodeLabel = (node) => {
const { name, id, alt_name, gene_name } = node.properties;
const { name, id, alt_name, gene_name, alt_id, alt_gene_id } = node.properties;
if (name && name !== "-") return name;
if (gene_name && gene_name !== "-") return gene_name;
return alt_name || id;
if (alt_name && alt_name !== "-") return alt_name;
if (id && id !== "-") return id;
if (alt_id && alt_id !== "-") return alt_id;
return alt_id || alt_gene_id;
};

const createNodeEntry = (node, nodeType, degree) => ({
data: {
id: node.properties.id,
label: getNodeLabel(node),
degree: degree.low,
alt_name: node.properties.alt_name,
gene_name: node.properties.gene_name,
alt_name: node.properties.alt_name,
alt_id: node.properties.alt_id,
alt_gene_id: node.properties.alt_gene_id,
type: nodeType,
},
});
Expand Down Expand Up @@ -231,10 +240,14 @@ export function NetworkParserNode(data, k) {

currentPath.forEach((node, index) => {
const nodeType = determineNodeType(node, sourceId, index, currentPath.length);
const nodeEntry = createNodeEntry(node, nodeType, node.properties.degree);
addNodeIfNotExists(nodeEntry, parsedData);
if (nodeType === "go_protein" || nodeType === "go_source") {
const nodeEntry = createNodeEntry(node, nodeType, node.properties.degree, node.properties.relationship);
addNodeIfNotExists(nodeEntry, parsedData);
} else {
const nodeEntry = createNodeEntry(node, nodeType, node.properties.degree);
addNodeIfNotExists(nodeEntry, parsedData);
}
});

addEdges(currentPath, parsedData);
});

Expand Down
Loading