将reads比对到参考基因组上,我们称之为mapping。mapping的工具很多,为了方便下游分析,对于mapping产生的文件,业界有一个统一的标准,这个标准就是SAM。
SAM全称Sequence Alignment/MAP format, 从命名上可以看到,这种文件就是用来存储序列比对信息的。SAM文件是一种纯文本文件,分为两个部分,头部head section和正文的比对部分alignment section。
本文首先介绍下头部信息,头部信息不是必须的,可以没有。
头部信息以@开头,通常是一些注释信息。SAM文件标准事先定义了以下几种类型的信息,对于每种信息,又细分为不同的tag, 其中有部分tag是必须的,其他是可选的,每个tag会有对应的value, 采用tag:value的写法。
1.HD
HD代表head line,是头部信息的第一行,这部分信息包含VN, SO, GO3种tag,VN代表版本号,SO代表排序的标准,unsorted表示没有排序,queryname表示按照输入序列的名称进行排序,coordinate表示按照比对位置进行排序,按照比对位置排序时,首先按照染色体排序,然后才是染色体上的比对位置。染色体的排序和SQ标签指定的染色体顺序一致。
在HD中,VN信息是必须有的。
2.SQ
SQ代表sequence, 表示参考基因组的序列信息,包含SN, LN, AH, AN, AS, M5, SP, UR这几种tag, 每条序列都会有对应的一行信息。
SN代表序列名称,LN代表序列的长度,AS代表基因组的组装版本信息,M5