轉(zhuǎn)錄組入門(5):序列比對(duì)

比對(duì)軟件很多,首先大家去收集一下,因?yàn)槲覀兪菐Т蠹胰腴T滔驶,請(qǐng)統(tǒng)一用hisat2,并且搞懂它的用法卿闹。
直接去hisat2的主頁下載index文件即可揭糕,然后把fastq格式的reads比對(duì)上去得到sam文件。
接著用samtools把它轉(zhuǎn)為bam文件锻霎,并且排序(注意N和P兩種排序區(qū)別)索引好著角,載入IGV,再截圖幾個(gè)基因看看旋恼!
順便對(duì)bam文件進(jìn)行簡單QC吏口,參考直播我的基因組系列。

HISAT2安裝:

linux版Hisat2下載冰更,解壓产徊,可以使用了:
$ wget ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/downloads/hisat2-2.1.0-Linux_x86_64.zip
解壓(-d 解壓到指定文件):
$ unzip -d /work/LXJ/software/ hisat2-2.1.0-Linux_x86_64.zip
檢查是否可以運(yùn)行:
$ ./hisat2
(ERR): hisat2-align exited with value 1:可以忽略

環(huán)境路徑設(shè)置:
$ sudo vi /etc/environment
添加:/work/LXJ/software/hisat2-2.1.0
$ source /etc/environment

HISAT2使用

基因組索引

自行建立基因組索引:
Command Line : hisat2-build [options]* <reference_in> <ht2_base>
Usage : hisat2-build –p 8 genome.fa genome
如果想分析關(guān)于snp、exon蜀细、剪切位點(diǎn)新的信息,HISAT2建立基因組索引時(shí)舟铜,需要加入注釋過的snp、exon奠衔、剪切位點(diǎn)后谆刨,再信息建立基因組索引;(hisat2包中有程序幫你解決)
下載基因組索引:
從HISAT2的官網(wǎng)中下載現(xiàn)成的基因組索引归斤,這樣子比較省事痊夭,也可以防止出錯(cuò):

這是老鼠的基因組索引,根據(jù)需要下載合適的版本:
$ wget ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/data/mm10.tar.gz tar zxvf mm10.tar.gz

HISAT2比對(duì)RNA-Seq到基因組:
hisat2 [options]* -x <hisat2-idx> {-1 <m1> -2 <m2> | -U <r> | --sra-acc <SRA accession number>} [-S <hit>]
<ht2-idx> Index filename prefix (minus trailing .X.ht2).
<m1> Files with #1 mates, paired with files in <m2>.
Could be gzip'ed (extension: .gz) or bzip2'ed (extension: .bz2).
<m2> Files with #2 mates, paired with files in <m1>.
Could be gzip'ed (extension: .gz) or bzip2'ed (extension: .bz2).
<r> Files with unpaired reads.
Could be gzip'ed (extension: .gz) or bzip2'ed (extension: .bz2).
<SRA accession number> Comma-separated list of SRA accession numbers, e.g. --sra-acc SRR353653,SRR353654.
<sam> File for SAM output (default: stdout)

<m1>, <m2>, <r> can be comma-separated lists (no whitespace) and can be
specified many times. E.g. '-U file1.fq,file2.fq -U file3.fq'.

HISAT2比對(duì):

for i in {59..62};
do
echo $i
hisat2 -t -p 8 -x /work/LXJ/Genome/M.musculus/mm10.hisat2.index/genome -1 SRR35899${i}.sra_1.fastq.gz -2 SRR35899${i}.sra_2.fastq.gz -S /mnt/hgfs/Labubuntu_data/GSE81916.RNAseq/hisat2.mm10/SRR35899${i}.sam;
done

59
Time loading forward index: 00:00:25
Time loading reference: 00:00:04
Multiseed full-index search: 00:15:41
30468155 reads; of these:
  30468155 (100.00%) were paired; of these:
    2722598 (8.94%) aligned concordantly 0 times
    24300848 (79.76%) aligned concordantly exactly 1 time
    3444709 (11.31%) aligned concordantly >1 times
    ----
    2722598 pairs aligned concordantly 0 times; of these:
      156872 (5.76%) aligned discordantly 1 time
    ----
    2565726 pairs aligned 0 times concordantly or discordantly; of these:
      5131452 mates make up the pairs; of these:
        3276583 (63.85%) aligned 0 times
        1334447 (26.01%) aligned exactly 1 time
        520422 (10.14%) aligned >1 times
94.62% overall alignment rate
Time searching: 00:15:45
Overall time: 00:16:11
60
Time loading forward index: 00:00:29
Time loading reference: 00:00:04
Multiseed full-index search: 00:29:01
52972617 reads; of these:
  52972617 (100.00%) were paired; of these:
    4438954 (8.38%) aligned concordantly 0 times
    42836426 (80.87%) aligned concordantly exactly 1 time
    5697237 (10.76%) aligned concordantly >1 times
    ----
    4438954 pairs aligned concordantly 0 times; of these:
      268939 (6.06%) aligned discordantly 1 time
    ----
    4170015 pairs aligned 0 times concordantly or discordantly; of these:
      8340030 mates make up the pairs; of these:
        5335211 (63.97%) aligned 0 times
        2173091 (26.06%) aligned exactly 1 time
        831728 (9.97%) aligned >1 times
94.96% overall alignment rate
Time searching: 00:29:05
Overall time: 00:29:34
61
Time loading forward index: 00:00:31
Time loading reference: 00:00:05
Multiseed full-index search: 00:21:39
36763726 reads; of these:
  36763726 (100.00%) were paired; of these:
    3102153 (8.44%) aligned concordantly 0 times
    29382458 (79.92%) aligned concordantly exactly 1 time
    4279115 (11.64%) aligned concordantly >1 times
    ----
    3102153 pairs aligned concordantly 0 times; of these:
      173349 (5.59%) aligned discordantly 1 time
    ----
    2928804 pairs aligned 0 times concordantly or discordantly; of these:
      5857608 mates make up the pairs; of these:
        3596954 (61.41%) aligned 0 times
        1595531 (27.24%) aligned exactly 1 time
        665123 (11.35%) aligned >1 times
95.11% overall alignment rate
Time searching: 00:21:44
Overall time: 00:22:15
62
Time loading forward index: 00:00:28
Time loading reference: 00:00:05
Multiseed full-index search: 00:22:33
43802631 reads; of these:
  43802631 (100.00%) were paired; of these:
    3816434 (8.71%) aligned concordantly 0 times
    35462440 (80.96%) aligned concordantly exactly 1 time
    4523757 (10.33%) aligned concordantly >1 times
    ----
    3816434 pairs aligned concordantly 0 times; of these:
      209180 (5.48%) aligned discordantly 1 time
    ----
    3607254 pairs aligned 0 times concordantly or discordantly; of these:
      7214508 mates make up the pairs; of these:
        4769954 (66.12%) aligned 0 times
        1806461 (25.04%) aligned exactly 1 time
        638093 (8.84%) aligned >1 times
94.56% overall alignment rate
Time searching: 00:22:38
Overall time: 00:23:06

Samtools

samtools view:

Sam文件轉(zhuǎn)換為bam文件:

for i in {59..62};
do
echo $i
samtools view -S SRR35899${i}.sam -b > SRR35899${i}.bam;
done

samtools sort:

sort對(duì)bam文件排序官册,而不是sam文件生兆;對(duì)比對(duì)結(jié)果按reads名稱排序(默認(rèn)根據(jù)染色體上對(duì)應(yīng)位置排序);此處依據(jù)reads名字排序是為了滿足后面HTseq的計(jì)算,如果此處使用默認(rèn)的chr position會(huì)增大HTseq生成count文件時(shí)的工作量。

for i in {59..62};
do
echo $i
samtools sort -n SRR35899${i}.bam -@ 8 SRR35899${i}_n.sorted;
done

默認(rèn)按照染色體位置進(jìn)行排序鸦难,而-n參數(shù)則是根據(jù)read名進(jìn)行排序; -t根吁,首先根據(jù)tag TAG排序,然后根據(jù)染色體位置或reads名字排序合蔽。

IGV查看

比對(duì)結(jié)果質(zhì)控:
常用工具有
Picard https://broadinstitute.github.io/picard/
RSeQC http://rseqc.sourceforge.net/
Qualimap http://qualimap.bioinfo.cipf.es/
此處使用RseQC击敌,RseQC下屬各式各樣的工具,并且RseQC官網(wǎng)中有測試數(shù)據(jù)和運(yùn)行實(shí)例
RseQC
安裝:pip install RseQC
可使用程序:

參考:
轉(zhuǎn)錄組入門(5): 序列比對(duì)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末拴事,一起剝皮案震驚了整個(gè)濱河市沃斤,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌刃宵,老刑警劉巖衡瓶,帶你破解...
    沈念sama閱讀 216,324評(píng)論 6 498
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異牲证,居然都是意外死亡哮针,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,356評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門坦袍,熙熙樓的掌柜王于貴愁眉苦臉地迎上來十厢,“玉大人,你說我怎么就攤上這事捂齐÷牛” “怎么了?”我有些...
    開封第一講書人閱讀 162,328評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵奠宜,是天一觀的道長包颁。 經(jīng)常有香客問我,道長压真,這世上最難降的妖魔是什么徘六? 我笑而不...
    開封第一講書人閱讀 58,147評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮榴都,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘漠其。我一直安慰自己嘴高,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,160評(píng)論 6 388
  • 文/花漫 我一把揭開白布和屎。 她就那樣靜靜地躺著拴驮,像睡著了一般。 火紅的嫁衣襯著肌膚如雪柴信。 梳的紋絲不亂的頭發(fā)上套啤,一...
    開封第一講書人閱讀 51,115評(píng)論 1 296
  • 那天,我揣著相機(jī)與錄音随常,去河邊找鬼潜沦。 笑死萄涯,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的唆鸡。 我是一名探鬼主播涝影,決...
    沈念sama閱讀 40,025評(píng)論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼争占!你這毒婦竟也來了燃逻?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,867評(píng)論 0 274
  • 序言:老撾萬榮一對(duì)情侶失蹤臂痕,失蹤者是張志新(化名)和其女友劉穎伯襟,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體握童,經(jīng)...
    沈念sama閱讀 45,307評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡姆怪,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,528評(píng)論 2 332
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了舆瘪。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片片效。...
    茶點(diǎn)故事閱讀 39,688評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖英古,靈堂內(nèi)的尸體忽然破棺而出淀衣,到底是詐尸還是另有隱情,我是刑警寧澤召调,帶...
    沈念sama閱讀 35,409評(píng)論 5 343
  • 正文 年R本政府宣布膨桥,位于F島的核電站,受9級(jí)特大地震影響唠叛,放射性物質(zhì)發(fā)生泄漏只嚣。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,001評(píng)論 3 325
  • 文/蒙蒙 一艺沼、第九天 我趴在偏房一處隱蔽的房頂上張望册舞。 院中可真熱鬧,春花似錦障般、人聲如沸调鲸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,657評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽藐石。三九已至,卻和暖如春定拟,著一層夾襖步出監(jiān)牢的瞬間于微,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,811評(píng)論 1 268
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留株依,地道東北人驱证。 一個(gè)月前我還...
    沈念sama閱讀 47,685評(píng)論 2 368
  • 正文 我出身青樓,卻偏偏與公主長得像勺三,于是被迫代替她去往敵國和親雷滚。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,573評(píng)論 2 353

推薦閱讀更多精彩內(nèi)容