EDirect在linux和mac下的安装

2019-06-24 10:11:23 浏览数 (1)

Edirect是非常有用的工具 其使用要用来perl,mac都预先安装了perl 安装的时候最好按下面进行 打开终端

代码语言:javascript复制
cd ~
/bin/bash
perl -MNet::FTP -e 
    '$ftp = new Net::FTP("ftp.ncbi.nlm.nih.gov", Passive => 1);
    $ftp->login; $ftp->binary;
    $ftp->get("/entrez/entrezdirect/edirect.tar.gz");'
gunzip -c edirect.tar.gz | tar xf -
rm edirect.tar.gz
builtin exit
export PATH=$PATH:$HOME/edirect >& /dev/null || setenv PATH "${PATH}:$HOME/edirect"
./edirect/setup.sh

显示和提示如下

代码语言:javascript复制
Trying to establish local installations of any missing Perl modules
(as logged in /Users/ucco/edirect/setup-deps.log).
Please be patient, as this step may take a little while.

Entrez Direct has been successfully downloaded and installed.

In order to complete the configuration process, please execute the following:

  echo "source ~/.bash_profile" >> $HOME/.bashrc
  echo "export PATH=${PATH}:/Users/ucco/edirect" >> $HOME/.bash_profile

or manually edit the PATH variable assignment in your .bash_profile file.
代码语言:javascript复制
echo "export PATH=$PATH:$HOME/edirect" >> $HOME/.bash_profile

为了验证是否安装完成,终端输入下面代码

代码语言:javascript复制
echo "***********************" > installconfirm
echo "esearch version:" >> installconfirm
esearch -version >> installconfirm
echo "xtract version:" >> installconfirm
xtract -version >> installconfirm
echo "EDirect install status:" >> installconfirm
esearch -db pubmed -query "Babalobi OO[au] AND 2008[pdat]" | 
efetch -format xml | 
xtract -pattern Author -if Affiliation -contains Medicine 
-element Initials >> installconfirm
echo "***********************" >> installconfirm
cat installconfirm
rm installconfirm

如果安装成功会显示以下内容

代码语言:javascript复制
***********************
esearch version:
11.6
xtract version:
11.6
EDirect install status:
OK
***********************

0 人点赞