Urbit

Purpose

Ease your organization into Urbit by using the Urbit ID system to validate users. Use the Landscape viewer to distribute software - in this case a simple hyperlink to an internally developed web app. No hoon coding required. The web app must be modified to accept white listed Urbit IDs.

Prepare Linux

The following is a modification of the hello app found on developers.urbit.org. I am starting with a new instance of Debian 11 on AWS. Note that some of the commands below will need to be modified with your AWS credentials, configuration. This video walks through the process.

Update, install some utilities and create a swap space:

1
2
3
4
5
6
7
sudo apt-get update
sudo apt-get install git

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

edit fstab:

1
sudo nano /etc/fstab

add the following line:

/etc/fstab
1
/swapfile swap swap defaults 0 0

Prepare new desk contents

Clone the required desks and merge them into your project desk OR git clone the limsn project and apply modifications. Note that this process slightly differs from developers.urbit.org which is out of date:

1
2
3
4
5
6
7
8
9
10
11
12
13
projects$ git clone https://github.com/urbit/urbit urbit-git
projects$ git clone https://github.com/tloncorp/landscape

projects$ mkdir urblimsn

cp -rfL /home/mbc/projects/urbit-git/pkg/base-dev/* /home/mbc/projects/urblimsn
cp -rfL /home/mbc/projects/landscape/desk-dev/* /home/mbc/projects/urblimsn

projects/urblimsn$ echo "[%zuse 415]" > sys.kelvin
projects/urblimsn$ echo "~zod" > desk.ship

projects/urblimsn$ nano desk.docket-0

Modify the contents of desk.docket-0 to suit your needs:

desk.docket-0
1
2
3
4
5
6
7
8
9
10
11
:~  title+'LIMS*Nucleus'
info+'A link to LIMS*Nucleus Web App.'
color+0x81.88c9
image+'https://github.com/mbcladwell/limsn/raw/main/limsn/pub/img/las-walpha-small.png'
base+'limsn'
glob-ames+[~zod 0v0]
version+[0 0 1]
website+'https://github.com/mbcladwell/urblimsn'
license+'MIT'
==

The merged desks, auxilliary files and glob can be cloned, see below.

Prepare fake zod

Start up a fake zod, create and mount a new desk, delete the desk and git clone its replacement:

1
2
3
4
5
6
curl -L https://urbit.org/install/linux-x86_64/latest | tar xzk --transform='s/.*/urbit/g' && ./urbit
./urbit -F zod
~zod:dojo>|new-desk %limsn
~zod:dojo>|mount %limsn

Ctrl-d (to kill zod)

cd into zod and delete the new desk. git clone its replacement. The cloned directory contains the merged dev desks, desk.ship etc. as well as a glob:

1
2
3
4
cd ./zod
zod$ rm -rf ./limsn
zod$ git clone https://github.com/mbcladwell/urblimsn.git limsn
cd ..

Get the glob out of the desk or the desk will not compile:

1
$ mv ./zod/limsn/glob .

On local machine transfer glob to local machine:

1
scp -r -i labsolns.pem admin@ec2-3-145-214-48.us-east-2.compute.amazonaws.com:./glob . 

On zod:

1
2
~zod:dojo>|commit %limsn
~zod:dojo>|install our %limsn

Assuming fake zod is on your local machine you can point your browser to localhost:8080 and see landscape with a new LIMS*Nucleus tile with spinner indicating “loading”. For AWS I use my temporary IP: http://3.142.185.219:8080.

To complete the install you must upload the glob. First modify index.html to suit your needs:

index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script src="https://unpkg.com/@urbit/http-api"></script>
<script src="/session.js"></script>
</head>
<body>
</body>
<script>
location.replace('http://3.145.214.48:3000/urbit?name=' + window.ship);
</script>
</html>

The javascript helper scripts are discussed in the http api guide. Note the ‘window.ship’ variable which provides the ship name (‘zod’ in this example) for appending to your web app’s urbit controller. In LIMS*Nucleus, urbit ids must be white listed in the ‘person’ table:

1
2
3
4
5
6
7
8
9
10
11
lndb=> select * from person;
id | lnuser | passwd | salt | email | usergroup
----+----------+------------------+------------------+-------------------+-----------
1 | ln_admin | 1d52114553ae31b3 | a39b69e5fd79854b | info@labsolns.com | admin
2 | ln_user | ca6468f6ff4a82e6 | e999f4c34635f943 | | user
3 | demo | 97f8647f1067346d | 55ecb01c50cb1ae1 | | user
7 | zod | 1f4973fea4b98a05 | 616c7e5555c1df62 | | admin
8 | nus | 9a58637cbeab8afc | 8e4d24fcb45af66c | | user
(5 rows)

lndb=>

Note the the urbit ID password hashes are a hash of the salt only as the password is blank. Urbit users come to the app prevalidated.

To upload the glob navigate to localhost:8080/docket/upload, select the limsn desk, press browse and select the glob directory and press the “glob!” button. Returning to zod you should now see:

Click on the LIMS*Nucleus tile and you will be redirected to the web app and logged in.

To allow zod to distribute this link, at the dojo:

1
~zod:dojo>:treaty|publish %limsn

Now if I create a fake ~nus on the same instance of AWS but broadcast on port 8081, I can query ~zod on 8080 for software offered. We can piggyback on the Urbit desk distribution mechanism to distribute software - though in this example we are simply distributing a hyperlink allowing redirection:

Videos

LIMS*Nucleus

Overview and functionality

Navigating the LIMS*Nucleus Interface

Tutorial 1

Sample and Target Replication

Designing plate layouts

LIMS*Nucleus installation on AWS EC2

LIMS*Nucleus installation using a Guix pack

Install the LIMS*Nucleus PostgreSQL database on AWS Relational Database Service (RDS)

Use a Guix Pack to install LIMS*Nucleus on Windows 11/WSL2

Verify users and assign permissions using Urbit IDs

Register LIMS*Nucleus to activate the maxplates configuration parameter

Guix

Modular LIMS Development with Guix

Guix package a Guile module

Guix package a Debian archive file

Set up a Guix channel

Guix package an R library

Guix package a Shiny app

Run multiple Guix packaged Shiny apps on a shared Shiny server

Contribute a package recipe to Guix nonguix

How Guix enables reproducible computing

Windows 11

LIMS*Nucleus is a client/server application requiring a PostgreSQL database server and an Artanis web server. For use in production, installation on data center or cloud servers is most appropriate. However if you are a Windows user, you may wish to evaluate LIMS*Nucleus on your personal laptop. For that purpose installation on Windows Subsystem for Linux 2 directions are provided below. Note that the easiest way to evaluate LIMS*Nucleus is to work with the instance running on Amazon Web Services. A video is available that describes installation of the client on Windows.

Install WSL2

WSL2 on Windows 11 has been tested. Use the windows search tool to find cmd. Open a command prompt in administrative mode:

Install the Debian version of linux.

1
C:\Windows\System32> wsl --install -d Debian

You will need to reboot. Upon reboot you will set up your personal user. Use the name “admin” which is the user name hardcoded in the Postgresql installation scripts. If you wish to use a different name, the scripts will need to be modified. Once Linux is installed, install required Linux utilities:

1
2
$ sudo apt update
$ sudo apt install xz-utils wget

Install LIMS*Nucleus

Launch Linux:

Dowload and run the install script:

1
2
3
4
$ sudo wget https://labsolns.com/limsn/evaluate/install-limsn-pack.sh
$ chmod 777 ./install-limsn-pack.sh
# export PATH="$HOME/bin${PATH:+:}$PATH"
$ sudo ./install-limsn-pack.sh

When prompted indicate IP: 127.0.0.1
Number of plates per plateset: 100 is reasonable
Do you want to set up a local database? “y”

Launch LIMS*Nucleus

1
$ start-limsn.sh

Troubleshooting

Can’t sudo apt update

1
$sudo nano /etc/resolv.conf

Resolve.conf should look like:

resolve.conf
1
2
3
4
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to />
# [network]
# generateResolvConf = false
nameserver 8.8.8.8

Can’t create directories

Sometimes Linux is started and you do not have permission to create directories. To take ownership of your home directory execute sudo chown -R $USER .

Test and make sure you can mkdir.

Error: “Do you have an /etc/artanis.conf” file?

Most likely the script did not have permission to create directories (see above) so the following must be executed manually:

1
2
3
$sudo mkdir -p ./.config/limsn
$sudo cp ./gnu/store/l67854c56rpv9k8z8kpipfs99h0yjg4a-limsn-0.1.0/share/guile/site/3.0/limsn/conf/artanis.conf ./.config/limsn
$sudo nano ./.config/limsn/artanis.conf ##edit connection parameters as needed

Can’t connect to database

Error: artanis/db.scm:162:6: Throw to key artanis-err' with args(500 #<procedure create-new-DB-conn ()> “Database connect failed:” “could not connect to server: Connection refusedthe server running on host "127.0.0.1" and accepting/IP connections on port 5432?”)’.

If you restart the terminal, you will need to restart the database server:

1
$ sudo pg_ctlcluster 13 main restart

Check that the database is available:

1
$ psql -U ln_admin -h 127.0.0.1 lndb

Configure the database manually:

1
2
3
$ sudo sed -i 's/host[ ]*all[ ]*all[ ]*127.0.0.1\/32[ ]*md5/host    all        all             127.0.0.1\/32        trust/' /etc/postgresql/13/main/pg_hba.conf
$ sudo sed -i 's/\#listen_addresses =/listen_addresses =/' /etc/postgresql/13/main/postgresql.conf
$ sudo pg_ctlcluster 13 main restart

Check environment variables

ERROR: no code for module (dbi dbi)

1
printenv | grep GUI

You should see GUILE related environment variables e.g. GUILE_LOAD_PATH; if not try:

1
$ sudo ./bin/init-limsn-pack.sh

or manually modify .bashrc loaded environment variables:

1
2
3
4
echo export LC_ALL=\"C\" >> $HOME/.bashrc
echo export PATH="$HOME/bin${PATH:+:}$PATH" >> $HOME/.bashrc
echo export GUILE_LOAD_PATH="$HOME/gnu/store/rj0pzbki1m5hpcshs614mhkrgs2b3i9d-artanis-0.5.2/share/guile/site/3.0:$HOME/gnu/store/780bll8lp0xvj7rnazb2qdnrnb329lbw-guile-json-3.5.0/share/guile/site/3.0:$HOME/gnu/store/jmn100gjcpqbfpxrhrna6gzab8hxkc86-guile-redis-2.1.1/share/guile/site/3.0:$HOME/gnu/store/3f0lv3m4vlzqc86750025arbskfrq05p-guile-dbi-2.1.8/share/guile/site/2.2${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" >> $HOME/.bashrc
echo export GUILE_DBD_PATH="$HOME/gnu/store/z5kilafxayw2kdvn3anw1shkqij17dqb-guile-dbd-postgresql-2.1.8/lib" >> $HOME/.bashrc

Terminal resart will be necessary.

Find artanis.conf in the store

1
find ./gnu/store -wholename '*artanis.conf'

Delete Linux

You can delete the Linux instance to recover space, clean up, or start over:

1
$sudo wsl --unregister Debian

Tutorial 2 - canonical workflow with sample replicates

Tutorial 1 covers in detail steps that are glossed over in this tutorial.

Looking at available layouts there are 2 that offer replication - 2S4T and 4S2T:

2S4T: Entire plate coated with the same target, samples in duplicate. Note that sample replicates are in the same row.

4S2T: Each sample tested in duplicate on 2 targets. Note that target replicates are in the same column. (see tutorial 3 )

Following tutorial 1 I will rearray the 10 plates of PS-6 into a new plate set applying the 2S4T layout. 10 96 well plates in duplicate will requires 5 384 well plates:

Submit and confirm on the next screen. Note that selections made in the sample replication dropdown limit the options available under target layout - in this case only the default is available. View the target layout for a discussion on optional target layouts, which are only used for data annotation.

Click submit to create the new plate set PS-10. Select and assaociate data with the plate set. Use the data file plates384x5_2S4T.txt which contains demonstration data for 5 384 well plates. The data has been generated such that replicates are side by side in the same row and are +/-10% of each other. In the graph below replicates for one plate are color coded and appear at the same X value:

Looking at the response trellised by plate and colored by sample type:

Associate the data with the plate set:

Select the file:

Fill in the required information. Note that I am auto-selecting hits (all samples with a response greater than 3 standard deviations fromt the mean of the negative controls) which activates the hit list name and description text boxes. I did not choose to select the Top N hits so the box where I would enter N remains disabled.

Click import and after a few seconds you are taken to the ‘Plates for PS-10’ page where you can scroll down and see the new assay run and hit list:

Click on the AR-7 link to see a plot of the data. Note that the associated hit list HL-8 has 155 hits.

Responses are plotted in decreasing order with controls color coded. Not that if you select normalized response with a hit threshold set to mean(background)+/-3SD, 155 hits will be identified. The hit list could have been created here, but was already auto-generated on import.

Looking at the hit list view you can see that PS-6, 96 well plates contain all 155 hits that can be rearrayed into two 96 well plates.

Once rearrying is complete, creating PS-11, that plate set is annotated with a worklist indicating that it was generated by a rearray activity. The worklist can be used to physically rearray the samples into the new plate set PS-11.

Tutorial 3 prepares a target layout for the Tutorial 4 discussion on target replication.

Tutorial 3, target layout definition

In tutorial4 we will run through the canonical workflow using duplicate targets. We could use the built in defaults target1, target2 etc., but we will assume you have a companion database that holds target specific information, and we wish to merge our assay data with the target information.

Assume we are screening transferrin receptor (CD71) antibodies against the receptor and a negative control - BSA. First we need to register the targets in our system. Use the target import file defined here. Select the menu item Targets/All Targets, (Note: if you are using the cloud demo database these targets have already been imported for you.) and select the ‘Bulk Target Upload’ option under the tools menu. Indicate the location of the downloaded targets.txt and import. The targets are now registered within project 10 and available in the targets dropdown.

Navigate into project 10 and select Targets/All Target Layouts. Select ‘Add Target Layout’ under the tools menu. Fill in Name and description and select Replication = 2. Select huCD71 for quads 1,3 (noting that target duplicates are always in the same column, sample duplicates in the same row). Select BSA for quads 2,4.

The layout will now be available during plate set creation or reformating within project 10:

Note that “TLY-4”” is only available in project 10 and only when target layout is set to “2”, which is only available when sample replication is set to 2 or 4.

Tutorial 4 will use this target layout with a new plate set created by reformatting.

Tutorial 4 - canonical workflow with target replicates

Tutorial 1 covers in detail steps that are glossed over in this tutorial. Tutorial 3 covers creation of the target layout.

Looking at available sample layouts there are 2 that offer replication - 2S4T and 4S2T:

2S4T: Entire plate coated with the same target, samples in duplicate. Note that sample replicates are in the same row. (see tutorial 2 )

4S2T: Each sample tested in duplicate on 2 targets. Note that target replicates are in the same column.

Following tutorial 1 I will rearray the 10 plates of PS-6 into a new plate set applying the 4S2T sample layout. Ten 96 well plates in quadruplicate will requires ten 384 well plates, one 96 well plate in all 4 quadrants of a 384 well plate:

I will use the target layout created in tutorial 3 as the target layout, providing me with duplicate assay results for each sample.

Use the data file plates384x10_4S2T.txt which contains demonstration data for ten 384 well plates. The data has been generated such that replicates are one above the other in the same column and are +/-10% of each other. In the graph below replicates for one plate are color coded and appear at the same X value:

Looking at the response trellised by plate and colored by sample type:

Associate the data with the plate set. Note that plate set, hit list, and assay run ids may differ from what is shown if you worked through all the tutorials:

Select the file you downloaded:

Provide requested information and import data:

View the assay run and hit list under PS-12

Navigate into HL-9 and view hit availability. Note that the hit list has 306 hits. PS-6 is the master plate that provides the hits. The discrepancy is discussed below.

Responses are plotted in decreasing order with controls color coded. Not that if you select normalized response with a hit threshold set to mean(background)+/-3SD, 306 hits will be identified. The hit list could have been created here, but was already auto-generated on import.

View the new plateset PS-13. Note the associated worklist because this plate set was created by a rearray action.

Note that the hit list contains 306 hits but the parental plate set PS-6 only contains 276 of the samples designated as clones. Seven of our samples have scored as hits on both target 1 and 2. This can be seen in the exported worklist below. For example sample SPL-2829 scored on both targets, but will be rearrayed only once. To characterize which samples score on which target, you must export the results and analyze outside LIMS*Nucleus.

Processed data can be exported for further analysis. While viewing an assay run, use the ‘View all data’ to generate a table that can be exported to Excel:

Results are exported into whatever application you have associated with .csv files:

Note that due to the use of defined targets, the target annotation appears in the worksheet. For targets both the name and accession are available. Sample accessions were not imported and so don’t appear. Compare to an analysis where the default target annotation is used, such as PRJ-1, AR-1. The generic target label “Target1” is used, without any associated accession:

You have been unsubscribed

The email address will no longer receive correspondence from Laboratory Automation Solutions.

Apologies for the inconvenience.

Table of Contents

Introduction

Overview
Monoliths
Systems

Installation

Install

Workflows

General navigation
Create a plate set
Reformat 96 well plates into 384 well plates
Associate assay data with a plate set
Identify hits using an assay threshold
Generate liquid handling robot work lists
Rearray hits into a new plate set
Group two plate sets into a single plate set
Regroup plates within a plate set into a new plate set (split)
Import accession IDs

Utilities

Terminology
Simplifying assumptions

Troubleshooting

LIMS*Nucleus Errors

Browser cookie management can sometimes go awry. Clear the cookies associated with the LIMS*Nucleus (LN) URL and go back to the login page to reset the session id cookie.

Firefox: web/developer/web console while the LN URL is in the address bar. Select the storage tab. On the left under cookes right click on the LN URL and choose delete all. Login to LN. You should see a new cookie ‘sid’ appear.

Chrome: more tools/ developer tools select the LN URL and right click ‘clear’. Login to LN. You should see a new cookie ‘sid’ appear.

ERROR: In procedure setlocale: In procedure setlocale: Invalid argument

1
$ export LC_ALL="C"

ERROR: In procedure open-file: In procedure open-file: No such file or directory: “/tmp/limsn/tmp/cache/route.cache”

1
$ mkdir -p /tmp/limsn/tmp/cache

AWS Errors

Secure Connection Failed. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

LIMS*Nucleus does not yet use secure network transfer protocol. If your browser tries to redirect you to an ‘https://’ URL, manually remove the s to change back to ‘http://’