mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-04-30 12:00:39 +00:00
10 lines
279 B
Lua
10 lines
279 B
Lua
|
|
-- Adds a 'sample' attribute by extracting the prefix before the first underscore
|
||
|
|
function worker(sequence)
|
||
|
|
local id = sequence:id()
|
||
|
|
local sample = string.match(id, "^(.-)_")
|
||
|
|
if sample then
|
||
|
|
sequence:attribute("sample", sample)
|
||
|
|
end
|
||
|
|
return sequence
|
||
|
|
end
|