Skip to content
Novus Examples
sam1.2 KB

SAM Alignments — Header, Flags and CIGAR Operations (.sam)

Six alignments against a synthetic contig with a full @HD/@SQ/@RG/@PG header, both strands via the reverse flag, and CIGAR strings covering match, soft clip, insertion and deletion. Reference span and query length come apart in three of the records, which is where CIGAR arithmetic gets tested.

Preview — first 11 linessam
@HD	VN:1.6	SO:coordinate
@SQ	SN:NXCTG01	LN:600
@RG	ID:NX-RG-1	SM:SYNTHETIC-SAMPLE	PL:SYNTHETIC
@PG	ID:novus-examples	PN:novus-examples	VN:1.0
NX_READ_001	0	NXCTG01	101	60	60M	*	0	0	GGCGCGCACGTGGGGGCCCCCAAAAAGCTCTAATGGACTGAATATTGGGGCGTTCTGATA	FGHFHEGEFDGDFGHDHEEECCFGCFFBDCFBEFDBDCEAAACCEBB@CAB@ACAC@@BB	RG:Z:NX-RG-1	NM:i:1
NX_READ_002	0	NXCTG01	141	60	10S50M	*	0	0	AACTATCTTAGATAAGAGTAGACGAGAGCAACCAGACTACTTGTTGTGGGCTGCGAGGAC	GHFHHEGFFDFHDEEGGFFFEDDDFDFFEFEDBFDCEDEEDCACDADABBBBDBA?@CC@	RG:Z:NX-RG-1	NM:i:2
NX_READ_003	0	NXCTG01	181	60	30M2D30M	*	0	0	AGCGACAGATATAGCTTACCGCCGCGGCTATAAGCAAAGTGTGTCAACGAACGGCTTTCT	IFFFIHEIGHEDGGHDGHEDDGFGGCFBCBDCDEDDBCCCEEEBEBCBCDABBDCAABBC	RG:Z:NX-RG-1	NM:i:0
NX_READ_004	16	NXCTG01	221	60	25M3I32M	*	0	0	CAAGAGCATGGGCCCAATCCGTTGATTACTGAGCTTCATCGGATCCATTAACCGTCGGGT	HEFEEEIHIFFGHEGDEHCFCGGGEGDDFEEFCCEBEADBDCCEC@BCBBDDAD??AB??	RG:Z:NX-RG-1	NM:i:1
NX_READ_005	0	NXCTG01	261	60	20M5I35M	*	0	0	ACGGCAAGCCGAAAAGATATTATTGATTGATCTTACATTCGATCGGTTCGCAGACCCGAG	IFHIFGEHHEGEGFGFGFGDEGGCDCFFCDEFFEEEDCBCDCEADAACB@@CDBBC@@CC	RG:Z:NX-RG-1	NM:i:2
NX_READ_006	16	NXCTG01	301	60	60M	*	0	0	ACCCGCAGTTTGGAGTGCCTAGCGACTAATGTGACACTGTGGTATCGCTCCTTCTTAGGA	GGIFIHEIEEHEFGFHGFCCFGEFGDGECCECDBBBCADDDBABBDAA@DDABACB@A@A	RG:Z:NX-RG-1	NM:i:0

Specifications

Version
SAM 1.6
Header Lines
4
Alignments
6
Cigar Operations
M, S, I, D
Reverse Strand Records
2
Reference Name
NXCTG01
Reference Length
600
Mandatory Columns
11
Optional Tags
RG:Z, NM:i

Testing contract

Expected to pass
Scenario
Parse the header and all eleven mandatory columns, then compute each alignment's reference end from its CIGAR.
Expected result
Six records parse with two carrying flag 16 for the reverse strand, and the 30M2D30M record spans 62 reference bases while its SEQ is 60 bases long.

What is a .sam file?

SAM (Sequence Alignment/Map) is the plain-text format for sequence alignments and the human-readable counterpart of binary BAM. An optional header of `@`-prefixed lines declares the sort order and reference sequences, and each alignment line has eleven mandatory tab-separated fields — including a bitwise FLAG, a 1-based position, a CIGAR string describing the match, and the sequence and its qualities — followed by optional typed TAG:TYPE:VALUE fields.

How to use this file

Use an example .sam file to test alignment parsers and format converters, exercising FLAG bit decoding, CIGAR operations that consume the reference but not the read, and the difference between unmapped records and records on an absent reference.

How to use this file for testing

“SAM Alignments — Header, Flags and CIGAR Operations (.sam)” is a deterministic Novus Examples fixture for Scientific data, Editor testing. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.

Documented properties for this file: SAM · 1,248 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.

Generated by generation/scientific.py. Free for any use, no attribution required — license.