QR code insect labels from Arctos using free software

I wanted to be able to print small QR codes readable by our Motorla DS6708 scanner directly onto laser-printed insect specimen labels to use with Arctos‘ object tracking system, preferably using free software.  In case this would be useful to anyone else, this post describes my methods.

All of the files mentioned below, including pdf output, are available in a zipped archive here.  Note that most or all of the links to Arctos pages included below will not work for anyone who is not an Arctos operator having the appropriate roles.

Overview

  1. Choose specimens and get comma-separated list of their catalog numbers.  A starting container barcode value will also be needed.
  2. Get flat table containing label data from Arctos.
  3. Run label data through label-generating R script.
  4. Print the labels, check them, and label the specimens.
  5. Create the containers in Arctos.
  6. Move the specimens to the containers in Arctos via the automatically-generated bulkloading file.  Scan the pins into their parent contaiers, etc.

1. Choose specimens and container barcode label start.

A comma-separated list can easily be made using MS Excel, a text editor, etc.  Today I have a list of 330 specimen catalog numbers (most omitted):

1436,
1534,

10175,
10176

My last container label/barcode was KNWRC1225, so today I will be starting with KNWRC1226.

2. Get the label data.

I submit the query below to Arctos via Reports > Write SQL, selecting the CSV format for the result set.

select * from flat where cat_num in (
 1436,
 1534,
 
 10175,
 10176
 )
and COLLECTION = 'KNWR ENTO'

I download the CSV to the folder in which I want to make the labels and rename it something like 2013-03-08-1012_label_data.csv.

3. Run label data through label-generating R script.

Below is the script controlling the generation of the labels.

working.directory <- "J:/mattbowser/labels"
setwd(working.directory)
input.file <- "2013-03-08-1012_label_data.csv"
options(encoding="UTF-8")
source("f_makelabels_2013-03-08-1053.R")
make.labels(
 working.directory=working.directory, 
 input.file=input.file, 
 type="pin", 
 barcode.start=1226, prefix="KNWRC"
 )

Running this script in R generates the labels, but a lot goes on behind the scenes, requiring some free software.

  • R – reshapes the data and calls the other software.
  • XeTeX – does the typesetting.
  • qrcode – generates QR code images in png format.
  • ImageMagick – converts png images to bmp format required by potrace.
  • potrace – vectorizes the bmp images for optimal printing.

The script above calls the function make.labels defined in the text file f_makelabels_2013-03-08-1053.R.  This can take a while.

make.labels calls the function make.qrcodes defined in the file f_makeqrcodes_2012-09-26-1348.R to make the QR codes.  Since I lack authorization to install programs on my workplace computer, the function needs the locations of the executables (qrcode, ImageMagick, and potrace).

The script writes a TeX file, 2013-03-08-1012_label_data.tex,  based on the input data.  It then runs this TeX file through XeLaTeX, generating the labels in pdf format.  The TeX file calls for two customized TrueType fonts to make these labels, DroidSansDotted90.ttf and DroidSansDotted-Bold90.ttf.

Command line output:

[1] "working directory: J:/mattbowser/labels"
[1] "input: 2013-03-08-1012_label_data.csv"
[1] "label type: pin"
[1] "barcode series: KNWRC1226-KNWRC1555"
[1] "output TeX file: 2013-03-08-1012_label_data.tex"
[1] "command: xelatex 2013-03-08-1012_label_data.tex"

The labels can now be printed.

4. Label specimens, etc.

Check over the labels carefully before proceeding.  If they are satisfactory, the labels can now be put onto the pins.

5. Create the containers in Arctos.

A container series matching that of the pdf needs to be made in Arctos via Manage Data > Object Tracking > Create Container Series.  The main R script spits out the start and stop label/barcode values on the command line for this purpose.

6. Move the specimens to the containers in Arctos.

make.labels generates a file for this purpose, 2013-03-08-1012_label_data_upload.csv.  Upload this file via Enter Data > Batch Tools > Parts>>Containers. Now these pins can be scanned into their parent containers

New Publication: A worldwide review of the genus Arganthomyza Roháček, with revision of the Nearctic species (Diptera: Anthomyzidae)

In this monograph published in the journal Zootaxa in January, members of the genus Arganthomyza (formerly within Anthomyza) were treated.  Two of the five species described as new occur in Alaska.

This is not an open access article, but the abstract is available at the the URI below.

http://www.mapress.com/zootaxa/2013/f/z03604p072f.pdf

Presentations from the 6th annual meeting

Presentations from the 6th annual meeting are now available via the links below.

The University of Alaska Museum Insect Collection’s switch to using Arctos: A review of the good, the bad, and the ugly. Derek Sikes, UAF, UAM.

A first look at defoliation events on the Kenai Peninsula from 2000-2012 using MODIS data. Matt Bowser, USFWS.

Developing an improved trapping tool to survey cerambycid beetles: evaluation of trap type, height, habitat, and lure composition. Liz Graham, USDA Forest Service.

White Sweetclover, Pollination and Berry Production: What’s the Buzz? Christa Mulder, Katie Villano, and Laura Schneller, UAF.

Systematics of Alaskan Aegialites Beetles: Extremely Endemic or Oversplit?. Casey Bickford, UAF, UAM.

Denali Bug Camp 2012. Sayde Ridling, UAF, UAM.

Forest insect conditions in Alaska. James Kruse, USDA Forest Service.

New Publication: Factors influencing northern spruce engraver colonization of white spruce slash in interior Alaska

In this article, which appeared in the February 2013 issue of Forest Ecology and Management, the authors studied the effects of several slash treatments on colonization rates and reproductive success of the northern spruce engraver (Ips perturbatus) on white spruce (Picea glauca). The full article should be available at one of the URI’s below.  A second URI has been provided because dx.doi.org appeared to be unavailable at the time of this posting.

http://dx.doi.org/10.1016/j.foreco.2012.09.040

http://www.sciencedirect.com/science/article/pii/S0378112712005919

Quick review of the sixth annual meeting

We met in the DNR building amid Fairbanksian winter weather (-30’s °F).  Students, professionals, and a guest speaker gave talks on a wide variety of entomological topics.  The Student Presentation Award goes to UAF student Casey Bickford for her presentation, “Systematics of Alaskan Aegialites Beetles: Extremely Endemic or Oversplit?”

At the business meeting, we committed to judging and awarding prizes for entomological projects at three regional science fairs (Fairbanks, Anchorage, and Juneau) to encourage students’ entomological pursuits. Liz Graham (US Forest Service, Juneau) was elected as our new vice president.

Appearing soon will be more products of the meeting:  a more complete review in the upcoming Newsletter, presentations posted on this website, and minutes from the business meeting.

Thanks to Derek Sikes and Jim Kruse for opening up their homes for get-togethers on Friday and Saturday.

New Publication: New aquatic insect (Ephemeroptera, Trichoptera, and Plecoptera) records for Alaska, U.S.A.: range extensions and a comment on under-sampled habitats

In this article, which appeared in October 2012 issue of The Pan-Pacific Entomologist, the authors reported on eight aquatic insect species new to Alaska, each representing a North American range extension.  The full article is available at the URI below.

http://www.bioone.org/doi/full/10.3956/2012-37.1

Working agenda for the annual meeting

A printable, pdf version of the agenda below is also available.

Alaska Entomological Society Sixth Meeting, 25-26 Jan 2013

Alaska Department of Natural Resources large conference room, 3700 Airport Way, Fairbanks (DNR Building; Actually on Sportsman’s Way across from Fred Meyer West gas station.  Enter via employee’s entrance – door next to loading dock. Large conference room is straight in, jog right, then jog left)

Agenda

Friday, 25 January

Time                                       Activity/Talk Title – Presenter  

1900-2100         Optional social, Derek Sikes residence

Saturday, 26 January, Location: DNR Large Conference Room

Time                                       Activity/Talk Title – Presenter              

0900-0920         Welcome, introductions, general announcements

0920-0945         Round robin of entomological activities in Alaska (Bioblitz, new projects, classes, opportunities, other – bring your idea or announce your project!)

0945-1005         The University of Alaska Museum Insect Collection’s switch to using Arctos: A review of the good, the bad, and the ugly. Derek Sikes, UAF, UAM.

1005-1020         A first look at defoliation events on the Kenai Peninsula from 2000-2012 using MODIS data. Matt Bowser, USFWS.

1020-1035         Break

1035-1055         Developing an improved trapping tool to survey cerambycid beetles: evaluation of trap type, height, habitat, and lure composition. Liz Graham, USDA Forest Service.

1055-1120         White Sweetclover, Pollination and Berry Production: What’s the Buzz? Christa Mulder, Katie Villano, and Laura Schneller, UAF.

Student Talks

1120-1135         Systematics of Alaskan Aegialites Beetles: Extremely Endemic or Oversplit?. Casey Bickford, UAF, UAM.

1135-1155         Denali Bug Camp 2012. Sayde Ridling, UAF, UAM.

1155-1300         Lunch

1300-1315         The 2012 Red Admiral invasion of Alaska, and other lepidopteran oddities. Ken Philip, Alaska Lepidoptera Survey, UAF, UAM.

1315-1330         Forest insect conditions in Alaska. James Kruse, USDA Forest Service.

1330-1333         An origami unit tray in three minutes flat. Matt Bowser, USFWS.

1333-1400         Break

1400-1600         Society business meeting

  Membership, membership management

  Election/re-election of officers

  Communications: website, newsletter

1600-1630         Bin items, farewell

 

Entomology presentations from the 2012 Alaska Invasive Species Conference

Proceedings from the 13th annual Alaska Invasive Species Conference (October 30 – November 3, 2012) are now available at the proceedings’ web page.  Five presentations (links provided below) cover entomological topics.

Defoliation at Peter's Creek exit on Glenn Highway

Band of shrub defoliation above treeline from Michael Rasy’s 2012 CNIPM conference presentation. Photo by John Lundquist (USFS) a the Peter’s Creek exit on the Glenn Highway, 2012.

Katie Spellman (UAF, Fairbanks) presented her investigation of how exotic white sweet clover affects pollination and fruit production of native berry-producing shrubs. Michael Rasy (UAF Cooperative Extension Service, Anchorage) and Nathan Lojewski (Chugachmiut) focused on recent severe defoliation of deciduous shrubs in southcentral Alaska, mostly by Geometrid moths.  Elizabeth Graham (USFS, Juneau) covered a range of forest health topics, including aerial detection surveys and exotic insect forest pests.  Mia Kirk provided an update on the 2011-2012 Alaska Firewood Survey.

White Sweetclover, Pollination and Berry Production: What’s the Buzz??

Katie Villano Spellman, Univeristy of Alaska Fairbanks, Department of Biology and Wildlife, Laura Schneller, University of Alaska Anchorage, Department of Biological Sciences

Geometrid Moth Impact to Berry Production and Subsistence Crops

Nathan Lojewski, Chugachmiut

Geometrid Moth Activity in Southcentral Alaska

Michael Rasy, University of Alaska Fairbanks, Cooperative Extension Service

US Forest Service Forest Health Protection: Insects, Diseases, and Aerial Detection

Lori Winton, Tom Heutte, and Elizabeth Graham US Forest Service, Forest Health Protection

Alaska Firewood Survey

Mia Kirk, Department of Natural Resources, Division of Agriculture