Labelling, Tracking, and Collecting Data from Biological Samples

Tools to generate unique identifiers and printable barcoded labels for sample management. The creation of unique ID codes and printable PDF files can be initiated by standard commands, user prompts, or through a GUI addin for R Studio. Both single-level and hierarchical labels can be created in the command line interactively or non-interactively.


Status Downloads

Open-source label generation for more repeatable workflows with biological samples

Yihan Wu and Robert I. Colautti

Cheat Sheet

A 2-page, quick-reference guide is available via Figshare

Overview

Flowchart of major functions

Quick Start:

EITHER install directly from CRAN

install.packages("baRcodeR")
library(baRcodeR)

OR install the pre-release of the latest version:

devtools::install_github("yihanwu/baRcodeR", build_vignettes = T)
library(baRcodeR)

Introduction

baRcodeR is a R package for generating unique indentifier strings and printable 2D (QR) barcodes, with the aim of improving repeatability of labelling, tracking and curating data from biological samples. Specifically, users can:

  • generate simple ID codes (Ex001, Ex002, Ex003 ...),
  • generate hierarchical (i.e. nested) ID codes (A01-B01, A01-B02, A02-B01, A02-B02, A03-B01 ...),
  • generate printable PDF files of paired ID codes and QR barcodes with default spacing for ULINE 1.75" * 0.5" WEATHER RESISTANT LABEL for laser printer; item # S-19297 (uline.ca)
  • customize the PDF layout for any type of printable format (e.g, vinyl stickers, waterproof paper)
  • generate reproducible code for archival purposes (e.g. in publications or online repositories)
  • create CSV files to link unique IDs and sampling hierarchy with downstream data collection workflows

Using the RStudio addin

The main baRcodeR functions for unique identifiers and QR code generation can be performed interactive via the RStudio addin found on the toolbar.

Screenshot of RStudio Addins toolbar

Click on the add-in, and a popup window will appear. NOTE the 3 tabs along the bottom, corresponding to the three main baRcodeR commands: uniqID_maker, uniqID_hier_maker and create_PDF.

Screenshot of the simple ID Code tab

The first tab generates basic ID codes:

Active simple ID code tab

As you fill in the fields, a preview of the ID codes will appear on the right-hand side along with reproducible code, which can be copied for archival purposes. Clicking 'Create Label.csv' will create a CSV file called 'Label_YYYY-MM-DD.csv', which contains a data frame with the full unique ID strings as the first column, the user-defined prefix string in the second column, and the unique ID number in the third column. This file is useful for archiving ID codes and as a starting point for data entry. For example, it can be opened in a spreadsheet program to add data measurement columns. It is also the input for creating printable, QR-coded labels with create_PDF.

Screenshot of the hierarchical ID code tab

You can switch from the simple ID code generation tab to the hierarchical ID code generation or QR code creation tabs at the bottom.

Hierarchical ID codes have a nested structure (e.g. X subsamples from Y individuals at Z time points), the information for each level is saved under the "Hierarchy" section. The "Add level" button is used to add more levels to the hierarchy, and the "Remove level" button will remove the most recently added level. The data frame output will contain ID codes in the first column, and a separate column for each level of the hierarchy, with the user-defined string as the header; as shown under 'Preview'. As with the simple ID code tab, the output of Hierarchical ID codes is a CSV file "Labels_YYYY-MM-DD.csv", saved in the working directory. This file is useful for archiving ID codes and as a starting point for data entry. For example, it can be opened in a spreadsheet program to add data measurement columns. It is also the input for creating printable, QR-coded labels with create_PDF.

Screenshot of PDF creation tab

The Barcode Creation tab contains all the advanced options for page layout. The default options fit a specific format: ULINE 1.75" * 0.5" WEATHER RESISTANT LABEL for laser printer; item # S-19297 (uline.ca). A text file containing ID codes is imported by clicking the "Browse" button and selecting the CSV text file in the file browser. The file is be previewed by clicking "Import File".

Screenshot of Column Selection

After importing a CSV file, the preview shows part of the expected output PDF file based on font size and other layout options. The first column is highlighted by default and defines the column to use for the labels. Clicking on a different column will set it as the ID code column, as shown in the preview.

Clicking "Make PDF" will generate a printable PDF of all barcodes provided. This can take several minutes for >100 barcodes, depending on computer speed. The text "Done" will appear upon completion of the PDF file.

Usage from the console

Please load the vignette "Using-baRcodeR" for console use.

library(baRcodeR)
vignette("Using-baRcodeR")

News

baRcodeR 0.1.2

New Feature:

  • In response to a user request, there is now an option to print linear (code 128 set B) barcodes.

baRcodeR 0.1.1

Bugs and Improvements:

  • create_PDF() function will replace all underscores in text with dashes. Underscores are not specified in the encoding dictionary of qcrode and will throw errors.
  • x_space and y_space parameters are now limited between 0 and 1 for easier use. These parameters are used to position text on the printed labels.
  • Font size is no longer limited and is now measured as points. Font size is automatically reduced if text code is too long for the printed labels.

New Features:

  • label_width and label_height parameters specify the width and height of the label to enable alleys (i.e. gaps) between physical labels.

baRcodeR 0.1.0

This is the first official release of the package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("baRcodeR")

0.1.3 by Robert Colautti, 2 months ago


https://github.com/yihanwu/baRcodeR


Report a bug at https://github.com/yihanwu/baRcodeR/issues


Browse source code at https://github.com/cran/baRcodeR


Authors: Yihan Wu [aut] , Robert Colautti [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Imports DT, grDevices, grid, miniUI, shiny, rstudioapi

Depends on qrcode

Suggests testthat, knitr, rmarkdown


See at CRAN