Export in SAM/BAM/CRAM format
Read mappings (
) (
) (
) can be exported to the SAM, BAM, or CRAM format.
The following options can be customized upon export:
- Create index When checked, an index file is created, which enables fast random access to specific genomic regions in the exported files. This allows downstream tools and genome browsers to quickly retrieve reads without scanning the entire file. This option is only available in the BAM and CRAM exporters.
- Maximize compatibility When checked, the exported information is adjusted to maximize compatibility with third-party tools such as Franklin and Picard. Mappings of some reads may be modified or reads marked as unmapped, including reads spanning the origin of circular chromosomes.
- Include attributes Comma-separated list of sequence attributes to export as SAM tags. Specifying many attributes can be aided by using special characters:
- A wildcard *. This matches any sequence of characters. For example, entering * would result in all attributes being exported, while UMI* would export all attributes with names that start with UMI.
- A hyphen -. Prefixing an attribute with a hyphen excludes it from export. For example, entering *, -UMI* would result in all attributes begin exported except those with names starting with UMI.
Exported sequence attributes are mapped to SAM tags according to the following rules:
- Sequence attributes corresponding to standard SAM tags are exported using the corresponding SAM tag.
- Sequence attributes with two-character names are exported using that name as the SAM tag.
- Sequence attributes added by CLC tools are exported using tags whose names start with q.
- Any remaining sequence attributes are exported using the following available tag names: YA, YB, ..., ZA, ZB, ..., XA, XB, ....
The header section of the exported file contains @CO comment records describing the mapping from exported SAM tags to sequence attributes.
The special attribute MAPQ, which stores the mapping quality, is exported to the MAPQ field of the SAM alignment record rather than to a SAM tag.
The tags listed below are exported regardless of the choice in Include attributes:
- MD: String encoding mismatched and deleted reference bases
- NH: Number of reported alignments that contain the query in the current record
- NM: Edit distance to the reference
- For bisulfite mapped reads:
- XR, with value CT or GA, describing the read conversion
- XG, with value CT or GA, describing the reference conversion
See SAM/BAM/CRAM export format specification for more details.
