SampleMan
Simple browser based tool to manage labbooks, images and measurement data of your fabricated samples.
Deprecation warning
This repository was moved to github.com/zaphB/sampleman and is not maintained anymore.
Installation & Running
Make sure node
and npm
are installed on your system. Open up a shell and run node --version
and npm --version
, both should run without an error.
Download or clone this repository. Edit config.json
and enter existing paths for dbDir
, which is where your sample database will be created and uploadDir
, which is the source directory from which attached files, e.g. images are imported later. samplePrefix
specifies the prefix for every sample folder, if it is ABC
the samples folders will be named ABC001
, ABC002
, etc. stepIdLen
specifies the digit count of the step counter, with a value of 3 up to 1000 steps can be stored and still maintain equivalence of logical and alphabetic order in the folder names.
Then run sampleman.sh
, wait until all components are installed and visit localhost:3000
in your browser. Done.
Concepts
TODO: what is a sample and smaple ID? what is a step and step ID? what is a labbook? folder structure
Creating Your First Sample
If you followed the installation instructions you should now see the following in the right side of the browser screen:
In the sample aim field you can enter a title for your sample, ideally describing why you plan to prepare this sample. In this example I chose "learning about stuff" as the smaple aim. Then hit the "New sample: ..." button to create your first sample entry. Next you should see the following:
The left coloumn shows the overview of all your created samples, which is only one sample so far. The sample names are clickable to open the samples labbook. The central column shows the current sample's labbook, which lists all steps done in chronological order, with the oldest step on the bottom. The labbook should currently be empty. The right column allows to add entries to the labbook.
Adding a Step to a Sample
Enter an "step title" and "step description" and hit "add step". Every line in the "step description" field results in a bullet point in the labbook. If you indent lines in the "step description" field with spaces, you can create different levels in the bullet point list.
In this example, I created the following first step:
As you can see, the date, time and an step ID (001 here) are automatically added.
Using Templates
Entering title and description manually every time you add a step is cumbersome. Because you usually do the same or similar step with many samples, templates with placeholders are very helpful to speed things up. For this, create a plain-text file in the templates
folder within your dbDir
folder.
In the first line of the file, write the desired step title. In the following lines, write the desired step description. You can use underscores as placeholders, for text that should be filled in individually for every sample. For example:
Standard cleaning
Immerse sample in solvent ___ for __mins
Let sample dry for ___mins
Inspect sample surface: __________
The filename should end with .txt
, and it is recommended not to use spaces. The templates are listed in alphabetical order of their filenames, a leading number can thus be used to achieve a custom sorting. In this example, the filename 01-cleaning.txt
is chosen. After creating the file, reload the SampleMan frontend in the browser. A new button should appear in the "Load Template" section:
Click it to fill in the "step title" and "step description" fields with the template content. Use the "tab" key to select the placeholders in the step description and enter the desired values. After tabbing through and replacing all placeholders, either press the "add step" button or use "ctrl+enter" to save the step.
Attaching Files to a Step
Next, we want to add some additional files to this step entry. In practice this could be microscopy images or measurement results for example. To add any file, we need the "attach files" section in the bottom right:
There are two possible sources to upload a file from: Directly selecting files via the "choose files" button, or from the local upload folder, which is the directory specified as updloadDir
in config.json
. Checking the "Use local upload folder instead of direct file upload"-checkbox selects the second option, leaving it unchecked uses files selected with the "choose files" dialog.
In the "Identify with step ID"-input, you can optionally enter a step ID to identify the selected files with. If this input remains empty, the files are identified with the latest step.
In the "Upload file count"-input, you can enter a number to limit the amount of files selected from the local upload folder. If left free, all files contained in the local upload folder are used. This setting is ignored if the "choose files" dialog is used as a source for files.
The uploaded files are added to a folder corresponding to the step. The folder is automatically created if it does not exist. The folder name must begin with the step ID, the rest of the name can be changed at will. By default, the folder name is created from the longest word in the step title.
Attached image files in the jpg
or png
formats are displayed in the sample gallery in chronological order. The labbook/gallery view can be toggled with the [imgs]
/[labbook]
links that appear if there are images attached to a sample: