From 3776decfffb8260ec5c582dd804b04d958e03257 Mon Sep 17 00:00:00 2001 From: Kevin Bonham Date: Fri, 18 Aug 2023 14:23:33 -0400 Subject: [PATCH] Fix bug in taxon that screws up with non Strings --- src/features.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features.jl b/src/features.jl index 20e3d18..0fa8e72 100644 --- a/src/features.jl +++ b/src/features.jl @@ -90,6 +90,7 @@ Taxon("Prevotella_copri", :species) ``` """ function taxon(n::AbstractString) + n = String(n) m = match(r"^([dkpcofgstu])__(.+)", n) isnothing(m) && return Taxon(n) return Taxon(string(m.captures[2]), _shortranks[Symbol(m.captures[1])]) @@ -249,4 +250,4 @@ retentiontime(m::Metabolite) = m.rt @test ismissing(masscharge(m2)) @test ismissing(masscharge(m2)) -end \ No newline at end of file +end