用conda下载安装gatk3.8并注册

现在gatk已经更新到gatk4了,但是gatk3.8还是有很多应用的场景,比如指定多线程,并且有些功能在gatk4里找不到(也可能是我道行浅)所以记录一下之前如何安装和注册gatk3.8的过程,以备不时之需。

用conda安装gatk

conda的安装及使用请参考conda的安装与使用

# 创建一个叫GATK的虚拟环境,并安装gatk
$ conda create -n GATK GATK -y
# 激活这个虚拟环境
$ conda activate GATK
# 尝试运行
$ GenomeAnalysisTK -h 
# 或者运行gatk3 -h

会有如下提示:

GATK jar file not found. Have you run "gatk3-register"?

需要运行gatk3-register来注册,运行之后:

$ gatk3-register

  It looks like GATK has not yet been installed.

  Usage: gatk3-register /path/to/GenomeAnalysisTK[-3.8.tar.bz2|.jar]

  Due to license restrictions, this recipe cannot distribute
  and install GATK directly. To fully install GATK, you must
  download a licensed copy of GATK from the Broad Institute:
    https://www.broadinstitute.org/gatk/download/
  and run (after installing this package):
    gatk-register /path/to/GenomeAnalysisTK[-3.8.tar.bz2|.jar],
   This will copy GATK into your conda environment.

到https://software.broadinstitute.org/gatk/download/archive这个地方下载register工具。选择了一个3.8.0的版本,下载到本地,再通过rz传到服务器上(如何无root安装lrzsz请查看无root安装软件系列),解压到~/biosoft下(嗯,习惯把生信相关的软件都存放在家目录的biosoft文件夹下,跟我洲更学长@徐洲更hoptop学的)。重新register一遍。

$ gatk3-register ~/biosoft/GenomeAnalysisTK-3.8-0-ge9d806836.tar.bz2
ENV_PREFIX /my/path/to
Processing GenomeAnalysisTK-3.8-0-ge9d806836.tar.bz2 as *.tar.bz2
Extracting GenomeAnalysisTK-3.8-0-ge9d806836.tar.bz2
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.creationtime'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
GenomeAnalysisTK-3.8-0-ge9d806836/
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.creationtime'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
GenomeAnalysisTK-3.8-0-ge9d806836/GenomeAnalysisTK.jar
GenomeAnalysisTK-3.8-0-ge9d806836/GenomeAnalysisTK.jar
jar file specified matches expected version
Moving GenomeAnalysisTK-3.8-0-ge9d806836.tar.bz2 to /my/path/to/gatk-3.8

然后就可以正常使用了

GenomeAnalysisTK -h
# 或者
gatk3 -h

tips:如果需要安装GATK4的话需要在conda里搜索并安装GATK4

# 搜索,非必须步骤
conda search GATK4
# 安装
conda install GATK4

你可能感兴趣的:(用conda下载安装gatk3.8并注册)