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.

3 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 3 matches · 1 of them tie a paragraph to a whole file without 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 to 119 · score 0.63 · serial port, cycle period, client, server, browser, Arduino · block oscr:b:6GF3VZBM9M1GK-Q · Report a mismatch
  2. [2] § II. Methods › I. Synchronization of camera and microcontroller ↔ ServerClient_FKModel/server.js, lines 184 to 234 · score 0.54 · serial port, socket.io, Arduino, LED, frame, camera · block oscr:b:MAM1F22JX9BTB-M · Report a mismatch
  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 · block oscr:b:SSJTRHV5RHJ6K-T · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: 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 (how the code is found and 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: NSERC (RGPIN-2024-04518, Undergraduate Student Research Award); national heart, lung, and blood institute (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.1016/j.crmeth.2023.100671 [code]
Opto-electronic feedback control of membrane potential for real-time control of action potentials.
Journal: Cell reports methods
In common: 7 references
[2] doi:10.1038/s41598-026-40578-4 [code]
Theoretical analysis of low-power optogenetic suppression of action potentials in human ventricular cardiomyocytes expressed with potassium-selective channelrhodopsins.
Journal: Scientific reports
In common: 5 references
[3] doi:10.1016/j.bpj.2026.01.056 [code]
Experimentally informed, quantitative photocycle model of the light-gated potassium channel WiChR.
Journal: Biophysical journal
In common: 5 references
[4] doi:10.1117/1.jbo.28.1.016001
Portable low-cost macroscopic mapping system for all-optical cardiac electrophysiology.
Journal: Journal of biomedical optics
In common: 4 references
[5] doi:10.3791/69155 [code]
Dynamic Clamp Methods to Investigate Impaired Neuronal Excitability Associated with Autism.
Journal: Journal of visualized experiments : JoVE
In common: 4 references
[6] doi:10.1002/wsbm.1581 [code]
Models of the cardiac L-type calcium current: A quantitative review.
Journal: WIREs mechanisms of disease
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 2 references
[7] doi:10.1101/2025.04.09.647733 [code]
MonoAlg3D: Enabling Cardiac Electrophysiology Digital Twins with an Efficient Open Source Scalable Solver on GPU Clusters
Journal: bioRxiv (preprint)
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 1 reference
[8] doi:10.1117/1.nph.11.2.024308 [code]
Modulation of neuronal dynamics by sustained and activity-dependent continuous-wave near-infrared laser stimulation.
Journal: Neurophotonics
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 1 reference
[9] doi:10.1088/1741-2552/ad731f [code]
Nonlinear model predictive control of a conductance-based neuron model via data-driven forecasting.
Journal: Journal of neural engineering
In common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 1 reference
[10] 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

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.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014590.svg)](https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014590)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014590.svg
   :target: https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014590
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014590"><img src="https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014590.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

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