本地安装UCSC基因组浏览器
UCSC基因組瀏覽器在大規(guī)模高通量數(shù)據(jù)的可視化和比較分析研究中發(fā)揮著重要的作用。擁有了本地瀏覽器,就可以對(duì)自己的測(cè)序數(shù)據(jù)進(jìn)行更深入的分析和共享使用。本文詳細(xì)介紹了如何一步步在本地安裝、配置、高級(jí)使用UCSC瀏覽器。
安裝UCSC瀏覽器
1. 安裝mysql+apache
#For Ubuntu usersudo apt-get install taskselsudo apt-get install lamp-server#For readhat or centos user yum install httpd mariadb-server mariadb2. 新建mysql用戶
# 用戶名:gw # 密碼 ?:qazplm_gw create user 'gw'@'localhost' identified by 'qazplm_gw';3. 同步UCSC所需html文件和運(yùn)行程序
# 設(shè)置UCSC的安裝目錄為 /var/www/gw mkdir /var/www/gw# 同步相應(yīng)的html文件 rsync -avzP --exclude 'ENCODE' rsync://hgdownload.cse.ucsc.edu/htdocs/ /var/www/gw# 同步可執(zhí)行程序到cgi-bin目錄下mkdir /var/www/gw/cgi-bin# For 64-bit rsync -avzP rsync://hgdownload.cse.ucsc.edu/cgi-bin/ /var/www/gw/cgi-bin/ ?#64 bit# 更改cgi-bin目錄的所有者 chown -R www-data.www-data /var/www/gw/cgi-bin/4. 把以下內(nèi)容寫入/etc/apahce2/httpd.conf
# XBitHack on 是必須的 # 其它參數(shù)的意思參見apache文檔 XBitHack on <Directory /var/www/gw> ? AllowOverride AuthConfigOptions +Includes </Directory># the ScriptAlias directive is crucialScriptAlias /gw/cgi-bin /var/www/gw/cgi-bin <Directory "/var/www/gw/cgi-bin">AllowOverride NoneOptions +ExecCGI -MultiViews +SymLinksIfOwnerMatchOrder allow,denyAllow from allAddHandler cgi-script cgi pl</Directory>5. 設(shè)置Apache解析有執(zhí)行權(quán)限的文件中的SSI指令,然后重啟apache
ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled//etc/init.d/apache2 restart6. 設(shè)置數(shù)據(jù)庫配置文件
進(jìn)入/var/www/gw/cgi-bin/目錄,建立hg.conf文件并寫入下列內(nèi)容
db.host=localhost db.user=gw db.password=qazplm_gw db.trackDb=trackDbcentral.db=hgcentral central.host=localhost central.user=gw central.password=qazplm_gw central.domain=backupcentral.db=hgcentral backupcentral.host=localhost backupcentral.user=gw backupcentral.password=qazplm_gw backupcentral.domain=同時(shí)運(yùn)行如下命令sudo chown www-data /var/www/gw/cgi-bin/hg.conf更改文件的所有權(quán)。
更多功能的conf文件見http://genome-test.cse.ucsc.edu/~kent/src/unzipped/product/ex.hg.conf.
7. 建立緩存文件夾
rm /var/www/gw/trash mkdir /var/www/gw/trash chown www-data.www-data /var/www/gw/trash8. 提供Javascript文件
mkdir -p /usr/local/apache/htdocs/ln -s /var/www/gw/js/ /usr/local/apache/htdocs/jsln -s /var/www/gw/style/ /usr/local/apache/htdocs/style # 每次重啟服務(wù)器后,可能要重復(fù)上述操作。9. 這時(shí)就應(yīng)該能夠訪問了,成功的標(biāo)志就是訪問http://localhost/gw會(huì)看到UCSC常見的頁面。
加載UCSC瀏覽器所需數(shù)據(jù)庫內(nèi)容
1. 安裝hgcentral數(shù)據(jù)庫內(nèi)容
wget http://hgdownload.cse.ucsc.edu/admin/hgcentral.sql mysql -uroot -proot_passwd -e 'create database hgcentral' mysql -uroot -proot_passwd -e 'grant all privileges on hgcentral.* to 'gw'@'localhost'' # 加載下載的hgcentral數(shù)據(jù)庫 mysql -ugw -p qazplm_gw hgcentral <hgcentral.sql mysql -uroot -proot_passwd -e 'create database hgFixed' mysql -uroot -proot_passwd -e 'grant select on hgFixed.* to 'gw'@'localhost'- 出現(xiàn)錯(cuò)誤/var/www/gw/cgi-bin/hgGateway: error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory時(shí)的解決方案:
2. 獲取相關(guān)物種信息數(shù)據(jù)庫
# 鑒于物種信息數(shù)據(jù)庫比較大,可以在數(shù)據(jù)盤新建目錄用于存儲(chǔ) #change datadir to /home/mysql /etc/init.d/mysql stop vim /etc/mysql/my.cnf#下載數(shù)據(jù)庫 rsync -avzP ?rsync://hgdownload.cse.ucsc.edu/mysql/mm9/chromInfo.MYD /home/mysql/mm9rsync -avzP rsync://hgdownload.cse.ucsc.edu/mysql/mm9/chromInfo.MYI /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/chromInfo.frm /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/cytoBandIdeo.MYD /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/cytoBandIdeo.MYI /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/cytoBandIdeo.frm /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/grp.MYD /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/grp.MYI /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/grp.frm /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/hgFindSpec.MYD /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/hgFindSpec.MYI /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/hgFindSpec.frm /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/trackDb.MYD /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/trackDb.MYI /home/mysql/mm9rsync -avzP ? rsync://hgdownload.cse.ucsc.edu/mysql/mm9/trackDb.frm /home/mysql/mm9 ##賦予權(quán)限 chown -R mysql.mysql /home/mysql/mm9-
錯(cuò)誤解決
a. Could not connect to database (null) on localhost as gw. Client does not support authentication protocol requested by server; consider upgrading MySQL
?set password for 'gw'@'localhost'=OLD_PASSWORD('qazplm_gw');flush privileges;b. Cant connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
?ln -s /var/run/mysqld/mysqld.sock /var/lib/mysql/mysql.sockchmod 666 /var/lib/mysql/mysql.sockchmod 755 /var/lib/mysql/
3. 下載gbdb數(shù)據(jù)
#bbi 為encode數(shù)據(jù) mkdir -p /home/user/gbdb/mm9 rsync -avzP --delete --max-delete=20 --exclude=bbi \ ? ? rsync://hgdownload.cse.ucsc.edu/gbdb/mm9/ ~/gbdb/mm9/ #---mappability data---------------rsync -avzp rsync://hgdownload.cse.ucsc.edu/gbdb/mm9/bbi/*.bw ~/gbdb/mm9/bbi ln -s /home/user/gbdb /gbdb4. 訪問鏈接http://localhost/gw/cgi-bin/hgGateway?db=mm9
UCSC Track Hub使用
UCSC Track Hub可以方便加載多組高通量分析結(jié)果文件,并且可以使用Track overlay, 即不同的Track疊加到一起顯示,方便比較。具體見測(cè)序數(shù)據(jù)可視化 (三) - UCSC genomebrowser
1. 構(gòu)建UCSC hub track
#首先看目錄結(jié)構(gòu) /var/www/hub$ tree . ├── genomes.txt ├── hub.txt └── mm9├── ctcf1.bw├── P3001.bw├── ctcf2.bw├── P3002.bw└── trackDb.txt#再看每個(gè)文件的內(nèi)容 $cat genomes.txt genome mm9 trackDb mm9/trackDb.txt$cat hub.txt hub myhub shortLabel Testhub longLabel Testhubsdsdsdsd genomesFile genomes.txt email my@my.com$cat mm9/trackDb.txt # access http://localhost/cgi-bin/hgTracks?db=mm9&hubUrl=https://localhost/hub.txt # help : http://genome.ucsc.edu/goldenPath/help/hgTrackHubHelp.html # trackDb.txt syntax http://genome.ucsc.edu/goldenPath/help/trackDb/trackDbHub.html#bigBed_-_Item_or_Region_Track_Settings #http://davetang.org/muse/2012/03/15/ucsc-genome-browser-custom-overlap-tracks/ track One container multiWig shortLabel One longLabel One type bigWig #viewLimits 0:160 visibility full aggregate transparentOverlay showSubtrackColorOnUi on priority 1.2 configurable on autoScale on dragAndDrop subtracks windowingFunction mean+whiskers maxHeightPixels 100:60:8track One_ctcf bigDataUrl ctcf1.bw shortLabel ctcf1.bw longLabel ctcf1.bw parent one type bigWig color 0,102,255track P300 bigDataUrl P3001.bw shortLabel P3001.bw longLabel P3001.bw parent one type bigWig color 136,102,255track Two container multiWig shortLabel Two longLabel Two type bigWig #viewLimits 0:160 visibility full aggregate transparentOverlay showSubtrackColorOnUi on windowingFunction maximum priority 1.2 configurable on autoScale on dragAndDrop subtrackstrack ctcf2 bigDataUrl ctcf2.bw shortLabel ctcf2.bw longLabel ctcf2.bw parent Two type bigWig color 0,102,2552. 定時(shí)清理
#!/bin/bash #10080 means 10080 minutes which is 14 days. find /var/www/gw/trash/ \! \( -regex "/var/www/gw/trash/ct/.*" -or \-regex "/var/www/gw/trash/hgSs/.*" \) -type f -amin +10080 -exec rm -f {} \;總結(jié)
以上是生活随笔為你收集整理的本地安装UCSC基因组浏览器的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Cell|严景华/齐建勋首次发现新冠病毒
- 下一篇: 风湿病年鉴 | scRNA-seq研究揭