【软件安装】---使用poretools分析原始nanopore测序数据

前言:nanopore的下机数据是fast5格式,通常在下游分析之前,需要转换成fastq,poretools是一款开源工具,可以针对原始的fast5文件进行各种操作。
查看官方说明文档,可访问poretools主页

【软件安装】---使用poretools分析原始nanopore测序数据_第1张图片
poretools主页

  1. 软件安装
    poretools是基于python2开发,所以可以先使用conda构建python2的环境
conda create -n PoreTools python=2.7.14
conda activate PoreTools
git clone https://github.com/arq5x/poretools
cd poretools
#如果你像我一样,没有root权限,那么安装命令是下面这一条
python setup.py install --user

2.报错解决
在执行python setup.py install --user时,报错:

0.6.0
running install
running bdist_egg
running egg_info
writing requirements to poretools.egg-info/requires.txt
writing poretools.egg-info/PKG-INFO
writing top-level names to poretools.egg-info/top_level.txt
writing dependency_links to poretools.egg-info/dependency_links.txt
writing entry points to poretools.egg-info/entry_points.txt
reading manifest file 'poretools.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'poretools.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/Event.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/Fast5File.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/__init__.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/combine.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/events.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/fasta.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/fastq.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/formats.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/hist.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/index.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/metadata.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/nucdist.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/occupancy.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/organise.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/poretools_main.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/qual_v_pos.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/qualdist.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/readstats.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/squiggle.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/statistics.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/stats.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/tabular.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/times.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/version.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/winner.py -> build/bdist.linux-x86_64/egg/poretools
copying build/lib/poretools/yield_plot.py -> build/bdist.linux-x86_64/egg/poretools
creating build/bdist.linux-x86_64/egg/poretools/scripts
copying build/lib/poretools/scripts/__init__.py -> build/bdist.linux-x86_64/egg/poretools/scripts
copying build/lib/poretools/scripts/poretools-script.py -> build/bdist.linux-x86_64/egg/poretools/scripts
byte-compiling build/bdist.linux-x86_64/egg/poretools/Event.py to Event.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/Fast5File.py to Fast5File.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/combine.py to combine.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/events.py to events.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/fasta.py to fasta.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/fastq.py to fastq.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/formats.py to formats.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/hist.py to hist.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/index.py to index.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/metadata.py to metadata.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/nucdist.py to nucdist.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/occupancy.py to occupancy.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/organise.py to organise.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/poretools_main.py to poretools_main.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/qual_v_pos.py to qual_v_pos.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/qualdist.py to qualdist.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/readstats.py to readstats.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/squiggle.py to squiggle.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/statistics.py to statistics.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/stats.py to stats.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/tabular.py to tabular.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/times.py to times.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/version.py to version.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/winner.py to winner.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/yield_plot.py to yield_plot.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/scripts/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/poretools/scripts/poretools-script.py to poretools-script.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying poretools.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying poretools.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying poretools.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying poretools.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying poretools.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying poretools.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying poretools.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/poretools-0.6.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing poretools-0.6.0-py2.7.egg
removing '/home/ljf/.local/lib/python2.7/site-packages/poretools-0.6.0-py2.7.egg' (and everything under it)
creating /home/ljf/.local/lib/python2.7/site-packages/poretools-0.6.0-py2.7.egg
Extracting poretools-0.6.0-py2.7.egg to /home/ljf/.local/lib/python2.7/site-packages
poretools 0.6.0 is already the active version in easy-install.pth
Installing poretools script to /home/ljf/.local/bin

Installed /home/ljf/.local/lib/python2.7/site-packages/poretools-0.6.0-py2.7.egg
Processing dependencies for poretools==0.6.0
Searching for pandas
Reading https://pypi.org/simple/pandas/
Downloading https://files.pythonhosted.org/packages/53/87/6438c197fc70ca6b3056cfb60b3dfedca25bedb631bce1f72d6a10502d15/pandas-1.0.4.tar.gz#sha256=b35d625282baa7b51e82e52622c300a1ca9f786711b2af7cbe64f1e6831f4126
Best match: pandas 1.0.4
Processing pandas-1.0.4.tar.gz
Writing /tmp/easy_install-_oW1dE/pandas-1.0.4/setup.cfg
Running pandas-1.0.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_oW1dE/pandas-1.0.4/egg-dist-tmp-Rxph_5
Traceback (most recent call last):
  File "setup.py", line 42, in 
    'Topic :: Scientific/Engineering :: Bio-Informatics'
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/install.py", line 117, in do_egg_install
    cmd.run(show_deprecation=False)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 424, in run
    self.easy_install(spec, not self.no_deps)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 666, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 713, in install_item
    self.process_distribution(spec, dist, deps)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 758, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
    replace_conflicting=replace_conflicting
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
    return self.obtain(req, installer)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
    return installer(requirement)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 685, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 711, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 896, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1164, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1150, in run_setup
    run_setup(setup_script, args)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/home/ljf/miniconda3/envs/PoreTools/lib/python2.7/site-packages/setuptools/sandbox.py", line 44, in _execfile
    code = compile(script, filename, 'exec')
  File "/tmp/easy_install-_oW1dE/pandas-1.0.4/setup.py", line 42
    f"numpy >= {min_numpy_ver}",
                              ^

看上去是numpy包版本不对,于是手动安装numpy

pip install numpy

然后继续python setup.py install --user时,又有报错:

ERROR: poretools 0.6.0 requires pandas, which is not installed.
ERROR: poretools 0.6.0 requires h5py>=2.2.0, which is not installed.
ERROR: poretools 0.6.0 requires matplotlib, which is not installed.
ERROR: poretools 0.6.0 requires seaborn, which is not installed.

原来是还需要上述四个依赖包,继续手动安装:

pip install seaborn -i https://pypi.doubanio.com/simple/
pip install matplotlib -i https://pypi.doubanio.com/simple/
pip install pandas -i https://pypi.doubanio.com/simple/
pip install h5py -i https://pypi.doubanio.com/simple/

然后继续执行安装命令:

python setup.py install --user

安装完成~

> poretools -h
usage: poretools [-h] [-v]
                 {combine,fastq,fasta,stats,hist,events,readstats,tabular,nucdist,metadata,index,qualdist,qualpos,winner,squiggle,times,yield_plot,occupancy,organise}
                 ...

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         Installed poretools version

[sub-commands]:
  {combine,fastq,fasta,stats,hist,events,readstats,tabular,nucdist,metadata,index,qualdist,qualpos,winner,squiggle,times,yield_plot,occupancy,organise}
    combine             Combine a set of FAST5 files in a TAR achive
    fastq               Extract FASTQ sequences from a set of FAST5 files
    fasta               Extract FASTA sequences from a set of FAST5 files
    stats               Get read size stats for a set of FAST5 files
    hist                Plot read size histogram for a set of FAST5 files
    events              Extract each nanopore event for each read.
    readstats           Extract signal information for each read over time.
    tabular             Extract the lengths and name/seq/quals from a set of
                        FAST5 files in TAB delimited format
    nucdist             Get the nucl. composition of a set of FAST5 files
    metadata            Return run metadata such as ASIC ID and temperature
                        from a set of FAST5 files
    index               Tabulate all file location info and metadata such as
                        ASIC ID and temperature from a set of FAST5 files
    qualdist            Get the qual score composition of a set of FAST5 files
    qualpos             Get the qual score distribution over positions in
                        reads
    winner              Get the longest read from a set of FAST5 files
    squiggle            Plot the observed signals for FAST5 reads.
    times               Return the start times from a set of FAST5 files in
                        tabular format
    yield_plot          Plot the yield over time for a set of FAST5 files
    occupancy           Inspect pore activity over time for a set of FAST5
                        files
    organise            Move FAST5 files into a useful folder hierarchy

下面是广告时间:
做了这么久生信,我也该出山了,如果有生信分析需求或者想交流生信学习经验的小伙伴,可在私信联系我噢~~

或者关注我们的微信公众号:BI201708

你可能感兴趣的:(【软件安装】---使用poretools分析原始nanopore测序数据)