SAM Flag Decode
Decode SAM FLAG bits and preserve unsupported high bits explicitly.
Description
SAM FLAG encodes alignment properties as independent bits.
SAM FLAG encodes alignment properties as independent bits. A decoder should preserve unsupported bits rather than silently discarding them.1
Decode SAM FLAG bits and preserve unsupported high bits explicitly.
When to use SAM Flag Decode
Use this for the following task: Decode SAM FLAG bits and preserve unsupported high bits explicitly.
Prepare the caller-filtered sequences, counts, coordinates or annotations requested below. Keep identifiers and paired lists aligned on the same reference.
How to use SAM Flag Decode and understand its results
- Prepare the caller-filtered sequences, counts, coordinates or annotations requested below. Keep identifiers and paired lists aligned on the same reference.
- Enter flag using the field table, then run the tool.
- Read enabledFlags, unknownBits. Interpret flags, units, ordering and placeholder values using the rules below.
- Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| flag | Flag | integer; minimum 0; maximum 65535 | Required |
Supply an unsigned 16-bit integer. Decode the twelve standard bits in ascending order and return remaining high bits explicitly.2
enabledFlags = known set bits 1–2048; unknownBits = flag AND complement(4095) This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| enabledFlags | Enabled flags | list of string |
| unknownBits | Unknown bits | integer |
{
"input": {
"flag": 99
},
"output": {
"enabledFlags": [
"paired",
"proper-pair",
"mate-reverse",
"first-segment"
],
"unknownBits": 0
}
} Limitations and assumptions
This does not validate consistency between flags or inspect alignment records. Zero simply enables no listed flags.
The tool operates on supplied local data; alignment, filtering and annotation must already be appropriate for the stated calculation. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.
Alternative or Complementary methods
Choose MAPQ Filter Fraction for this operation: Filter SAM mapping qualities by threshold while treating MAPQ 255 as unavailable. For a complementary task, use Read Pair Orientation for this operation: Classify mapped read strands on the same reference after ordering their distinct leftmost alignment starts.
Further background: Background specification: SAM Flag Decode.
References
-
Background specification: SAM Flag Decode — GA4GH / HTS specifications
-
SAM Flag Decode — tool.io
Similar or alternative tools
- MAPQ Filter Fraction
Filter SAM mapping qualities by threshold while treating MAPQ 255 as unavailable.
- Read Pair Orientation
Classify mapped read strands on the same reference after ordering their distinct leftmost alignment starts.