Upload
para-dise
View
218
Download
0
Embed Size (px)
Citation preview
8/6/2019 Embedded Ruby
1/30
Slide 1
MBARI 2005
Embedding Ruby into a Robotic MarineEmbedding Ruby into a Robotic Marine
LaboratoryLaboratory
Brent Roman,
Christopher A. Scholin, Dianne I. Greenfield
Monterey Bay Aquarium Research Institute
www.mbari.org
8/6/2019 Embedded Ruby
2/30
Slide 2
MBARI 2005
About MBARIAbout MBARIMonterey Bay Aquarium Research Institute
Part of our stated mission is to develop betterinstruments, systems, and methods for scientificresearch in the deep waters of the ocean
Founded in 1987 by David Packard of HP Funded largely by the Packard Foundation
Employs >200 in Moss Landing, CA
8/6/2019 Embedded Ruby
3/30
Slide 3
MBARI 2005
What it does
How it works
Current applications
Future directions
Ruby's Central Role
MBARI's 2MBARI's 2ndnd
GenerationGeneration
Environmental Sample ProcessorEnvironmental Sample Processor
8/6/2019 Embedded Ruby
4/30
Slide 4
MBARI 2005A.C. Hardy. 1936. Discovery Reports Vol. XI, pp. 457-510.A.C. Hardy. 1936. Discovery Reports Vol. XI, pp. 457-510.
Machines to collect microbes are not new
Continuous Plankton
Recorder (CPR)
First deployed on the R.R.S.
Discovery 1925-27.
Design driven by need todocument patchiness of
zooplankton
Many modifications over the
years
took ~10 yrs to become
operational
A.C. Hardy. 1936. Discovery Reports Vol. XI, pp. 457-510.A.C. Hardy. 1936. Discovery Reports Vol. XI, pp. 457-510.
8/6/2019 Embedded Ruby
5/30
Slide 5
MBARI 2005
Functional Requirements for Instruments that
Detect Microorganisms and Gene Products
Sample collection
Cell concentration, preservation and disruption
Separation of molecules based on physical properties
Use of intermolecular reactions to reveal target molecules
lectin/carbohydrate
antibody/antigen
nucleic acid hybridization receptor/target
enzyme mediated processing
Optical and electrochemical signal transduction common
Functional Requirements for Instruments that
Detect Microorganisms and Gene Products
Sample collection
Cell concentration, preservation and disruption
Separation of molecules based on physical properties
Use of intermolecular reactions to reveal target molecules
lectin/carbohydrate
antibody/antigen
nucleic acid hybridization receptor/target
enzyme mediated processing
Optical and electrochemical signal transduction common
8/6/2019 Embedded Ruby
6/30
Slide 6
MBARI 2005
The Environmental Sample Processor (ESP)The Environmental Sample Processor (ESP) Rotating carousel with 100, 25mm pucks holding user-defined
filters or solid phase media
Fluid handling system permitsautonomous collection of samplesand timed application of multiplereagents in situ, subsurface
Sample processing protocolswritten as a series of simplecommands such as Load Filter,Pullx ml reagenty, heatzoC30 min, etc.
Two-way communication
8/6/2019 Embedded Ruby
7/30
Slide 7
MBARI 2005
Environmental Sample Processor MooringEnvironmental Sample Processor Mooring
8/6/2019 Embedded Ruby
8/30Slide 8
MBARI 2005
8/6/2019 Embedded Ruby
9/30Slide 9
MBARI 2005
Functions of the ESP
Development of DNA probe arrays (near real-time)
collect sample create cell homogenate
discharge sample collection filter > load probe array filter
develop probe array > image > transmit result
Sample Archival for whole cell analysis (probes, microscopy)
for nucleic acids (gene libraries)
for toxins (domoic acid)
Whole Cell Hybridization(FISH -- Fluorescent In-Situ Hybridization) collect, fix sample
label target species with probes
recover filter and view using epifluorescence microscopy
Functions of the ESP
Development of DNA probe arrays (near real-time)
collect sample create cell homogenate
discharge sample collection filter > load probe array filter
develop probe array > image > transmit result
Sample Archival for whole cell analysis (probes, microscopy)
for nucleic acids (gene libraries)
for toxins (domoic acid)
Whole Cell Hybridization(FISH -- Fluorescent In-Situ Hybridization) collect, fix sample
label target species with probes
recover filter and view using epifluorescence microscopy
8/6/2019 Embedded Ruby
10/30Slide 10
MBARI 2005
controls/orient image
16,000
cells/ml
lysateP.
australis
27 28 29
23 26 30 31 32
20 22 25 33 34 35 36
19 21 24 6 3 1
18 17 16 15 7 4 2
14 13 12 8 5
11 10 9
auD1 muD2 NA-1 HET1
Heterosigmaakashiwo
Alexandrium
catenella
Pseudo-nitzschia
australis
Pseudo-nitzschiamultiseries
Array map species/group specific DNA probes
Sandwich hybridization assay (SHA) chemistry
Image stored & sent to shore via radio modem
ESP's DNA Probe ArraysESP's DNA Probe Arrays
8/6/2019 Embedded Ruby
11/30
8/6/2019 Embedded Ruby
12/30Slide 12
MBARI 2005
The Sandwich Hybridization AssayThe Sandwich Hybridization Assay
18S rRNA
rRNA-targeted capture
probe (streptavidin)
signal probe
(dioxygenin)
HRP conjugate
enzyme
substrate
Verification
by matching
96-well bench
run
Imaged
array
array spot intensity
absorbance (450 nm)
Photo courtesy of A. Haywood
rRNA-targeted capture
probe (streptavidin)
signal probe
(dioxygenin)
HRP conjugate
enzyme
substrate
Verification
by matching
96-well bench
run
Imaged
array
array spot intensity
absorbance (450 nm)
Photo courtesy of A. Haywood
HRP = Horse Radish Peroxidase
8/6/2019 Embedded Ruby
13/30Slide 13
MBARI 2005
8/6/2019 Embedded Ruby
14/30Slide 14
MBARI 2005
Current ApplicationsCurrent Applications
Develop DNA probe arrays (~2 h) for identification of:
Harmful Algal Blooms (plankton)
Bacteria
Invertebrate Larvae
Sample archival to preserve cell structure
whole cell archival
(FISH) hybridization
Domoic acid analysis (in progress)
Current ApplicationsCurrent Applications
Develop DNA probe arrays (~2 h) for identification of:
Harmful Algal Blooms (plankton)
Bacteria
Invertebrate Larvae
Sample archival to preserve cell structure
whole cell archival
(FISH) hybridization
Domoic acid analysis (in progress)
8/6/2019 Embedded Ruby
15/30Slide 15
MBARI 2005
Future DirectionsFuture Directions
Deep ESP: Deploy on Ocean Bottom at >2000m
The 2G ESP is a sampling tool - protocols can be
tailored for user requirements
Modifying chemistry as appropriateDevelopment of new probes
Adjusting sampling procedures
Other uses?
Complete in situ domoic acid analysis methodology
Increase array sensitivity
Integrate PCR module
8/6/2019 Embedded Ruby
16/30Slide 16
MBARI 2005
NASA ASTEP: Astrobiology Science and Technology for Exploring Planets
8/6/2019 Embedded Ruby
17/30Slide 17
MBARI 2005
AcknowledgmentsAcknowledgments
The David and Lucile Packard Foundation
National Oceanographic Partnership Program (NOPP) funds allocatedby the National Science Foundation (NSF OCE-0314222)
R. Marin III, S. Jensen, A. Haywood, C. Preston, M. Adachi, T. Walsh,
J. Jones, C. Braby, A. Gough
8/6/2019 Embedded Ruby
18/30Slide 18
MBARI 2005
Why Choose Ruby for anembedded system like ESP?
Can be configured to run in small memory footprint
Open Source Universities have cheap labor and little $$$
We can fix (or break) it ourselves as we see fit
Readable, but terse syntax No white space rules and no excess punctuation
Make it suitable for use as an interactive shell
Useful subset of Ruby is approachable for non-programmers
Everything is an Object! But, no OO baggage creeps into procedural definitions.
Most molecular biologists don't get OO. They write recipes.
User defined Exception Objects
Multi-Threading
Why Choose Ruby for anembedded system like ESP?
Can be configured to run in small memory footprint
Open Source Universities have cheap labor and little $$$
We can fix (or break) it ourselves as we see fit
Readable, but terse syntax No white space rules and no excess punctuation
Make it suitable for use as an interactive shell
Useful subset of Ruby is approachable for non-programmers
Everything is an Object! But, no OO baggage creeps into procedural definitions.
Most molecular biologists don't get OO. They write recipes.
User defined Exception Objects
Multi-Threading
8/6/2019 Embedded Ruby
19/30Slide 19
MBARI 2005
ESP Software Overview
Mission
Hardware
System Libraries
User Libraries
Device Drivers
Device Models
via I2C Gateway
Simulation Normal Operation
8/6/2019 Embedded Ruby
20/30
8/6/2019 Embedded Ruby
21/30Slide 21
MBARI 2005
2nd Generation ESPElectrical Block Diagram
PC/104
Host Processor
Interconnect /Motherboard
5V & 3.3V Power Supplies
Sampler
Collection
Process
Manipulator
Storage
I2C
ContextualSensors
3 x RS-232
External
Power 10 - 16V
RFModem
Analytical Modules
3 x RS-232
RS-232
Serial Bus
Distributed Controllersaka Dwarves
~2 Watts
~450 mW
8/6/2019 Embedded Ruby
22/30Slide 22
MBARI 2005
2G ESPPC/104 Host Processor
Inexpensive (
8/6/2019 Embedded Ruby
23/30Slide 23
MBARI 2005
Trimming Ruby
Fitting Linux/Ruby in 16MB flash requires some thought
Use of JFFS2 filesystem compresses flash by ~40% But, Linux kernel takes 2MB leaving 14MB
Ruby core interpreter is small ( ~ 500kByte )
Native code libraries are large (~8MB base install!)
Pure Ruby ASCII code is extremely compact! Avoid use of Native Libraries in favor of pure Ruby
Example: curses.so links with libcurses.so, libterm.so
Curses support brings in close to 1MB of binary
Hack core Makefile to skip building unneeded libraries
Removed tcltk, tk & curses from Ruby 1.68 build
Reduced /usr/lib/ruby to
8/6/2019 Embedded Ruby
24/30
8/6/2019 Embedded Ruby
25/30
8/6/2019 Embedded Ruby
26/30
8/6/2019 Embedded Ruby
27/30
R b Th d
8/6/2019 Embedded Ruby
28/30
Slide 28
MBARI 2005
Ruby Threads:More Bad
Thread.sleep does not clear Thread.critical
Ruby code cannot clear Thread.critical before sleeping
Just as one can't clear it explicitly before Thread.stop
Another thread my run between the clear & stop
This is why Thread.stop clears Thread.critical
My solution was to add the 'C' extension: Thread.doze
Just like .sleep, but clears Thread.critical first
Is there any reason Thread.sleep should not be changed?
Could one ever want to sleep with Thread.critical set?!
BTW -- there is a similar issue with the select method...
See ruby-core:4053
8/6/2019 Embedded Ruby
29/30
8/6/2019 Embedded Ruby
30/30