pub const fn complement_base(base: u8) -> u8Expand description
Complements a single DNA base, normalizing to uppercase except for N/n.
Returns the Watson-Crick complement: A<->T, C<->G. Both uppercase and lowercase A/T/C/G input are normalized to uppercase output.
§Case preservation for N/n
Uppercase ‘N’ and lowercase ‘n’ are returned unchanged (case preserved). This is required for fgbio compatibility in CODEC consensus calling:
-
CODEC uses lowercase ‘n’ for padding when R1/R2 have different lengths (see
codec_caller::pad_consensus). These padded bases are then reverse complemented for ac/bc tags (seecodec_caller::reverse_complement_ss). fgbio preserves lowercase ‘n’ through this operation. -
Simplex/Duplex use only uppercase ‘N’ for no-call bases in production (see
vanilla_callerlines 640, 1024, 1078 andduplex_callerNO_CALLconst). Thepadded_defaultfunction with lowercase ‘n’ exists but is only used in tests. -
Zipper/tag_reversaldo not create ‘n’ bases, only reverse complement existing tag values which come from upstream processing.