官網(wǎng):https://github.com/lh3/minimap2
幫助:https://lh3.github.io/minimap2/minimap2.html
1忠藤、使用建議
對(duì)于短reads 比對(duì) 建議使用bwa 暂吉;由于設(shè)計(jì)算法問(wèn)題眶拉,默認(rèn)設(shè)置上對(duì)gap 容忍更高,bwa相對(duì)minimap 比對(duì) short reads 準(zhǔn)確性更高葵腹;
對(duì)于基因組之間的比較建議用minimap;長(zhǎng)reads 中有較多錯(cuò)誤,minimap中可以更好的比對(duì)坚嗜;但是針對(duì)ont,pacbio 最好使用預(yù)設(shè)的參數(shù)集選項(xiàng);
沒(méi)有笨蛋诗充,只有放錯(cuò)地方的天才惶傻;沒(méi)有不好的軟件,只有不會(huì)用軟件的人
2其障、有用的參數(shù)
--secondary=yes|no
Whether to output secondary alignments [yes]
#是否輸出第二比對(duì)結(jié)果银室,默認(rèn)yes
#用于確定最好比對(duì),不考慮低分的結(jié)果
#對(duì)于[基因組比對(duì)],第二比對(duì)蜈敢,一般比對(duì)打分都很低辜荠,而且是片段上一小部分 比對(duì)到了其他地方
-c Generate CIGAR. In PAF, the CIGAR is written to the ‘cg’ custom tag.
--cs[=STR]
Output the cs tag. STR can be either short or long. If no STR is given, short is assumed. [none]
#輸出 cs tag [cs 標(biāo)簽]
#如果給了 -c 參數(shù),默認(rèn)輸出短形式的cs tag抓狭,這種大多數(shù)啊軟件都支持識(shí)別伯病;但是 long cs tag 很多軟件不識(shí)別,一般long cs tag使用與三代reads 的比對(duì)否过;不夠由于識(shí)別軟件還不多午笛,這里默認(rèn)是不會(huì)輸出 cs tags的
都用于call 變異,建議加上下列參數(shù)
-a 生成sam 格式苗桂,有CIGAR
--MD 輸出 MD tag药磺,與sam 保持格式一致;Sniffles 需要 有-a --MD 參數(shù)的minimap2比對(duì)
-L CIGAR with >65535 operators at the CG tag煤伟;保證舊軟件兼容癌佩,因?yàn)榫蛙浖粫?huì)去多CG tag 區(qū)域
3、默認(rèn)輸出paf 文件便锨;格式了解下围辙;分析馬上安排上
Col Type Description
1 string Query sequence name
2 int Query sequence length
3 int Query start coordinate (0-based)
4 int Query end coordinate (0-based)
5 char ‘+’ if query/target on the same strand; ‘-’ if opposite
6 string Target sequence name
7 int Target sequence length
8 int Target start coordinate on the original strand
9 int Target end coordinate on the original strand
10 int Number of matching bases in the mapping
11 int Number bases, including gaps, in the mapping
12 int Mapping quality (0-255 with 255 for missing)
格式上開(kāi)始12列相對(duì)好理解
【比對(duì)序列,長(zhǎng)度放案,比對(duì)坐標(biāo)[stat ,end ]】姚建,方向是否一致,【目標(biāo)序列吱殉,長(zhǎng)度桥胞,比對(duì)坐標(biāo)[stat ,end ]】,準(zhǔn)確堿基數(shù)量考婴,粗略比對(duì)上的堿基數(shù)量贩虾,比對(duì)質(zhì)量[0-255]
12列以后 會(huì)有幾列有趣的詳細(xì)信息
Tag Type Description
tp A Type of aln: P/primary, S/secondary and I,i/inversion
cm i Number of minimizers on the chain
s1 i Chaining score
s2 i Chaining score of the best secondary chain
NM i Total number of mismatches and gaps in the alignment
MD Z To generate the ref sequence in the alignment
AS i DP alignment score
ms i DP score of the max scoring segment in the alignment
nn i Number of ambiguous bases in the alignment
ts A Transcript strand (splice mode only)
cg Z CIGAR string (only in PAF)
cs Z Difference string
dv f Approximate per-base sequence divergence
de f Gap-compressed per-base sequence divergence
rl i Length of query regions harboring repetitive seeds
一個(gè)例子慢慢看
tp:A:P cm:i:38442 s1:i:398614 s2:i:1347 dv:f:0.0039 rl:i:4767142
# tp
#當(dāng)前行,是否是第一還是第二比對(duì)沥阱,
#P/primary, S/secondary and I,i/inversion
#inversion倒置的還沒(méi)見(jiàn)過(guò)
tp:A:P
tp:A:S
tp:A:i
cg:Z:83M1D232M7I1M6D552M1D6M1I550M1D2M1D140M
“M”表示 match或 mismatch缎罢;
“I”表示 insert;
“D”表示 deletion考杉;
“N”表示 skipped(跳過(guò)這段區(qū)域)策精;
“S”表示 soft clipping(被剪切的序列存在于序列中);
“H”表示 hard clipping(被剪切的序列不存在于序列中)崇棠;
“P”表示 padding咽袜;
# 使用--eqx 參數(shù)后“M” 被“=”與“X” 替代,修改版的pbmm2 固定使用--eqx
“=”表示 match枕稀;
“X”表示 mismatch(錯(cuò)配询刹,位置是一一對(duì)應(yīng)的谜嫉,但是堿基不同);
#The hard clipping operation H indicates that the clipped sequence is not present in the sequence field.
以下參考自:[https://www.cnblogs.com/leezx/p/6105646.html](https://www.cnblogs.com/leezx/p/6105646.html)
clipped alignment因?yàn)橹诒葘?duì)過(guò)程中凹联,并沒(méi)有用到全部的read的序列沐兰,read兩段的序列被截取了(clip or trim)。如下表示蔽挠,即為clip alignment住闯。
Alignment:
Read: ACGGTTGCGTTAA-TCCGCCACG
| ||||||||| ||||||
Reference: TAACTTGCGTTAAATCCGCCTGG
與clipped alignment對(duì)應(yīng)的是spliced alignment,即read的中間沒(méi)有比對(duì)到而兩段比對(duì)上了澳淑。對(duì)應(yīng)的表示如下:
Alignment:
Read: ACGGTTGCGTTAAGCTCATCCGCCACG
| ||||||||||||| |||||||||
Reference: ACGGTTGCGTTAA…..TCCGCCACG
clip alignment對(duì)應(yīng)的CIGAR表示有兩種S (soft clip) 和H (hard clip)
注意cigar 在不同軟件中的兼容性比原;可用軟件jvarkit下biostar234081 轉(zhuǎn)換
Chaining score 鏈打分,reads拆分為 minizimers杠巡,多個(gè)連續(xù)比對(duì)的minizmier稱(chēng)為anchors, colinear anchors 作為 chains量窘,之后根據(jù)chains 作為分析比較打分的對(duì)象;對(duì)照ngmlr ,Reads 根據(jù)比對(duì)中大的indel拆分為 subsegment ,colinear subsegment alignments 作為long segments 忽孽,以long segments作為比對(duì)打分的對(duì)象绑改。
如 三代reads 比對(duì)谢床,總會(huì)有有一些indel 導(dǎo)致reads 不能很好比對(duì)而分為多個(gè)部分比對(duì)到參考基因組兄一;而這多個(gè)部分構(gòu)成的打分則是Chaining score
cigar 值 中就可以看到頻繁的在M之間插入了其它比對(duì)狀態(tài)
cs 標(biāo)簽 和sam 格式中的類(lèi)似,比較正要识腿,sam 格式輸出中 short 短形式可被舊軟件識(shí)別出革, long cs tag 長(zhǎng)標(biāo)簽 很多軟件還不能完全支持
The cs tag encodes difference sequences in the short form or the entire query AND reference sequences in the long form. It consists of a series of operations:
Op Regex Description
= [ACGTN]+ Identical sequence (long form)
: [0-9]+ Identical sequence length
* [acgtn][acgtn] Substitution: ref to query
+ [acgtn]+ Insertion to the reference
- [acgtn]+ Deletion from the reference
~ [acgtn]{2}[0-9]+[acgtn]{2} Intron length and splice signal
上個(gè)例子
cs:Z::48*ag:2*ag:21*tc*tc:8-t:2*ag:5*tc:2*ag:4*ct*ac*ct:2*tc*ct:2*ag:4*ag:17*ga:2*ag*tc:9*ag:5*tc:23*ag:11*ta:1*ag*ct:21*tc:10*tc:21*tc:30*ag:7*ct:6*ag*ga*ct:7*ag:13+ttctttt:1-cacccc:19*ct:1*ct:12*ag:6*ct*ca:2*tc:1*ga:1*ct:8*ga:19*ct:24*ag:42*ct:1*ct:134*tc:47*tc:2*ag:13*tc:1*ct:4*ga:30*ag*ga:28*ct*ct:20*tc:7*tc:1*ag:89*ct:9*ct:3-a:1*ag:4+t:1*tc*tc:13*tc:6*tc:12*ag:19*tc:14*ag:16*tg:21*ag*ag:7*tc:1*ag:11*ct:1*tc:3*tc:2*ag:2*gc:11*ac:16*ca*tc:5*tc:8*ga*ac:5*tc:2*ga:10*tc:7*tc:21*ga*ac:2*ct:1*tc:11*tc:1*tc:7*ct:17*ta*tc:1*tc:9*tc:2*tc:19*ag:6*ct:22*tc:23*tc:27*tc:1*at*ga:52*ag:49*tc:25*ga:1*ct*ct:9-t:2-a:8*tc:10*ct:2*tc:5*ct:18*ga:19*ga*ta:1*ga:13*tc*ta*tc:12*ag:4*tc:11*ct:23
參考:
# Difference between Hard Clip(H) and Soft Clip(S) in Samtools CIGAR string
https://lh3.github.io/minimap2/minimap2.html
sam/bam格式:源于別人的最全的