Interpret SAM Flags Without Double-Counting Alignment Records — review worksheet Original StatMedAnalysis template | 2 December 2026 Instructions Use invented demonstration inputs here. Complete each field; mark unknowns explicitly. Preserve the local source file outside this worksheet. This is a bounded audit record, not a complete format-validation certificate. 1. Write the inclusion rule in words before selecting flags. For example, distinguish unmapped records from secondary mappings. 2. Use decimal integer flags from synthetic examples. Retain the original value beside the decoded bits. 3. Decode independent bits rather than treating the integer as a category code. 4. Inspect the multiple-segment bit before interpreting pair-specific flags. 5. Keep secondary and supplementary classifications separate. Counts of flag categories can overlap. 6. Test the proposed filtering rule with records that have several bits set, then apply an established alignment tool to the actual file locally. Blank record Unit of analysis: record/read/template: __________________ Original integer and additive bit decomposition: __________________ Inclusion rule in words: __________________ Overlapping flag categories: __________________ Local filter expression and version: __________________ Finding / action / owner / deadline: __________________ Unresolved limitations: __________________ Report wording: __________________ Analyst / date / version: __________________ Worked hypothetical example — do not confuse with your results The invented value 99 decomposes into 64 + 32 + 2 + 1. Value 147 is 128 + 16 + 2 + 1. Value 260 is 256 + 4: it belongs to both the secondary and unmapped record counts. Across these three supplied records, there is one unmapped record and one secondary record, but adding these counts would not give two distinct records. Reference: https://samtools.github.io/hts-specs/SAMv1.pdf