# SAM Format Essentials: Fields, Flags, and CIGAR Strings Explained

SAM (Sequence Alignment/Map) is a tab-delimited plain-text format in which every line describes one sequencing read and where it aligned on a reference genome. Each alignment line has 11 mandatory fields, and three of them (FLAG, MAPQ, and CIGAR) carry almost all of the information a downstream tool needs to decide whether a read is trustworthy.

Alignment is the pivot point of nearly every next-generation sequencing workflow. Reads arrive as FASTQ, get placed on a reference, and from that moment forward almost everything is computed from alignment records. A standard bulk RNA-seq protocol built on SRA Toolkit, FastQC, Trimmomatic, BWA or HISAT2, Samtools, and Subread moves explicitly through format conversion and paired-end handling because the alignment file is what counting, visualization, and differential expression all depend on [1]. Software that works by read identifier rather than by coordinate exists because the volume of DNA and RNA data stored in BAM files is large enough that retrieval strategy matters [2]. Understanding SAM fields, flags, and CIGAR strings is therefore not an academic exercise. It is the difference between a filter that removes artifacts and one that silently removes half your data.

| Format | Encoding | Typical use | Random access |
|--|--|--|--|
| FASTQ | Text | Raw reads with per-base quality | No |
| FASTA | Text | Reference sequence, transcripts, peptides | Yes, with an index |
| SAM | Text, tab-delimited | Read alignments | No |
| BAM | Binary, BGZF-compressed | Read alignments in production | Yes, with an index |
| CRAM | Binary, reference-based compression | Archival alignment storage | Yes, with an index |

## What Does SAM Bioinformatics Mean?

In practice, "SAM bioinformatics" means the craft of working with alignment records as data structures rather than as opaque files. That work includes parsing the 11 fields, decoding the FLAG integer into its twelve independent bits, walking a CIGAR string to reconstruct which reference bases a read covers, and choosing the correct conversion path between SAM, BAM, and CRAM.

The format is defined by a public specification that fixes field order, delimiter, flag bit meanings, and CIGAR operator semantics. Because that specification is stable, a BAM written by BWA in 2015 can be read by Samtools in 2026 without conversion. Stability is why alignment files remain the exchange currency of genomics even as raw signal formats churn. Nanopore raw data, for example, is still contested territory between POD5 and the open SLOW5 family, with benchmarking showing that binary SLOW5 (BLOW5) outperformed POD5 for sequential and random-access reading on most systems tested [3]. Alignment records have no equivalent instability.

There is a naming collision worth knowing about. In statistics, "SAM" also abbreviates Significance Analysis of Microarrays, a differential-expression framework. When a paper mentions block-SAM for mass spectrometry imaging or single-cell data, it is discussing a statistical test, not a file format [4]. Context resolves the ambiguity quickly, but beginners searching for "SAM bioinformatics interpretation" sometimes land on the wrong literature.

## Anatomy of a SAM File: Header and Alignment Lines

A SAM file has two sections. Header lines begin with `@` and appear before any alignment. Alignment lines follow and contain no leading `@`. Within a file, all header lines must precede all alignment lines.

### Header record types

- `@HD` carries the format version (`VN`) and the sort order (`SO`). Sort order values include `unsorted`, `queryname`, and `coordinate`. A `coordinate` sort is a prerequisite for indexing.
- `@SQ` declares one reference sequence, with `SN` for the sequence name and `LN` for its length. Every `RNAME` used by an alignment must be declared here. Optional tags such as `AS` (assembly) and `M5` (MD5 checksum of the sequence) help pin the exact reference used.
- `@RG` declares a read group, with `ID` as the required identifier plus optional `PL` (platform), `LB` (library), and `SM` (sample). Read groups are how a single BAM can carry several libraries or samples without losing track of which is which.
- `@PG` records a program, with `PN`, `VN`, and `CL` (full command line). A chain of `@PG` lines is a provenance trail, and it is the cheapest way to answer "which aligner version and which parameters produced this file."
- `@CO` holds free-text comments.

The absence of `@SQ` lines is a common cause of failures when streaming alignments between tools. A tool that receives a headerless alignment line cannot validate `RNAME` or compute a reference span, and many parsers reject the record rather than guess.

### A worked alignment line

The following record is illustrative and uses a 37-base read:

```
r001	99	chr1	1000	60	10M2I5M1D20M	=	1200	237	ACGTACGTACGTACGTACGTACGTACGTACGTACGTA	*	NM:i:3
```

The quality field is shown as `*` for readability. A real record carries one ASCII character per base, offset by 33 from the Phred score, so a base quality of 40 is stored as the character `I`.

## The 11 Mandatory Fields, Decoded

| # | Field | Example | Meaning |
|--|--|--|--|
| 1 | QNAME | r001 | Query template name, shared by both mates |
| 2 | FLAG | 99 | Bitwise alignment status |
| 3 | RNAME | chr1 | Reference sequence name, `*` if unmapped |
| 4 | POS | 1000 | 1-based leftmost aligned position, 0 if unmapped |
| 5 | MAPQ | 60 | Phred-scaled mapping quality, 255 if unavailable |
| 6 | CIGAR | 10M2I5M1D20M | Alignment description |
| 7 | RNEXT | = | Reference of the mate, `=` for same as RNAME |
| 8 | PNEXT | 1200 | 1-based position of the mate, 0 if unavailable |
| 9 | TLEN | 237 | Observed template length, signed |
| 10 | SEQ | 37 bases | Read sequence, reverse complemented if on the reverse strand |
| 11 | QUAL | * | Per-base quality, ASCII Phred+33 |

### QNAME and the template concept

QNAME identifies the template, not the individual read. Paired mates share a QNAME, which is why `samtools view` on a queryname-sorted file returns both mates adjacently. A QNAME of `*` means the name is unavailable, which makes the record impossible to pair.

### POS is 1-based and points to the first aligned base

POS is the leftmost position on the reference where an aligned base sits. Soft-clipped bases do not consume reference, so a read that begins `5S10M` has its POS at the first base of the 10M block, not at the first base of the read. Setting POS to 0 signals an unmapped read. Mixing 1-based SAM coordinates with 0-based BED or VCF conventions is one of the most reliable ways to produce an off-by-one variant call.

### MAPQ is a probability, not a score

MAPQ is Phred-scaled, so a value of 60 corresponds to an estimated probability of about one in a million that the alignment is wrong. A value of 0 means the aligner could not distinguish among multiple placements. The special value 255 means the mapping quality is unavailable, not that the read is 255 times better than a MAPQ 1 read. Aligners differ in how they generate MAPQ, so a MAPQ 30 from one tool is not guaranteed to mean the same thing as a MAPQ 30 from another.

### TLEN sign and magnitude

TLEN is the observed template length for paired reads. The leftmost segment gets a positive value, the rightmost gets a negative value, and single-end reads carry 0. In the example, a read starting at 1000 with a 37-base mate starting at 1200 yields a span of 237 bases. TLEN is a convenience field, and some aligners emit approximate values for spliced or chimeric reads. Recomputing the span from POS, CIGAR, and PNEXT is safer when the number matters.

### SEQ orientation

If FLAG bit 0x10 is set, the sequence stored in SEQ is the reverse complement of the original read, and QUAL is reversed to match. A common error is to extract SEQ from reverse-strand reads and treat it as the original read orientation. It is not. For anything involving k-mers, motifs, or fragment end analysis, the strand bit must be applied.

### Optional tags

Tags follow the 11 mandatory fields in `TAG:TYPE:VALUE` form. Widely used examples include `NM` (edit distance to the reference), `MD` (mismatch and deletion description), `AS` (alignment score), `RG` (read group), and `SA` (chimeric alignment records). Tags are optional by definition, which means a pipeline that depends on `NM` can fail on files from an aligner that does not emit it unless a tag-generating step such as `samtools calmd` is run first.

## FLAG: Twelve Bits That Describe the Read

The FLAG field is a single non-negative integer that packs twelve independent yes-or-no facts into one number. Each fact owns one bit.

| Bit | Hex | Decimal | Meaning |
|--|--|--|--|
| 0x1 | 0x1 | 1 | Template has multiple segments (paired) |
| 1 | 0x2 | 2 | Each segment properly aligned per the aligner |
| 2 | 0x4 | 4 | Segment is unmapped |
| 3 | 0x8 | 8 | Mate is unmapped |
| 4 | 0x10 | 16 | Segment is on the reverse strand |
| 5 | 0x20 | 32 | Mate is on the reverse strand |
| 6 | 0x40 | 64 | First segment in the template |
| 7 | 0x80 | 128 | Last segment in the template |
| 8 | 0x100 | 256 | Secondary alignment |
| 9 | 0x200 | 512 | Failed vendor or pipeline filters |
| 10 | 0x400 | 1024 | PCR or optical duplicate |
| 11 | 0x800 | 2048 | Supplementary alignment |

### Decoding an integer

Take FLAG 99. Subtract the largest bit that fits and repeat: 99 minus 64 leaves 35, minus 32 leaves 3, minus 2 leaves 1, minus 1 leaves 0. The set bits are 64, 32, 2, and 1, so the read is a paired, properly aligned first mate whose mate sits on the reverse strand. FLAG 147 decomposes to 128 plus 16 plus 2 plus 1, the second mate of the same pair, itself on the reverse strand. Together, 99 and 147 are the most common flag pair in a properly aligned Illumina library.

`samtools flags 99` prints the same decomposition, which is faster than manual arithmetic.

### Common flag values in real files

| FLAG | Interpretation |
|--|--|
| 0 | Single-end, forward strand, mapped |
| 4 | Unmapped |
| 16 | Mapped, reverse strand |
| 99 | Paired, proper pair, first mate, mate reverse |
| 147 | Paired, proper pair, second mate, read reverse |
| 83 | Paired, proper pair, first mate, read reverse |
| 163 | Paired, proper pair, second mate, mate reverse |
| 256 | Secondary alignment of a multi-mapping read |
| 2048 | Supplementary alignment of a split read |

### Filtering with samtools

`samtools view -f 0x2` keeps records that have the proper-pair bit set. `samtools view -F 0x904` removes unmapped, secondary, and supplementary records, leaving primary mapped alignments. The two flags behave differently by design: `-f INT` requires all bits in the mask to be present, while `-F INT` excludes any record with at least one bit in the mask set. Writing `-f 0x2 -f 0x40` twice does not mean "or." Combine bits into a single mask, or use the newer `-rf` and `-ff` options for require-any and filter-any semantics.

A practical default filter for variant-oriented work is `samtools view -F 0x904 -q 30`, which drops unmapped, secondary, and supplementary records and enforces a minimum MAPQ of 30. The right MAPQ threshold depends on the aligner and the question, and no single number is universally correct.

## CIGAR Strings: The Alignment Alphabet

CIGAR is the compact grammar that describes how the read relates to the reference, one operation at a time, read from left to right.

| Op | Consumes query | Consumes reference | Meaning |
|--|--|--|--|
| M | Yes | Yes | Alignment match (may be a match or a mismatch) |
| I | Yes | No | Insertion relative to the reference |
| D | Yes | Yes | Deletion from the reference |
| N | No | Yes | Skipped reference region, such as an intron |
| S | Yes | No | Soft clip, bases present in SEQ but not aligned |
| H | No | No | Hard clip, bases absent from SEQ |
| P | No | No | Padding, a silent placeholder |
| = | Yes | Yes | Sequence match |
| X | Yes | Yes | Sequence mismatch |

### Walking the worked example

For `10M2I5M1D20M`:

1. `10M` aligns 10 query bases to 10 reference bases starting at POS.
2. `2I` places 2 query bases between aligned blocks. They have no reference counterpart.
3. `5M` aligns 5 more query bases to 5 reference bases.
4. `1D` skips 1 reference base with no query base opposite it, which is a deletion in the read relative to the reference.
5. `20M` aligns the final 20 query bases.

The query consumption is 10 plus 2 plus 5 plus 20, which is 37, matching the length of SEQ. The reference span is 10 plus 5 plus 1 plus 20, which is 36, so the alignment covers bases 1000 through 1035. Query and reference lengths are computed independently and are almost never equal when indels are present.

### Soft clips versus hard clips

A soft clip keeps the base in SEQ but leaves it unaligned. It is the aligner's way of saying "this part of the read did not match well enough to place." Soft clips consume query but not reference, so they shift the read sequence without shifting the alignment.

A hard clip removes the base from SEQ entirely and records only the count. Hard clips appear mainly in supplementary records, where storing the full sequence again would duplicate data. A read with `5H10M` in a supplementary record has a SEQ of exactly 10 bases.

The distinction has downstream consequences. A fragment-size calculation that uses only aligned positions will underestimate the true fragment length whenever soft clips are present. The fRagmentomics package implements an indel-aware and optionally soft-clip-preserving fragment size computation specifically because conventional size estimates based solely on aligned positions are less accurate [5]. That is a concrete example of CIGAR literacy changing a biological measurement.

### Spliced reads and the N operator

In RNA-seq, reads often span exon junctions. Aligners place them with `N`, which consumes reference but not query. A read with `50M10000N50M` covers 100 aligned bases split across a 10-kilobase intron. Tools that count "aligned length" from CIGAR must exclude N, or every spliced read will appear far longer than the sequencer produced.

### Why M is ambiguous

`M` means alignment match, which includes both identical bases and mismatches. The original SAM design chose this for compactness. The `=` and `X` operators were added later to make matches and mismatches explicit. In practice, most aligners emit `M` and record mismatches in the `NM` and `MD` tags instead. A parser that counts mismatches by scanning CIGAR for `X` will return zero on such files.

### CIGAR and supplementary alignments

A read that maps in two distant pieces, common for structural variants, produce one primary record plus one or more records flagged 0x800. The `SA` tag cross-references them. Filters that remove supplementary alignments simplify counting but can discard exactly the evidence a split-read [structural variant](/blog/guides/structural-variant) caller needs. Clinical guidance recommends using multiple tools for structural variant calling and in-house datasets for filtering recurrent calls, which in practice means keeping supplementary records available long enough for those callers to run [6].

## How SAM Records Are Inspected and Validated in Practice

Alignment files are examined with Samtools, the reference implementation for SAM, BAM, and CRAM handling that appears in standard RNA-seq protocols alongside BWA and HISAT2 [1]. The commands below assume `sample.sam` or `sample.bam` in the working directory.

### Convert and index

```
samtools view -b sample.sam > sample.bam
samtools sort -o sample.sorted.bam sample.bam
samtools index sample.sorted.bam
```

The `-b` flag requests BAM output. Older tutorials use `-bS`, where `S` meant "input is SAM." Modern Samtools auto-detects input, so `-S` is redundant and is best dropped from scripts.

`sort` defaults to coordinate order. `index` writes a `.bai` file next to the BAM, and it fails on a BAM that is not coordinate sorted. Queryname sorting (`samtools sort -n`) is a different order used by tools that need mates adjacent.

### Health checks

```
samtools quickcheck sample.bam
samtools view -H sample.bam
samtools view -c sample.bam
samtools flagstat sample.bam
samtools idxstats sample.bam
```

`quickcheck` returns success only if the file has a valid header and a proper end-of-file marker, which catches truncated transfers before they corrupt a run. `flagstat` summarizes counts of total records, secondary and supplementary records, duplicates, mapped records, paired records, properly paired records, and singletons. `idxstats` reports mapped and unmapped counts per reference and exposes a missing index immediately.

### Inspecting individual records

```
samtools view sample.sorted.bam chr1:1000-2000
samtools view -f 0x4 sample.sorted.bam | head
samtools view -F 0x904 -q 30 -c sample.sorted.bam
samtools flags 99
```

The region query requires an index. The `-f 0x4` call lists unmapped reads, a useful first step when diagnosing a library that aligned poorly. The third command reports how many primary, mapped, reasonably confident records survive a standard filter.

### Validation and tag generation

Picard `ValidateSamFile` checks header consistency, sort order, mate consistency, and CIGAR validity against the declared reference lengths. `samtools calmd` recomputes `NM` and `MD` against a supplied FASTA reference, which is required before some variant callers will run on BAMs produced by aligners that omit those tags.

```
samtools faidx reference.fa
samtools calmd -b sample.sorted.bam reference.fa > sample.calmd.bam
```

The reference FASTA is not optional metadata. Allele-specific analyses, fragmentomics, and variant calling all need the exact reference sequence, and missing FASTA files are a documented barrier to reanalysis in other domains such as proteomics [7].

## SAM in the Wider Family of Bioinformatics File Formats

Bioinformatics file formats fall into rough layers: raw reads, alignments, variant calls, and analysis-ready matrices. SAM occupies the alignment layer. Knowing its neighbors makes the vocabulary less confusing.

### FASTQ versus FASTA

FASTQ stores raw reads with per-base quality scores in a four-line record: an `@` header, the sequence, a `+` separator, and a quality string of the same length as the sequence. FASTA stores sequences without quality in a two-part record: a `>` header and the sequence. FASTQ is what a sequencer writes. FASTA is what a reference genome, a transcriptome, or a peptide database looks like.

The distinction matters at the edges of new formats. DRAMP 5.0 introduced a FASTS format that embeds SMILES structural representations into FASTA annotation lines, which keeps an [amino acid sequence](/blog/guides/amino-acid-sequence) and its chemical structure in one text file [8]. That is an extension of FASTA, not FASTQ, because peptides carry no per-base quality scores. In proteomics, the analogous gap is a missing FASTA [protein sequence database](/blog/guides/protein-sequence-database), which makes identification irreproducible [7].

### BAM and CRAM

BAM is a binary encoding of the same fields and flags, compressed with BGZF, which is a blocked variant of gzip that supports random access. That block structure is why indexing works and why tools can jump to a region without decompressing the whole file. The Atlantool project builds a read-identifier index in the same BGZF format as BAM specifically to enable fast lookup by read name, a retrieval mode that coordinate-based tools such as Samtools do not provide [2].

CRAM stores alignments relative to a reference sequence, so it can be much smaller than BAM at the cost of requiring the correct reference at read time.

### Specialized formats built on or beside alignments

The alignment layer feeds many downstream formats. wgbstools converts methylation-aware BAM files into a custom epiread format that achieves a compression factor above 100-fold relative to the input BAM [9]. ModSeqR uses a CH3 format that reduces file sizes by more than 95 percent for long-read methylation data [10]. IGD provides a simple uncompressed binary genotype format reported to be more than 100 times faster and 3.5 times smaller than vcf.gz on biobank-scale whole-genome sequence data [11]. QCatch writes richly annotated H5AD files for single-cell quantification results [12]. Each of these formats solves a specific storage or access problem, and each of them starts from reads that were aligned and stored in SAM or BAM.

## Why Alignment Records Matter Beyond Mapping

A BAM file is not the end of a pipeline. It is the substrate for measurements that have clinical and biological weight.

In clinical genomics, a Nordic consortium of 13 clinical bioinformatics units recommended the hg38 genome build as the reference, standardized file formats, strict version control, and operation at standards similar to ISO 15189 [6]. Those recommendations only make sense if the alignment record is treated as a durable, versioned artifact. A POS value of 1000 on hg19 and a POS value of 1000 on hg38 point to different bases, so a BAM without a documented reference build is an unreliable clinical record.

In methylation analysis, fragment-level information from BAM enables single-molecule resolution that array-based methods cannot reach, and wgbstools exploits it at whole-genome scale [9]. In [liquid biopsy](/knowledge/molecular-biology/liquid-biopsy), cell-free DNA fragment features such as size, position, and end motifs are extracted directly from aligned BAM records, and the accuracy of the fragment size estimate depends on correct interpretation of indels and soft clips [5]. In RNA-seq, alignment records are converted, counted, normalized, and visualized on the way to differential expression [1].

None of these analyses read FLAG, CIGAR, and MAPQ by accident. Each one depends on a correct interpretation of those fields.

## Common Mistakes and Limitations

**Reading POS as 0-based.** SAM is 1-based. BED is 0-based half-open. Mixing them shifts every interval by one base and produces silent, systematic errors.

**Treating MAPQ 255 as a high score.** It means unavailable. Filtering on `MAPQ >= 30` keeps those reads, which may or may not be what you want.

**Assuming M means match.** M means alignment match and includes mismatches. Count mismatches from `NM` or `MD`, not from scanning for `X`.

**Forgetting strand orientation.** For reverse-strand reads, SEQ is the reverse complement and QUAL is reversed. Motif and k-mer analyses that ignore this produce strand-biased artifacts.

**Confusing soft clips with hard clips.** Soft clips are in SEQ. Hard clips are not. Fragment-length code that treats them identically will be wrong for a subset of reads.

**Filtering out supplementary alignments too early.** Split reads carry structural variant evidence. Removing 0x800 records before variant calling discards it.

**Assuming a headerless SAM will load.** Most parsers need `@SQ` lines to validate RNAME and reference lengths. Streaming alignments without a header is a frequent failure mode in custom scripts.

**Assuming BAM files are small.** Text SAM is larger still, and BAM files from whole-genome sequencing routinely run to tens of gigabytes. Plan storage and transfer accordingly.

**Forgetting the reference build.** A BAM does not encode hg19 versus hg38 beyond the `@SQ` names and lengths. Clinical-grade practice requires explicit reference documentation and version control [6].

**Expecting SAM to answer every question.** SAM does not store raw signal, per-read clustering metrics, or unaligned base-level kinetic information. Nanopore signal belongs in POD5 or SLOW5 [3], single-cell count matrices belong in H5AD [12], and genotype matrices may belong in a compact binary format [11]. Choosing the wrong container for a question creates work that no amount of flag parsing will fix.

## Quick Review

- SAM is tab-delimited text with 11 mandatory fields. BAM is its binary, BGZF-compressed sibling.
- POS is 1-based. MAPQ is Phred-scaled, and 255 means unavailable.
- FLAG is a 12-bit integer. 99 and 147 are the standard first and second mates of a proper pair.
- CIGAR operators consume query, reference, both, or neither. M is alignment match, not identity.
- Soft-clipped bases stay in SEQ. Hard-clipped bases do not.
- N consumes reference and marks spliced alignments in RNA-seq.
- Reverse-strand reads store the reverse complement in SEQ and reversed QUAL.
- Coordinate-sorted, indexed BAM is the default working format. SAM is for inspection.

## Frequently Asked Questions

### What does SAM stand for in bioinformatics?

SAM stands for Sequence Alignment/Map. It is a plain-text, tab-delimited format in which each line records one read, its alignment coordinates, its FLAG, its CIGAR string, its sequence, and its base qualities.

### What is the difference between SAM and BAM?

BAM is the binary, BGZF-compressed form of SAM. Both carry the same fields, flags, and CIGAR strings, but BAM is smaller and supports indexed random access, which is why production pipelines store alignments as BAM or CRAM rather than SAM.

### What does FLAG 4 mean in a SAM file?

FLAG 4 marks the read as unmapped. The bit 0x4 is set when the aligner could not place the segment on the reference, so RNAME, POS, and CIGAR are typically uninformative or set to their placeholder values.

### Why is MAPQ 255 special?

MAPQ 255 is a reserved value meaning the mapping quality is unavailable. It is not a score of 255 on the Phred scale, and reads with MAPQ 255 should be handled by an explicit policy rather than assumed to be high quality.

### What is the difference between soft clip and hard clip in a CIGAR string?

Soft-clipped bases remain in the SEQ field but are not aligned to the reference. Hard-clipped bases are removed from SEQ entirely and appear only as a count in the CIGAR, which is why supplementary records can carry a short SEQ with a leading hard clip.

### Can I open a SAM file in a text editor?

Yes, SAM is plain text and opens in any editor. The practical problem is size. A whole-genome SAM can be many gigabytes, so inspect it with `samtools view` on a BAM and reserve direct text inspection for headers and small slices.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What does SAM stand for in bioinformatics?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "SAM stands for Sequence Alignment/Map. It is a plain-text, tab-delimited format in which each line records one read, its alignment coordinates, its FLAG, its CIGAR string, its sequence, and its base qualities."
      }
    },
    {
      "@type": "Question",
      "name": "What is the difference between SAM and BAM?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "BAM is the binary, BGZF-compressed form of SAM. Both carry the same fields, flags, and CIGAR strings, but BAM is smaller and supports indexed random access, which is why production pipelines store alignments as BAM or CRAM rather than SAM."
      }
    },
    {
      "@type": "Question",
      "name": "What does FLAG 4 mean in a SAM file?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "FLAG 4 marks the read as unmapped. The bit 0x4 is set when the aligner could not place the segment on the reference, so RNAME, POS, and CIGAR are typically uninformative or set to their placeholder values."
      }
    },
    {
      "@type": "Question",
      "name": "Why is MAPQ 255 special?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "MAPQ 255 is a reserved value meaning the mapping quality is unavailable. It is not a score of 255 on the Phred scale, and reads with MAPQ 255 should be handled by an explicit policy rather than assumed to be high quality."
      }
    },
    {
      "@type": "Question",
      "name": "What is the difference between soft clip and hard clip in a CIGAR string?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Soft-clipped bases remain in the SEQ field but are not aligned to the reference. Hard-clipped bases are removed from SEQ entirely and appear only as a count in the CIGAR, which is why supplementary records can carry a short SEQ with a leading hard clip."
      }
    },
    {
      "@type": "Question",
      "name": "Can I open a SAM file in a text editor?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes, SAM is plain text and opens in any editor. The practical problem is size. A whole-genome SAM can be many gigabytes, so inspect it with samtools view on a BAM and reserve direct text inspection for headers and small slices."
      }
    }
  ]
}
</script>

## Sources

1. [Streamline Protocol for Bulk-RNA Sequencing: From Data Extraction to Expression Analysis.](https://pubmed.ncbi.nlm.nih.gov/41637157/)
2. [Atlantool: a command line tool to retrieve DNA and RNA sequencing reads from BAM files by the read identifier.](https://pubmed.ncbi.nlm.nih.gov/41230488/)
3. [The enduring advantages of the SLOW5 file format for raw nanopore sequencing data.](https://pubmed.ncbi.nlm.nih.gov/41100284/)
4. [Structure-preserving multivariate hypothesis testing for mass spectrometry imaging and single-cell data.](https://pubmed.ncbi.nlm.nih.gov/41863333/)
5. [fRagmentomics: an R package for integrating cell-free DNA fragment features with mutational status to support liquid biopsy interpretation.](https://pubmed.ncbi.nlm.nih.gov/41886314/)
6. [Recommendations for bioinformatics in clinical practice.](https://pubmed.ncbi.nlm.nih.gov/41107899/)
7. [Preventing Proteomics Data Tombs Through Collective Responsibility and Community Engagement.](https://pubmed.ncbi.nlm.nih.gov/41571719/)
8. [DRAMP 5.0: an update integrating sequence and structure in a novel FASTS format for AI-driven design of antimicrobial peptides.](https://pubmed.ncbi.nlm.nih.gov/42876369/)
9. [wgbstools: a computational suite for DNA methylation sequencing data analysis.](https://pubmed.ncbi.nlm.nih.gov/41611450/)
10. [ModSeqR: an R package for efficient analysis of modified nucleotide data.](https://pubmed.ncbi.nlm.nih.gov/41724754/)
11. [IGD: a simple, efficient genotype data format.](https://pubmed.ncbi.nlm.nih.gov/40980555/)
12. [QCatch: a framework for quality control assessment and analysis of single-cell sequencing data.](https://pubmed.ncbi.nlm.nih.gov/41987571/)