DADA2 assignTaxonomy writes "NA" at every rank it could not assign.
Protoctist read it as a taxon named "NA": TaxPath("Eukaryota;Alveolata;
NA;NA") reached 4 ranks, at_rank 3 returned "NA", and the tree gained
nested "NA" nodes. The docs called this the one silent pitfall and told
users to pre-convert. The maintainer chose to fix it in the library.
- TaxPath: a label that is exactly "NA" is the unfilled rank (""), so
trailing NAs drop and the path stops at its last real rank. Only the
exact R missing-value token is special; "na" stays a label. No PR2 or
SILVA taxon is named NA.
- Tests: 6 cases (trailing NAs, interior NA, all-NA, lowercase kept).
- Docs: README, docs/README, cookbook (the R recipe now pastes the ranks
as they are), lineage-formats, EXPLAINME; the troubleshooting section
for the pitfall is removed. Count cells of NA are still an error.
Pkg.test() on Julia 1.11.7: Aqua 11, behaviour 115.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZnB2Fzqf8br8DGDD4k
Summary
DADA2
assignTaxonomywritesNAat every rank it could not assign. Protoctist read it as a taxon named "NA":TaxPath("Eukaryota;Alveolata;NA;NA")reached 4 ranks;at_rankat rank 3 returned"NA";NAnodes.The docs called this "the one silent pitfall" and told users to pre-convert. The maintainer chose to fix it in the library instead.
Changes
src/types.jl(TaxPath): a label that is exactly"NA"becomes the unfilled rank (""). TrailingNAs drop, and the path stops at its last real rank, so"Eukaryota;Alveolata;NA;NA"equals"Eukaryota;Alveolata". Only the exact R missing-value token is special:"na"stays a label. No PR2 or SILVA taxon is namedNA.test/cases/types.jl: 6 cases (trailingNAs, an interiorNA, all-NA, lowercase kept).README.adoc,docs/README.adoc,docs/EXPLAINME.adocanddocs/guide/lineage-formats.adocnow say thatNAis read as an unfilled rank.docs/guide/cookbook.adoc: the R recipe now pastes the ranks as they are (paste(r, collapse = ";")), and its example row showsNA.docs/guide/troubleshooting.adoc: the section for the pitfall is removed.NAis still an error.RSR Quality Checklist
Required
Pkg.test()on Julia 1.11.7: Aqua 11, behaviour 115)unsafeblocks without// SAFETY:comments.envfiles includedAs Applicable
Testing
TaxPath("Eukaryota;Alveolata;NA;NA")had length 4, andat_rank(p, PR2_RANKS[3]) == "NA".at_rankreturnsnothing. A tree built from the DADA2 lineage and a Ciliophora lineage has noNAnode.Pkg.test(): 126 pass.Generated by Claude Code