美文网首页
samtools 安装过程出现的问题及解决

samtools 安装过程出现的问题及解决

作者: 看远方的星 | 来源:发表于2018-11-28 23:23 被阅读127次

    使用以下步骤安装 :

    mkdir -p ~/biosoft/samtools
    echo 'export PATH=/home/vip41/biosoft/samtools/bin:$PATH' >>~/.bashrc 
    source ~/.bashrc
    cd ~/biosoft/samtools
    wget https://github.com/samtools/samtools/releases/download/1.9/samtools-1.9.tar.bz2
    tar -jxvf samtools-1.9.tar.bz2
    cd  samtools-1.9
    ./configure --prefix=/home/vip41/biosoft/samtools  
    make && make install
    

    出现的问题:
    samtools可用,但是基本命令如ls、pwd等无法使用,使用该命令(export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
    )解决ls等基本命令无法使用问题,但是samtools又变成无法使用,重新添加环境变量,samtools可用,但是ls等基本命令又无法使用:

    vip41@VM-0-15-ubuntu:~/biosoft/samtools$ echo 'export PATH=/home/vip41/biosoft/samtools/bin:$PATH'>>~/.bashrc
    vip41@VM-0-15-ubuntu:~/biosoft/samtools$ source ~/.bashrc
    vip41@VM-0-15-ubuntu:~/biosoft/samtools$ ls
    Command 'ls' is available in '/bin/ls'
    The command could not be located because '/bin' is not included in the PATH environment variable.
    ls: command not found
    vip41@VM-0-15-ubuntu:~/biosoft/samtools$ samtools
    
    Program: samtools (Tools for alignments in the SAM format)
    Version: 1.9 (using htslib 1.9)
    
    Usage:   samtools <command> [options]
    
    Commands:
      -- Indexing
         dict           create a sequence dictionary file
         faidx          index/extract FASTA
         fqidx          index/extract FASTQ
         index          index alignment
    

    使用命令vi ~/.bashrc查看软件路径:

    # added by Miniconda3 installer
    export PATH="/home/vip41/miniconda3/bin:$PATH"
    export PATH=/home/vip41/biosoft/lzma/bin:$PATH
    export PATH=/home/vip41/biosoft/htslib/bin:$PATH
    export PATH=/home/vip41/biosoft/samtools/bin:$PATH
    

    尝试删除samtools的路径,发现问题解决了。samtools居然能用,且常用命令不受影响,就使用命令which samtools查看路径 :

    vip41@VM-0-15-ubuntu:~$ which samtools
    /home/vip41/miniconda3/bin/samtools
    

    找到问题所在,路径冲突了,之前使用conda install 安装过有默认路径。


    附:

    • samtools安装过程中依赖于lzma、htslib两个包,所以在安装samtools之前需要确保安装了lzma、htslib。
    • HTSlib是一个用于处理各种排序和变体文件格式的软件库:SAM,BAM,CRAM,VCF和BCF。SAMtools和BCFtools是围绕HTSlib构建的应用程序,执行格式转换,文件合并和拆分,排序,变体调用等等。
    • xz是一种通用数据压缩工具,其命令行语法类似于 gzip(1)和bzip2(1)。

    软件安装步骤参考:http://www.cnblogs.com/ctfighting/p/7491280.html


    友情阅读推荐:

    相关文章

      网友评论

          本文标题:samtools 安装过程出现的问题及解决

          本文链接:https://www.haomeiwen.com/subject/ecvtcqtx.html