差異分析工具STAMP手冊1:Linux版安裝

關(guān)于STAMP(Statistical Analysis of Metagenomic Profiles)已經(jīng)有很多介紹了,如微生物組間差異分析的神器——STAMP(2016.12) ??梢娨M大陸視野已經(jīng)一年多了,現(xiàn)在你再想寫出很好的文檔,是有難度了。但是目前還沒有一個完整的應(yīng)用手冊,也就是軟件文檔的翻譯、完整功能的介紹和流程化。

STAMP是什么的問題已經(jīng)解決了,怎么用的問題也已經(jīng)解決大半,比如Analyzing metagenomes with STAMP,剩下來就是為什么用這個的問題了。這個問題誰來回答?

STAMP window版很好下載和安裝,就是不斷地next,也推薦大家安裝這個,因為linux版本的安裝好用起來還是圖像化的界面。下面我就介紹一下自己在阿里云上安裝STAMP的經(jīng)過。覺得安裝了linux版的就不用點按鈕了,也更接近計算過程,也更難。

首先我在官網(wǎng)上找到:

Linux and OS X users can follow the instructions to install from source

點連接,告訴我:

STAMP is implemented in Python and running it from source is easy. Any operating system that supports Python should be able to run STAMP from source. Running from source is the best way to fully exploit and contribute to STAMP. STAMP is dependent on the following libraries:

接下來就進入了漫長的裝包之旅

在安裝PyQt4的時候需要安裝SIP,其實我現(xiàn)在是有這個庫的但是版本不對,人家要4.19.1以上的。我就把原來的用conda uninstall 卸載掉重新安裝。

這里講一下如何查看Python安裝的包的版本。

$pip list # 查看用pip裝的包
$conda list #查看conda裝的包

或者在Python 解釋器中查看:

$python
Python 2.7.14 |Anaconda, Inc.| (default, Oct 16 2017, 17:29:19) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> impert
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'impert' is not defined
>>> import sip
>>> print(sip,sip.SIP_VERSION_STR)
(<module 'sip' from '/root/miniconda2/lib/python2.7/site-packages/sip.so'>, '4.19.8')

下載壓縮包 sip-4.19.8tar.gz

tar zxvf sip-4.19.8.tar.gz
cd  sip-4.19.8
python configure.py
make
make install

預(yù)計是這樣子的,但是到了make那一步總是報錯,共享庫找不到。誰知道編譯是個什么鬼,一竅不通,就在別的機器上把需要的共享庫放到自己的機器上。

cp過來之后,make還是不行,報出了別的錯??戳藄ip的REANME,發(fā)現(xiàn)需要安裝依賴的兩個庫:

The ``build.py`` script requires that ``flex`` and ``bison`` are installed. 

我連這兩個 Bison-Flex是什么都不知道好嗎,查查,介紹的很多,安裝倒是不這么難。

安裝完,測試一下,可以了。

  $sip -V
  4.19.8

說來簡單,足足花了我一上午的時間。

然后是安裝pyqt4,有了上面的經(jīng)驗就快很多了。
PyQt4的安裝
安裝pyqt4

其他的包按照類似的方法安裝,pip install、conda install、yum install、下載安裝包等方法均得到了安裝。

其中biom-format的安裝可能要復(fù)雜一點,另外在import的時候,是import biom,不是import biom-formt。

如果你的依賴的東西夠搞好的話,也可以這樣安裝:

Source code on Linux

STAMP can be install on Linux (tested under Ubuntu 14.04) using the following commands:

$yum install libblas-dev liblapack-dev gfortran
$yum  install freetype* python-pip python-dev python-numpy python-scipy python-matplotlib
$pip install STAMP

安裝了STAMP之后,提示我在命令行運行STMAP,但是我運行之后是這樣的:

$STAMP
QXcbConnection: Could not connect to display 
Aborted

原來我的Xshell并沒有圖形化界面,我今天才知道linux也可以打開圖形化界面的軟件。查過 Linux DISPLAY環(huán)境變量的妙用(error:QXcbConnection: Could not connect to display)之后安裝了 MobaXterm ,這是一款全能型開源遠(yuǎn)程終端。在這個上面運行:

$STAMP
/root/miniconda2/lib/python2.7/site-packages/matplotlib/cbook/deprecation.py:107: MatplotlibDeprecationWarning: The mpl_toolkits.axes_grid module was deprecated in version 2.1. Use mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist provies the same functionality instead.
 warnings.warn(message, mplDeprecation, stacklevel=1)
QXcbConnection: XCB error: 145 (Unknown), sequence: 171, resource id: 0, major code: 139 (Unknown), minor code: 20

雖然出現(xiàn)了些許的報錯,還是出現(xiàn)了這樣的界面:


STAMP

也就是說很可能安裝成功了。

只有測試過的才是真實的

我們來測試一下。
按照微生物多樣性組間差異分析神器-STAMP 的介紹,我們一步一步來,文中提到的 Fish’s exact test我在Windows上的STAMP已經(jīng)測試通過了,得到了想要的畫面。

我把Windows下面的測試文件拷到我的linux上,導(dǎo)入數(shù)據(jù),和Windows版的一樣,點幾個按鈕,運行測試,得到了,我預(yù)期的畫面。生物學(xué)意義的討論不在本文范圍內(nèi),有時間我會慢慢品讀。

加載文件或者方法

在我進行加載文件和方法以及測試的時候,我的linux控制臺沒有變化,說明這兩者之間并不像RStudio那樣明顯。但是還是出現(xiàn)了一些提示的:

$STAMP
/root/miniconda2/lib/python2.7/site-packages/matplotlib/cbook/deprecation.py:107: MatplotlibDeprecationWarning: The mpl_too                                                                      lkits.axes_grid module was deprecated in version 2.1. Use mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist provies the s                                                                      ame functionality instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)
QXcbConnection: XCB error: 145 (Unknown), sequence: 171, resource id: 0, major code: 139 (Unknown), minor code: 20
QObject::disconnect: Unexpected null parameter
/root/miniconda2/lib/python2.7/site-packages/stamp/plugins/multiGroups/plots/HeatmapPlot.py:110: ClusterWarning: scipy.clus                                                                      ter: The symmetric non-negative hollow observation matrix looks suspiciously like an uncondensed distance matrix
  linkage = cluster.linkage(dist.squareform(d), method='average')

測試成功
測試成功

回到問題的開始,我怎么在能在linux上,而不是圖形界面來運行呢?換言之,用代碼來控制STAMP而不是按鈕?畢竟按鈕不方便批量操作。就像R語言那樣,說到這,我想RStudio 有沒有l(wèi)inux桌面版呢?一查還真有, R語言工程化實踐:RStudio Server環(huán)境快速配置教程,原來所有雙擊能打開的程序都可以在linux用命令打開。

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

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

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