搭建PrimerServer2之Web UI界面

寫(xiě)在前面

引物設(shè)計(jì)幾乎是每個(gè)分子實(shí)驗(yàn)室的研究生必備的一項(xiàng)技能。目前,已經(jīng)有許多成熟的引物設(shè)計(jì)軟件供大家使用,如本地版的Primer5以及NCBI上的Primer-BLAST等等。

但是這些軟件大部分都需要用戶(hù)提供目標(biāo)基因序列,才能進(jìn)行設(shè)計(jì),對(duì)新手來(lái)說(shuō),還得先學(xué)會(huì)如何獲取目標(biāo)基因序列(如果做的物種比較小眾,絕大部分都沒(méi)有現(xiàn)成數(shù)據(jù)庫(kù)可以搜索序列,需要自己做比對(duì)鑒定)。

這里推薦一個(gè)軟件PrimerServer2,其支持用戶(hù)自定義物種進(jìn)行引物設(shè)計(jì),可以根據(jù)GeneID設(shè)計(jì)任意基因的引物。此外還提供了用戶(hù)友好的Web UI界面,搭建在實(shí)驗(yàn)室網(wǎng)站或基因組數(shù)據(jù)庫(kù)網(wǎng)站,確實(shí)是個(gè)不錯(cuò)的選擇~


一、安裝

  • 下載PrimerServer2
git clone https://github.com/billzt/PrimerServer2.git
  • PrimerServer2是基于python3開(kāi)發(fā)的軟件,因此需要安裝python3
  • 編譯安裝,直接conda也不錯(cuò) 更方便
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1rc2.tgz
tar -zxf  Python-3.7.1rc2.tgz
./configure --with-ssl
make
make install
  • 安裝samtools(Samtools >=1.9)
wget https://github.com/samtools/samtools/releases/download/1.15.1/samtools-1.15.1.tar.bz2
  • 解壓
tar jxvf samtools-1.15.1.tar.bz2
  • 安裝
./configure --prefix=/tools/samtools/samtools-1.15.1
make
make install
  • 進(jìn)入PrimerServer2文件夾
cd PrimerServer2
  • 建議在虛擬環(huán)境中運(yùn)行,創(chuàng)建虛擬環(huán)境
python3 -m venv venv
. venv/bin/activate
  • 運(yùn)行安裝腳本,下載并安裝一系列需要的環(huán)境(有點(diǎn)久。。。)
python3 setup.py develop
  • 遇到報(bào)錯(cuò),有個(gè)模塊沒(méi)安裝上
ModuleNotFoundError: No module named 'markupsafe'
  • 手動(dòng)安裝
#如果pip版本太低,會(huì)報(bào)錯(cuò) ,需要升級(jí)再安裝模塊
pip install --upgrade pip
#安裝markupsafe模塊
pip install markupsafe
  • 重新運(yùn)行安裝腳本,安裝成功
python3 setup.py develop

二、配置示例數(shù)據(jù)

  • 首先配置示例數(shù)據(jù)
primerserver-config
  • 執(zhí)行完之后會(huì)配置一個(gè)默認(rèn)的示例json配置文件,需要修改文件里面的內(nèi)容,指定示例數(shù)據(jù)所在目錄

vim ~/.primerserver.json

{
    "cpu": 2,
    "templates_directory": "示例數(shù)據(jù)路徑(即tests文件夾路徑)",
    "templates": {
        "example.fa": {
            "IDs": "seq1, seq2",
            "description": "Example Database",
            "group": "example"
        },
        "example2.fa": {
            "IDs": "seq1, seq2",
            "description": "Example Database 2",
            "group": "example"
        }
    }
}
  • 配置完成之后運(yùn)行primerserver2
flask run
  • 運(yùn)行成功,可用瀏覽器訪問(wèn),默認(rèn)端口為5000,如果訪問(wèn)不了(比如租用的華為云或者騰訊云,有安全組) 需要自行開(kāi)放5000端口
http://your.IP.address:5000

三、配置用戶(hù)數(shù)據(jù)

  • 首先創(chuàng)建數(shù)據(jù)目錄,并將需要提取好的cds序列移動(dòng)到該目錄,這里以荔枝為例
mkdir litchi_data
  • 建立blast databases
makeblastdb -input_type fasta -dbtype nucl -in litchi.cds.fa -parse_seqids 2>/dev/null
  • 建立samtools索引
samtools faidx litchi.cds.fa
  • 修改配置文件,這邊只配置了一個(gè)物種的數(shù)據(jù),如有多個(gè)物種,直接在json上依次添加多個(gè)物種信息即可,可用“group”定義分組
    vim ~/.primerserver.json
  • "templates_directory":數(shù)據(jù)存儲(chǔ)路徑
  • "litchi.cds.longest.fa":用戶(hù)數(shù)據(jù)文件名(fasta格式)
  • "IDs":給出序列中的兩個(gè)基因ID作為示例數(shù)據(jù),在web UI中顯示
  • "description":對(duì)數(shù)據(jù)的一些描述,用戶(hù)自定義
  • "group":分組,如果有不同的物種數(shù)據(jù)可以自定義分組
{
    "cpu": 2,
    "templates_directory": "數(shù)據(jù)存儲(chǔ)路徑",
    "templates": {
        "litchi.cds.longest.fa": {
            "IDs": "LITCHI014204, LITCHI014242",
            "description": "Litchi Database",
            "group": "Sapindaceae"
        }
    }
}
  • 配置完成之后,重新運(yùn)行primerserver2
flask run
  • 平時(shí)用tmux將primerserver2掛在后臺(tái)運(yùn)行就好,方便

寫(xiě)在最后

疫情反反復(fù)復(fù),大家五一出門(mén)注意安全
假期見(jiàn)見(jiàn)老友吃吃飯,舒服~

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容