Description
Split a supplied SAM-style optional-field token into tag, type and value text.
Sequence formats distinguish coordinate origins, included endpoints, allele separators and identifier grammars. A genomic interbase position differs from a base number, and a parsed optional-field value may still violate its declared type. Local token checks preserve representation without validating a complete file, sequence, reference assembly or biological interpretation.
Split a supplied SAM-style optional-field token into tag, type and value text.
When to use this tool
Use SAM Optional Field Type Token when you already have fieldToken and need to split a supplied SAM-style optional-field token into tag, type and value text.
How to use the tool and how it works
- Enter fieldToken. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read tag, typeCode, valueText. Use the output convention below.
Require a two-character ASCII tag beginning with a letter, then a letter or digit; require : and one of A,i,f,Z,H,B and another :. Reject tab/CR/LF in the remaining value, then return the three parts.1
An optional SAM field combines a tag, type and value. Complete conformance also requires the value to satisfy that type; splitting the token does not perform those checks.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| fieldToken | Field Token | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| tag | Tag | Required. Text; maximum UTF-16 length 8192. |
| typeCode | Type Code | Required. Text; maximum UTF-16 length 8192. |
| valueText | Unparsed suffix after TAG:TYPE:; can be empty and is not validated against typeCode. | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"fieldToken": "NM:i:3"
},
"output": {
"tag": "NM",
"typeCode": "i",
"valueText": "3"
}
} Limitations and assumptions
- The value can be empty and is not parsed according to its type. This is a lexical subset check, not validation of a complete SAM record, array subtype, numeric range or reference alignment.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use the complete applicable file specification and a full format validator for conformance. Verify reference assembly, sequence bounds, annotation and database context before interpreting local fields or coordinate transformations.
References
-
Calculation and input contract: bioinformatics/sam-optional-field-type-token — tool.io
-
Sequence Alignment/Map Format Specification, SAM 1.6 — SAM/BAM Format Specification Working Group
Similar or alternative tools
- GTF Quoted Attribute Token
Format one supplied GTF-style quoted attribute.
- FASTA Header Accession Split
Split a supplied FASTA header into accession and description text.