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

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

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 <module>
    '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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 219,635评论 6 508
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,628评论 3 396
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 165,971评论 0 356
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,986评论 1 295
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 68,006评论 6 394
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,784评论 1 307
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,475评论 3 420
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,364评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,860评论 1 317
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 38,008评论 3 338
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,152评论 1 351
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,829评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,490评论 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,035评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,156评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,428评论 3 373
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,127评论 2 356