PASTAmanuscript
PASTAmanuscript
net/publication/349003072
CITATIONS READS
15 2,134
7 authors, including:
All content following this page was uploaded by Jan Homolak on 03 February 2021.
A recent substantial increase in the availability of low-cost electronics encouraged the development of open-
source tools used in scientific research. The rapidly developing field of modern neuroscience is no exception,
with a myriad of research groups openly publishing hardware and software with their peers with the goal of
global advancement in the understanding of the neural basis of behavior. An agile acceptance of this open-science
revolution stems from the core principles of open-science. First, in the context of the science reproducibility
crisis, maximal transparency of the methodology, including bypassing “black box solutions” offered by manu-
facturers of equipment used in neuroscience experiments, should be considered as an important step forward.
Moreover, projects released under open-source, copyleft licenses can, and should, be modified and improved
by others, making the design more robust, scientifically verified, and easily adaptable for different experimen-
tal uses. Furthermore, open-source equipment is cost-effective, which makes it popular and widely used as it
allows researchers to evade financial limitation-induced restraints and focus on science rather than money.
Taken together, these concepts make open-source solutions indispensable for further evolution of neuroscience
as they provide us with the tools to analyze what was previously unmeasured, and question what was taken as
incontrovertible truth1,2. In this paper, we provide an open-source design for an experimental platform based on
interfacing a microcontroller with a conventional digital kitchen scale. The utilization of a conventional digital
kitchen scale for the collection of relevant scientific information has been used in the field of neuroscience for
a long time, especially in the field of pain research and neurorehabilitation. For example, Matak elegantly used
a digital kitchen scale to assess the magnitude of tetanus toxin-induced local rigidity of the rat gastrocnemius
muscle3 and Koka and Hadlock reported that the kitchen scale-based extensor postural thrust test provides
1
Department of Pharmacology, University of Zagreb School of Medicine, Zagreb, Croatia. 2Institute of
Fundamental Clinical and Translational Neuroscience, Research Centre of Excellence, Croatian Institute for Brain
Research, University of Zagreb School of Medicine, Zagreb, Croatia. *email: [email protected]
Vol.:(0123456789)
www.nature.com/scientificreports/
Figure 1. A schematic display of Platform for Acoustic STArtle (PASTA). (A) The key ingredient of PASTA—a
modified kitchen scale. (B) A clean mouse cage affixed on top of the kitchen scale. (C) A readily-available
controller circuit board based on the HX711 integrated circuit (D) A communication board, NodeMCU ESP-32S
(E) USB cable (F) Your fancy laptop with our fancy Python script (G) A normal audio cable. Really, there is
nothing special about it. (H) Standard loudspeaker.
consistent quantitative results on functional recovery following rat sciatic nerve t ransection4. However, although
conventional kitchen scales can provide valuable scientific information, their use is limited for several reasons.
The experimenter using the kitchen scale has to carefully monitor the numeric output on the digital screen mak-
ing the test prone to human error and bias. Moreover, although the sampling rate of the scale is relatively high
(up to 80 Hz with our setup), human real-time information processing introduces a rate-limiting step making
the output information rather modest both in regards to the amount of information and their temporal sequence.
We argue that interfacing a kitchen scale with a computer would not only solve the aforementioned problems,
but also introduce a whole new set of experimental opportunities such as rodent locomotor activity assessment
or prepulse inhibition sensorimotor gating analysis. In the following text, we demonstrate this with our Platform
for Acoustic STArtle—PASTA. Moreover, we describe the complete recipe with all hardware ingredients and
ready-to-serve software packages, and test our system with a prepulse inhibition sensorimotor gating analysis
in a rat model of sporadic Alzheimer’s disease.
PASTA hardware
To be able to read the Vivax Home KS-502T scale data at a high sampling rate and store it, we had to construct
an appropriate interface between the load cells, which are the crux of every scale, and a computer. This interface
uses a readily-available controller circuit board based on the HX711 integrated circuit (IC) to read the load cells’
resistance. The boards are usually configured for a 10 sample per second (SPS) sampling rate, so a hardware
modification was applied which included reconnecting the HX711 RATE pin to VCC to enable the IC’s 80 SPS
mode. The load cell controller board connects to a NodeMCU ESP-32S board which acts as a communication
bridge and forwards the load cell data through its USB connection to the computer (Fig. 2). As a bridge, more
Vol:.(1234567890)
www.nature.com/scientificreports/
Figure 2. A schematic drawn in Fritzing5 representing how the four half-Wheatstone-bridge load cells found in
our scale are wired together. They are then connected to their respective pins on the HX711 circuit board. This
board communicates with the NodeMCU ESP-32S board through the DO and SCK lines routed to pins 18 and
19, respectively. The NodeMCU ESP-32S board provides power to the HX711 board and sends raw data to the
computer over USB. This schematic is available in Supplementary material, as well as a full, annotated schematic
made in KiCad.
Table 1. Descriptive statistics of the raw data obtained from PASTA. All results are presented in grams. a Very
high standard deviation values of raw data obtained from PASTA indicate greater variation and in fact reflect
the change we expected to see as the definition of the signal period is defined by the time window and includes
both the signal and the noise recorded during the sampling segment. The best approach to quantification of
PASTA-obtained changes is still to be determined, as a more detailed mathematical approach might increase
the sensitivity and specificity of PASTA.
common AVR-based Arduino boards such as the Uno, Nano or Pro Micro may be used as well. The computer
logs the received data and plays the startle sound at appropriate timestamps, which will be elaborated further
in the PASTA Software section. As far as hardware considerations go, the choice of a speaker is the final point
to note as the startling stimulus needs to be sufficiently loud to induce a startle response; however, the exact
target volume depends heavily on the use case. The exact testing protocol we used in our test of this system can
be found in Supplement 1.
PASTA software
Custom codes were written for the NodeMCU ESP-32S board (C++, Arduino), the control computer (Python),
and for processing of collected data (R). All code can be found on corresponding GitHub repositories.
C++ code based on the Arduino framework which runs on the NodeMCU ESP-32S board simply receives
samples from the HX711 IC and forwards it to the computer through its USB connection. Communication
Vol.:(0123456789)
www.nature.com/scientificreports/
Figure 3. Results of the startle response and prepulse inhibition sensorimotor gating analysis obtained ▸
by the Platform for Acoustic STArtle (PASTA), PASTA Chef and R-based Awesome Toolbox for PASTA
(ratPASTA). (A) A box plot depiction of the startle response intensities for control (CTR) and rats treated
with intracerebroventricular streptozotocin (STZ). W PI (With Prepulse Inhibition) indicates the response
was calculated by pooling data obtained from the trials that included prepulse inhibitory stimulus, and W/O
PI (Without Prepulse Inhibition) indicates the response was calculated by pooling data obtained from the
trials that did not include prepulse inhibitory stimulus. Both CTR and STZ rats display the prepulse inhibition
phenomenon, and STZ rats differ from the controls by the pronounced startle response to the initial stimulus
not preceded by the inhibitory prepulse (p = 0.038). (B) Raw data display of a single startle response trial. The
area in red indicates a startle response, and areas in blue indicate breathing patterns evident during the freezing
behavior. (C) Sample image from one trial during the proof of concept study. The laptop running the PASTA
Chef script is displayed on the left side of the picture with C.A.V.A. helper program on the upper side of the
screen and load cell real-time plot on the lower side of the screen. The red area indicates a single breathing
pattern further examined by corresponding video analysis and depicted in (D,E). The green area indicates
the thoracic area of interest used for further video and image analysis depicted in (D,E). (D) Portrayal of a
single breathing cycle obtained by baseline subtraction filtering video analysis. Sample images of a single cycle
are arranged in appropriate temporal order with the uppermost image representing the baseline state before
thoracic movement, and lowermost image the end of the movement. (E) A visual representation of a breathing
cycle obtained by densitometric analysis of the images obtained by baseline subtraction filtering video analysis.
ctr W PI control animals with prepulse inhibition—values obtained from trials with a prepulse inhibition
stimulus present, ctr W/O PI control animals without prepulse inhibition—values obtained from trials with
no prepulse stimulus, stz W PI streptozotocin-treated animals with prepulse inhibition—values obtained from
trials with a prepulse inhibition stimulus present, stz W/O PI streptozotocin-treated animals without prepulse
inhibition—values obtained from trials with no prepulse stimulus, g gram.
with the HX711 IC is done using the HX711 library6, making the code portable to other targets specified in the
library’s documentation, including typical AVR-based Arduino boards, simply by adjusting the appropriate pin
definitions. The code can be found on G itHub7.
Before starting the experiment, a WAVE sound file named startlesnd.wav needs to be constructed for the entire
duration of the experiment, with short pulses of white noise with or without prepulses, separated by a silence of
appropriate duration, depending on the experiment that is being performed. We used Audacity to generate this
file according to the specification detailed in Supplement 1. It is available as Supplementary Audio Material 1.
The computer runs Ubuntu, a Linux distribution, with PASTA Chef, a Python script on the computer, which
automates the entire startle experiment and prepares .pasta files for further analysis. It starts by asking the user
for the test animal’s name which will provide the data output file name, as well as the test animal’s mass, after
which the experiment starts. Before starting, it is advisable to reset the communication bridge board using the
on-board RESET button (labeled EN on the NodeMCU ESP-32S board). The sound file is loaded and playback is
started automatically at the same time as data logging. During the experiment, scale data is also plotted on-screen
in real time using pyqtgraph. After the experiment is done, all raw data files with the file extension .pasta can be
found in the data directory, as well as a mass.json file which contains masses of all test animals. A caveat of this
setup is that, without extensive kernel and sound system modification and reconfiguration, there is no way to
precisely synchronize the recording to the timestamps in the data. This is further discussed in Supplement 2,
and is a subject of our ongoing research. Startle latency can still be obtained by videotaping the experiment and
correcting PASTA output according to the video. The code for PASTA Chef can be found on GitHub8.
A helper program, C.A.V.A.9, was used to visualize the sound output on the computer screen, so that the
exact moment when pulses are played can be registered during video analysis without relying on combined
video-audio recordings.
To make data processing and visualisation easier, we have created an R package called ratPASTA (R-based
Awesome Toolbox for PASTA), available from the Comprehensive R Archive Network (CRAN10) and from
GitHub11. Briefly, the function loadStartleData(), loads and automatically merges all startle files from the folder.
Unless otherwise specified, values are corrected for animal mass, and pulses are identified based on the inbuilt
metadata. If necessary, users can manually specify which files to load and input custom metadata for puls iden-
tification. The functions basicStartlePlot() and startlePlot() are used to plot several graphs, whereas the function
summariseStartle() returns a mathematical summary of the data. If users wish to expand the analysis, the out-
put of the loadStartleData() function is a data frame and it can be used as an input for custom build functions.
Detailed information is provided on the website of the package12.
Finally, to make the whole system more even user friendly, a Python wrapper package for ratPASTA (pastaW-
RAP) was developed to enable more streamlined data acquisition and analysis pipeline in a single programming
environment (Python). pastaWRAP is available from the Python Package Index (PyPI)13, and the source code
can be found on GitHub14.
Vol:.(1234567890)
www.nature.com/scientificreports/
Vol.:(0123456789)
www.nature.com/scientificreports/
Figure 4. A representative example of the results obtained by the experimental protocol used for the acoustic
startle and prepulse inhibition sensorimotor gating analysis. The experimental protocol and audio sequence are
further discussed in the PASTA Software section and the acoustic startle sequence is available in Supplementary
Audio Material 1. In short, trials 1–10 are focused on the quantification of the acoustic startle response, and
trials 11–20 consist of the same startle stimulus preceded by the prepulse inhibitory stimulus, and are focused
on the quantification of the prepulse inhibition phenomenon. Small peaks represent breathing patterns recorded
during freezing behavior of the rat and are further discussed in Fig. 3 with startle response indicated in red and
breathing patterns indicated in blue in Fig. 3B.
Vol:.(1234567890)
www.nature.com/scientificreports/
analysis of the data obtained from PASTA, we conclude our platform and the auditory sequence we designed for
this experiment were sufficient to register significant prepulse inhibition. Moreover, it is evident that both STZ-
icv and CTR animals display significant PPI phenomenon with no apparent difference between the two groups
(Table 1; Fig. 3A), as already reported by Moreira-Silva et al.20. However, we also identified an intensified startle
response to the initial pulses without prepulse signal in the STZ-icv group (Fig. 3A). This is in accordance with
behavioral abnormalities we previously observed in STZ-icv rats, and we plan to investigate the meaning of this
interesting phenomenon further. Based on this proof of concept study, we conclude that the PASTA platform
can be used to obtain meaningful neuroscientific information, and further development of our platform by us
and other scientists involved with the open science community could further improve the platform and make it
useful for a broad range of scientific experiments. Based on our preliminary testing, we already identified several
additional pieces of information ratPASTA and PASTA could provide with minimal adaptations.
One interesting example is based on the fact that our platform is sufficiently sensitive to register breath-
ing patterns during freezing in rats (Figs. 3B, 4). A single breathing cycle registered by PASTA is depicted in
Fig. 3C–E. Corresponding thorax movements were calculated from the video file by baseline subtraction filter-
ing, and frame pixel densitometry (Fig. 3C–E). The whole analytical procedure is described in Supplement 4
and baseline subtraction filtering is demonstrated in Supplementary Video Material 2. Representative breathing
patterns can be observed in Supplementary Video Material 3. Raw data and data analysis protocols are available
on GitHub21. Another example is griPASTA, a simple adaptation of the PASTA platform for quantitative analysis
of grip strength in r odents22.
Conclusion
In this brief paper, we introduce PASTA, a low-cost open-source platform for control of common kitchen scale
load cells, which can be used to extract meaningful and important behavioral data. In accordance with principles
of open science, we provide complete instructions on how to demolish your regular kitchen scale and use the
parts to turn it into a beautiful multifunctional neurobehavioral platform. Moreover, we provide the whole code
needed to design PASTA software—a C++ and Arduino code for the communication board, a Python code for
the control computer, and even ratPASTA, an R-based package for data processing, analysis and visualization—so
you can adapt everything to better fit your experiment, sit back and enjoy PASTA. For all you Python foodies,
we developed pastaWRAP, a Python wrapper package so you can do everything from a Python programming
environment. In our proof of concept study, we have shown how PASTA can be used for acoustic startle and
prepulse inhibition analysis, but the whole platform is easily adaptable, and we hope to see our colleagues using
our platform for other types of behavioral analyses further building on PASTA in the spirit of open-science. “Liv-
ing guidelines” with ethical considerations and suggestions for responsible transparent reporting with PASTA
can be found on GitHub23.
Ethics committee approval. All experiments were conducted in concordance with the highest standard
of animal welfare. Only certified personnel handled animals. Animal procedures were carried out at the Uni-
versity of Zagreb Medical School (Zagreb, Croatia) and were in compliance with current institutional, national
(The Animal Protection Act, NN135/2006; NN 47/2011), and international (Directive 2010/63/EU) guidelines
governing the use of experimental animals. The experiments were approved by the national regulatory body
responsible for issuing ethical approvals, the Croatian Ministry of Agriculture and by the Ethical Committee of
the University of Zagreb School of Medicine.
Data availability
Complete data and code are freely available in concordance with the principles of open science and open-source
bioinstrumentation. Data from the proof of concept study can be found at “https://github.com/davor vr/pasta
-data”. PASTA Chef source code can be obtained from “https://github.com/davorvr/pasta-chef ”. PASTA HX711-
to-USB bridge code is available at “https: //github
.com/davorv r/pasta- bridge ”. pastaWRAP Python wrapper source
code can be found here: “https://github.com/davor vr/pastaWRAP”. ratPASTA source code is available here:
“https://github.com/ikodvanj/ratPASTA”. PASTA “living guidelines” can be found here: “https://github.com/
davorvr/pasta-guidelines”.
References
1. Krakauer, J. W., Ghazanfar, A. A., Gomez-Marin, A., MacIver, M. A. & Poeppel, D. Neuroscience needs behavior: correcting a
reductionist bias. Neuron 93, 480–490 (2017).
2. White, S. R., Amarante, L. M., Kravitz, A. V. & Laubach, M. The future is open: open-source tools for behavioral neuroscience
research. eNeuro 6, (2019).
3. Matak, I. Evidence for central antispastic effect of botulinum toxin type A. Br. J. Pharmacol. 177, 65–76 (2020).
4. Koka, R. & Hadlock, T. A. Quantification of functional recovery following rat sciatic nerve transection. Exp. Neurol. 168, 192–195
(2001).
5. Fritzing. https://fritzing.org. Accessed 26 Jan 2021.
6. bogde. HX711. GitHub. https://github.com/bogde/HX711. Accessed 26 Jan 2021.
7. davorvr. PASTA Bridge. GitHub. https://github.com/davorvr/pasta-bridge. Accessed 26 Jan 2021.
8. davorvr. PASTA Chef. GitHub. https://github.com/davorvr/pasta-chef. Accessed 26 Jan 2021.
9. karl. cava. GitHub. https://github.com/karlstav/cava. Accessed 26 Jan 2021.
10. Kodvanj I., Virag D., Homolak J. ratPASTA. R package version 0.1.0. https://cran.r-project.org/web/packages/ratPASTA/index
.html. Accessed 26 Jan 2021.
Vol.:(0123456789)
www.nature.com/scientificreports/
11. Kodvanj I., Virag D., & Homolak J. ratPASTA. R package version 0.1.0. https://github.com/ikodvanj/ratPASTA (2020). Accessed
26 Jan 2021.
12. .ratPASTA website. https://ikodvanj.github.io/ratPASTAsite/index.html. Accessed 26 Jan 2021.
13. pastaWRAP Python wrapper package. https://pypi.org/project/pastawrap/. Accessed 26 Jan 2021.
14. davorvr. pastaWRAP. GitHub. https://github.com/davorvr/pastaWRAP. Accessed 26 Jan 2021.
15. Salkovic-Petrisic, M., Knezovic, A., Hoyer, S. & Riederer, P. What have we learned from the streptozotocin-induced animal model
of sporadic Alzheimer’s disease, about the therapeutic strategies in Alzheimer’s research. J. Neural Transm. 120, 233–252 (2013).
16. Powell, S. B., Zhou, X. & Geyer, M. A. Prepulse inhibition and genetic mouse models of schizophrenia. Behav. Brain Res. 204,
282–294 (2009).
17. Sichler, M. E., Löw, M. J., Schleicher, E. M., Bayer, T. A. & Bouter, Y. Reduced acoustic startle response and prepulse inhibition in
the Tg4-42 model of Alzheimer’s disease. J. Alzheimers Dis. Rep. 3, 269–278 (2019).
18. Ueki, A., Goto, K., Sato, N., Iso, H. & Morita, Y. Prepulse inhibition of acoustic startle response in mild cognitive impairment and
mild dementia of Alzheimer type. Psychiatry Clin. Neurosci. 60, 55–62 (2006).
19. Hejl, A.-M., Glenthøj, B., Mackeprang, T., Hemmingsen, R. & Waldemar, G. Prepulse inhibition in patients with Alzheimer’s
disease. Neurobiol. Aging 25, 1045–1050 (2004).
20. Moreira-Silva, D. et al. Anandamide effects in a streptozotocin-induced Alzheimer’s disease-like sporadic dementia in rats. Front.
Neurosci. 12, 653 (2018).
21. .davorvr. pasta-data. GitHub. https://github.com/davorvr/pasta-data.
22. Homolak, J., Virag, D., Kodvanj, I., Matak, I., Babic Perhoc, A., Knezovic, A., Osmanovic Barilar, J., Trkulja, V., & Salkovic-Petrisic,
M. griPASTA: A hacked kitchen scale-based system for quantification of grip strength in rodents. bioRxiv (2020). https://doi.
org/10.1101/2020.07.23.217737.
23. davorvr. pasta-guidelines. GitHub. https://github.com/davorvr/pasta-guidelines.
Author contributions
D.V., J.H. and I.K. conceptualized PASTA, contributed equally and leading roles in different parts of the project
were equally distributed. D.V. is responsible for PASTA hardware design, kitchen scale hacking and writing
the NodeMCU ESP-32S C++/Arduino software code, a Python script for the acoustic startle experiment and
pastaWRAP Python wrapper package. D.V. and J.H. are responsible for the design and J.H. is responsible for the
execution of the experimental protocol. I.K. is the main author responsible for the code behind the ratPASTA
R-package and visualization used in the manuscript. J.H. is responsible for the video analysis. D.V., J.H. and I.K.
designed the analyses and wrote the manuscript. J.H., A.B.P., A.K. and J.O.B. generated a rat model of sporadic
Alzheimer’s disease by intracerebroventricular administration of streptozotocin (STZ-icv). M.S.P. is head of the
Laboratory for Molecular Neuropharmacology where all experiments were conducted, principal investigator of
the Croatian Science Foundation funded project (IP-2018-01-8938) and supervisor and mentor of D.V., J.H. and
I.K. All authors approved the manuscript and provided comments during the writing process.
Funding
This work was funded by the Croatian Science Foundation (IP-2018-01-8938). Research was co-financed by the
Scientific Centre of Excellence for Basic, Clinical and Translational Neuroscience (project “Experimental and
clinical research of hypoxic-ischemic damage in perinatal and adult brain”; GA KK01.1.1.01.0007 funded by the
European Union through the European Regional Development Fund).
Competing interests
The authors declare no competing interests.
Additional information
Supplementary Information The online version contains supplementary material available at https://doi.
org/10.1038/s41598-021-82710-6.
Correspondence and requests for materials should be addressed to J.H.
Reprints and permissions information is available at www.nature.com/reprints.
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and
institutional affiliations.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International
License, which permits use, sharing, adaptation, distribution and reproduction in any medium or
format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the
Creative Commons licence, and indicate if changes were made. The images or other third party material in this
article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the
material. If material is not included in the article’s Creative Commons licence and your intended use is not
permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from
the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
Vol:.(1234567890)
View publication stats