OSCR

Real-time GPU-accelerated coupled cardiac system: Integrating bidirectional interactions between living optogenetic monolayers and computational simulations.

Code ↔ Paper

3 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 3 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § II. Methods › H. Quantifying communication delays in the closed-loop hardware interface ↔ ServerClient_FKModel/server.js, lines 62–119 · score 0.63 · serial port, cycle period, client, server, browser, Arduino
  2. [2] § II. Methods › I. Synchronization of camera and microcontroller ↔ ServerClient_FKModel/server.js, lines 184–234 · score 0.54 · serial port, socket.io, Arduino, LED, frame, camera
  3. [3] § II. Methods › D. Cardiac simulations ↔ ServerClient_FixedDelay/public/app/main.js, the whole file · a weak match · score 0.53 · Abubu.js, model parameters, interface, CA

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

JavaScript · 234 lines · 7.2 KB · MIT · 2 matches

  1. const net = require('net');
  2. const express = require('express');
  3. const app = express();
  4. const server = require('http').createServer(app);
  5. const io = require("socket.io")(server);//const io = require('socket.io').listen(server);
  6. const SerialPort = require("serialport");
  7. const Readline = require('@serialport/parser-readline');
  8. const serialPort = new SerialPort("COM5", { baudRate: 9600 });
  9. const parser = serialPort.pipe(new Readline({ delimiter: '\n' }));
  10. // Mac: /dev/cu.usbmodem14101
  11. // Ubuntu: /dev/ttyACM0
  12. // Win: COM3 or COM4
  13. const HOST = 'localhost';
  14. const PORTNET = 8080;
  15. const PORTIO = 8081;
  16. // const serialPort = new SerialPort("/dev/ttyACM0", { baudRate: 28800 });
  17. // Mac: /dev/cu.usbmodem14101
  18. // Ubuntu: /dev/ttyACM0
  19. // Win: COM3
  20. const fs = require('fs').promises;
  21. const fs2 = require('fs');
  22. //process.stdin.resume();
  23. // Timer:
  24. const {performance} = require('perf_hooks');
  25. var t0Net = performance.now();
  26. var t0IO = performance.now()
  27. var tNet = 0;
  28. var tIO = 0;
  29. var t0 = performance.now();
  30. var t1 = 0.;
  31. var t2 = 0.;
  32. var firstCount = 1;
  33. var cyclePeriods = [];
  34. var netArr = [];
  35. var ioArr = [];
  36. //var t0 = 0;
  37. // Shared array between the two sockets
  38. var numArray = [];
  39. var myTypedArray = [];
  40. var nums = 0;
  41. var prevNums = 0;
  42. var msgNumber = 0;
  43. var countNet = 0;
  44. var countIO = 0;
  45. var timeNet = 0;
  46. var TimeIO = 0;
  47. var stopCamera = 0;
  48. var cameraStarts = 1;
  49. // Server is listening to localhost:8081
  50. server.listen(PORTIO, function(){
  51. console.log("Web Server Started: Go to 'http://localhost:8081' in your Browser");
  52. });
  53. // Initiate Public folder (from index.html)
  54. app.use(express.static('public'));
  55. // Building the socket
  56. // ==> Everytime a browser open up the client (localhost-8081)
  57. // this function (io.on) will be called
  58. io.on("connection", function(sockIO){
  59. console.log('Client (simulation) connected')
  60. //Receive data from public
  61. sockIO.on('led', function(data) {
  62. //console.log("received: ", data.value);
  63. //send to Arduino................................................
  64. nums = data.value;
  65. if (nums !=0 ){
  66. /*if (cameraStarts == 1){
  67. //console.log("Camera Starts at ", (performance.now() - t0)/1000.);
  68. t1 = performance.now() - t0;
  69. cameraStarts = 0;
  70. } else{
  71. t2 = performance.now() - t0;
  72. cyclePeriods.push(t2 - t1);
  73. console.log("# ", countIO, ", cycle period: ", t2-t1);
  74. //var time1970 = new Date();
  75. //var thetime = time1970.getTime();
  76. //console.log(thetime);
  77. //t1=t2;
  78. countIO++;
  79. }*/
  80. //console.log("Receive HTML DATA: ", countIO);
  81. //var buf = new Buffer.alloc(8);
  82. // var numBits = 32;
  83. // var buf = new Buffer.alloc(numBits);
  84. // for (var i = 0;i<numBits;i++){
  85. // var bin = nums%2;
  86. // nums = parseInt(nums/2,10);
  87. // buf.writeUInt8(bin, i);
  88. // }
  89. // console.log(buf.toJSON());
  90. // serialPort.write(buf);
  91. console.log(countIO, ": ", nums-prevNums);
  92. //console.log("nums: ", nums, " = ", nums/33.3333, " frames");
  93. prevNums = nums;
  94. let buf = Buffer.allocUnsafe(4);
  95. buf.writeInt32LE(nums);
  96. //console.log(buf.toJSON());
  97. serialPort.write(buf);
  98. countIO++;
  99. }
  100. // var buf = new Buffer.alloc(1);
  101. // buf.writeUInt8(nums);
  102. // serialPort.write(buf);
  103. });
  104. // sockIO.on('stopCamera', function(data) {
  105. // stopCamera = data.value;
  106. // console.log("Received from simulation: ", data.value);
  107. // });
  108. // sockIO.on('startRecording', function(data){
  109. // if (data.value == 1){
  110. // console.log('Simulation starts recording at ', (performance.now()-t0)/1000.);
  111. // }
  112. // });
  113. sockIO.on('disconnect', (reason) => {
  114. console.log('Client (simulation) disconnected')
  115. });
  116. });
  117. // ------------------------TCP Socket (NET)-----------------------------------
  118. net.createServer(function(sockNet){
  119. console.log('CONNECTED: ', sockNet.remoteAddress + ':' + sockNet.remotePort);
  120. //stop the camera
  121. /*if (stopCamera == 1){
  122. sockNet.write("stopCamera\n");
  123. console.log("Stop Camera");
  124. stopCamera = 0;
  125. }*/
  126. // Recieve data from cpp
  127. sockNet.on('data', async function(data) {
  128. // This works like a loop
  129. msgNumber = JSON.parse(data);
  130. //Print the time for the first data recieved
  131. /*if (cameraStarts == 1){
  132. //console.log("Camera Starts at ", (performance.now() - t0)/1000.);
  133. t1 = performance.now() - t0;
  134. cameraStarts = 0;
  135. } else{
  136. t2 = performance.now() - t0;
  137. cyclePeriods.push(t2 - t1);
  138. console.log("# ", countNet, ", cycle period: ", t2-t1);
  139. t1=t2;
  140. countNet++;
  141. }*/
  142. if (msgNumber==1){ //first messge
  143. console.log("First MSG");
  144. var buf = new Buffer.alloc(1);
  145. buf.writeUInt8(1);
  146. serialPort.write(buf);
  147. }
  148. if (msgNumber==0){
  149. console.log("Last MSG");
  150. // var buf = new Buffer.alloc(1);
  151. // buf.writeUInt8(0);
  152. // serialPort.write(buf);
  153. let buf = Buffer.allocUnsafe(4);
  154. buf.writeInt32LE(0);
  155. //console.log(buf.toJSON());
  156. serialPort.write(buf);
  157. var finalTime = (performance.now() - t0)/1000.;
  158. var s = finalTime.toString();
  159. sockNet.write("Ended at "+s+"\n");
  160. x = cyclePeriods.join();
  161. await fs.writeFile('cycle_period.csv', x, 'utf8', function(err) {
  162. if (err) {
  163. console.log('cycle_period err');
  164. } else {
  165. console.log('cycle_period success');
  166. }
  167. });
  168. /*y = ioArr.join();
  169. await fs.writeFile('ioArr.csv', y, 'utf8', function(err) {
  170. if (err) {
  171. console.log('ioArr err');
  172. } else {
  173. console.log('ioArr success');
  174. }
  175. });*/
  176. }
  177. // console.log("data from camera: ", msgNumber);
  178. // Sending data to the socket.io
  179. io.emit('led', {value: msgNumber});
  180. // Node should return a message to cpp
  181. sockNet.write("Return String\n");
  182. });
  183. // close TCP connection
  184. sockNet.on('close', function(data) {
  185. console.log('CLOSED: ', sockNet.remoteAddress + ' ' + sockNet.remotePort);
  186. });
  187. }).listen(PORTNET, HOST);
  188. console.log('Server listening on ' + HOST + ":" + PORTNET);
  189. //-------------------------------------END Net Socket-------------------------------
  190. /*-----------------Info-----------------------
  191. 0.098-->0.05, steps = 0.051 ==> 18.32 ==> 19 iteration in refractory
  192. Real tissue: refractory = 200ms
  193. 200ms/19 = 10ms/iteration
  194. camera = 30fps = 33.33 ms per frame
  195. ----------------------------------------------*/
  196. // Read the port data
  197. serialPort.on("open", () => {
  198. console.log('serial port open-Arduino');
  199. });
  200. parser.on('data', data =>{
  201. console.log('from arduino:', data);
  202. });

server.js at commit fbef466, under MIT · at the source

Overview

  1. Department of Physiology, McGill University, Montréal, Quebec, Canada
  2. Montreal Neurological Institute, McGill University, Montréal, Quebec, Canada
  3. School of Physics, Georgia Institute of Technology, Atlanta, Georgia, United States of America
Journal: PLoS computational biology, volume 22, issue 8, article e1014590
Dates: received 21 January 2026; accepted 17 July 2026; published online 3 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pcbi.1014590 · PMID 42546041 · PMCID PMC13450847 · OpenAlex W7172322183
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: computational modeling (no new data) (modality), human (organism)
Methods: fMRI & imaging
MeSH: Heart*, Models, Cardiovascular*, Optogenetics*, Animals, Arrhythmias, Cardiac, Computational Biology, Computer Simulation, Humans, Myocytes, Cardiac (* major topic)
Journal subjects: Physical Sciences, Physics, Waves, Wave Propagation, Research and Analysis Methods, Simulation and Modeling, Biology and Life Sciences, Neuroscience, Brain Mapping, Optogenetics, Bioassays and Physiological Analysis, Neurophysiological Analysis, Medicine and Health Sciences, Surgical and Invasive Medical Procedures, Functional Electrical Stimulation, Anatomy, Cardiovascular Anatomy, Heart, Cardiology, Arrhythmia, Engineering and Technology, Equipment, Optical Equipment, Cameras, Electrophysiological Techniques, Cardiac Electrophysiology
Topic: Photoreceptor and optogenetics research (Cellular and Molecular Neuroscience, Neuroscience), according to OpenAlex
Funding: Natural Sciences and Engineering Research Council of Canada (RGPIN-2024-04518, Undergraduate Student Research Award); HHS | NIH | National Heart, Lung, and Blood Institute (NHLBI) (NIH 2R01HL143450); Canadian Institutes of Health Research (Health Research Graduate Research Scholarship – Master’s program)
Citations: not cited yet (Europe PMC); 63 references in the paper

Abstract

Objective: Reentrant arrhythmias are life-threatening cardiac events that are difficult to study due to limited experimental control over the complex circuit dynamics. We present a real-time coupled cardiac system that allows in real-time dynamic manipulation of reentrant pathways in vitro using physiologically relevant simulations.

Methods: We designed a closed-feedback loop system that couples a cultured cardiac monolayer with a two-dimensional computational simulation of cardiac tissue. The simulation, based on GPU-accelerated models (e.g., cellular automata), predicts wave propagation in real-time using the Abubu.js library. Optical mapping captures monolayer activation patterns, and simulation outputs are converted into light-based stimulation via optogenetics, using LEDs and microcontrollers to depolarize cardiac tissue.

Results: Our platform is capable of accurately detecting and responding to electrical waves in real-time, enabling interactive modulation of reentrant circuits. The system replaces traditional fixed-delay stimulation protocols with computationally guided interventions, better mimicking physiological conduction dynamics.

Conclusion: This coupled system provides a novel and responsive method to study reentrant arrhythmias. Its integration of optical stimulation, real-time modeling, and tissue feedback enables the construction of user-defined reentry pathways and dynamic interaction with reentrant circuit behavior.

Significance: By merging computational and biological systems, this work introduces a versatile experimental framework for investigating arrhythmias. Built from inexpensive and accessible components, it lowers technical and financial barriers, increasing accessibility across a broad range of researchers and research environments. The platform may inform future control and anti-arrhythmic strategies and pave the way for personalized cardiac electrophysiology studies.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

younesvalibeigi/Coupled-Cardiac-System

License: MIT
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: fbef46693d6d2e37719144175345d1c2da4a6200, 19 April 2026
Languages: JavaScript (1251), TypeScript (268), C/C++ (54), C++ (13), Python (4), Shell (1)
Size: 3,840 files, 1,591 scripts
Software Heritage: not archived
Found in: the supplementary material
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Matplotlib (4 files), NumPy (4 files), SciPy (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
1,593 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 1,591 scripts, each with its path and the digest of its content;
  • 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data Availability

All relevant data are included within the manuscript and its Supporting Information files and are available at https://github.com/younesvalibeigi/Coupled-Cardiac-System.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 9 MeSH terms, 3 funders, 59 references.

Cite

This paper

Valibeigi, Y., Kaboudian, A., Fenton, F., & Bub, G. (2026). Real-time GPU-accelerated coupled cardiac system: Integrating bidirectional interactions between living optogenetic monolayers and computational simulations. PLoS computational biology, 22(8), e1014590. https://doi.org/10.1371/journal.pcbi.1014590

BibTeX

@article{valibeigi2026real,
author = {Valibeigi, Younes and Kaboudian, Abouzar and Fenton, Flavio and Bub, Gil},
title = {{Real-time GPU-accelerated coupled cardiac system: Integrating bidirectional interactions between living optogenetic monolayers and computational simulations}},
journal = {PLoS computational biology},
year = {2026},
month = aug,
volume = {22},
number = {8},
pages = {e1014590},
publisher = {PLOS},
issn = {1553-734X},
doi = {10.1371/journal.pcbi.1014590},
url = {https://doi.org/10.1371/journal.pcbi.1014590},
pmid = {42546041},
pmcid = {PMC13450847}
}

RIS

TY - JOUR
AU - Valibeigi, Younes
AU - Kaboudian, Abouzar
AU - Fenton, Flavio
AU - Bub, Gil
TI - Real-time GPU-accelerated coupled cardiac system: Integrating bidirectional interactions between living optogenetic monolayers and computational simulations
T2 - PLoS computational biology
J2 - PLoS Comput Biol
PY - 2026
DA - 2026/08/03
VL - 22
IS - 8
SP - e1014590
SN - 1553-734X
PB - PLOS
DO - 10.1371/journal.pcbi.1014590
UR - https://doi.org/10.1371/journal.pcbi.1014590
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pcbi.1014590",
"type": "article-journal",
"title": "Real-time GPU-accelerated coupled cardiac system: Integrating bidirectional interactions between living optogenetic monolayers and computational simulations",
"container-title": "PLoS computational biology",
"author": [
{
"family": "Valibeigi",
"given": "Younes"
},
{
"family": "Kaboudian",
"given": "Abouzar"
},
{
"family": "Fenton",
"given": "Flavio"
},
{
"family": "Bub",
"given": "Gil"
}
],
"container-title-short": "PLoS Comput Biol",
"volume": "22",
"issue": "8",
"page": "e1014590",
"DOI": "10.1371/journal.pcbi.1014590",
"PMID": "42546041",
"PMCID": "PMC13450847",
"ISSN": "1553-734X",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pcbi.1014590",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
3
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.7554/elife.109313 [code]
Linear and categorical coding units in the mouse gustatory cortex drive population dynamics and behavior in taste decision-making.
Journal: eLife
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 1 reference
[2] doi:10.1371/journal.pcbi.1014752 [code]
Hierarchical feature binding in a spiking neural network model of the primate ventral visual pathway.
Journal: PLoS computational biology
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)
[3] doi:10.1126/sciadv.aef2894 [code]
Human cortical networks trade communication efficiency for computational reliability.
Journal: Science advances
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)
[4] doi:10.1371/journal.pcbi.1014730 [code]
A unified model of short- and long-term plasticity: Effects on network connectivity and information capacity.
Journal: PLoS computational biology
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)
[5] doi:10.1021/acs.jcim.6c01299 [code]
Targeting BCL-2 through Deep Learning-Based Drug Repurposing: A Multimodal Approach Combining Diffusion-Based Generative Modeling, Neural Relational Inference, and In Vitro Validation.
Journal: Journal of chemical information and modeling
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)
[6] doi:10.1371/journal.pone.0355402 [code]
Disentangling sensory contributions to postural control regulation through sample entropy and neural modeling: A preliminary study.
Journal: PloS one
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)
[7] doi:10.1038/s41467-026-75704-3 [code]
A minimal model of working memory in neural systems and neuromorphic circuits.
Journal: Nature communications
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)
[8] doi:10.1038/s41467-026-76102-5 [code]
The inherent capacity of neurons to learn order relations and support abstract reasoning.
Journal: Nature communications
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)
[9] doi:10.1093/bioinformatics/btag553 [code]
Spatial-spectral fusion enables drug repositioning by capturing indirect and long-range associations in biological networks.
Journal: Bioinformatics (Oxford, England)
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)
[10] doi:10.1113/jp290729 [code]
Modelling the memory of unmyelinated axons: Integration of a data-driven approach with physiological memory concept.
Journal: The Journal of physiology
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data)

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.