StrainCode

A gem for parsing and formatting strain numbers from microbiological culture collections

Installation

gem install strain-code

Usage

require 'strain-code'

# Parse one or more numbers in a variety of formats
str_no = StrainCode.parse "  ATCC 33152  = CCUG 9568  = CIP 103854  ;\n  DSM 25069  = DSM_7513  = JCM:7571;\n  NBIMCC:8848 = NCTC 11192, Strain Philadelphia 1\n"

# Get the URLs to the entry in the corresponding catalogues
str_no.map(&:url)

# Get the name and country of each catalogue (if available)
str_no.map(&:catalogue).map { |i| [i.name, i.country_code] if i }