IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> Python知识库 -> 安装numpy模块 -> 正文阅读

[Python知识库]安装numpy模块

使用deepTools里的命令时出现错误:

Traceback (most recent call last):
  File "/usr/local/bin/plotCorrelation", line 5, in <module>
    from deeptools.plotCorrelation import main
  File "/usr/local/lib/python2.7/dist-packages/deeptools/plotCorrelation.py", line 6, in <module>
    import numpy as np
ImportError: No module named numpy

就是说没有numpy这个模块,我们需要安装它。

输入pip install numpy,出现以下错误:

Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (1.22.3)

这是因为numpy被安装到了/usr/local/lib/python3.8/dist-packages (1.22.3)目录下,而我们的python则在另外一个目录中。查看python目录

输入:whereis python

python: /usr/bin/python /usr/bin/python2.7 /usr/bin/python2.7-config /usr/bin/python3.8 
/usr/bin/python3.8-config /usr/lib/python2.7 /usr/lib/python3.8 /usr/lib/python3.9 
/etc/python2.7 /etc/python3.8 /usr/local/lib/python2.7 /usr/local/lib/python3.8 
/usr/include/python2.7 /usr/include/python3.8 /usr/share/python

把numpy安装到正确的python目录中。

输入su root,开启管理员权限,然后输入:

pip install --target=<目录> numpy

<目录>就是python的安装目录下的dist-packages,比如我就输入

pip install --target=/usr/local/lib/python3.8/dist-packages numpy

再用deeptools的工具测试,输入:plotCorrelation,差哪个就pip install哪个,直到所有install完成

直到显示

usage: plotCorrelation [-h] --corData FILE --corMethod {spearman,pearson} --whatToPlot {heatmap,scatterplot}
                       [--plotFile FILE] [--skipZeros] [--labels sample1 sample2 [sample1 sample2 ...]]
                       [--plotTitle PLOTTITLE] [--plotFileFormat FILETYPE] [--removeOutliers] [--version]
                       [--outFileCorMatrix FILE] [--plotHeight PLOTHEIGHT] [--plotWidth PLOTWIDTH] [--zMin ZMIN]
                       [--zMax ZMAX] [--colorMap] [--plotNumbers] [--xRange XRANGE XRANGE] [--yRange YRANGE YRANGE]
                       [--log1p]

Tool for the analysis and visualization of sample correlations based on the output of multiBamSummary or
multiBigwigSummary. Pearson or Spearman methods are available to compute correlation
coefficients. Results can be saved as multiple
scatter plots depicting the pairwise correlations or as a clustered heatmap,
where the colors represent the correlation coefficients and the clusters are constructed using complete linkage.
Optionally, the values can be saved as tables, too.

detailed help:

  plotCorrelation -h

optional arguments:
  -h, --help            show this help message and exit

Required arguments:
  --corData FILE, -in FILE
                        Compressed matrix of values generated by multiBigwigSummary or multiBamSummary
  --corMethod {spearman,pearson}, -c {spearman,pearson}
                        Correlation method.
  --whatToPlot {heatmap,scatterplot}, -p {heatmap,scatterplot}
                        Choose between a heatmap or pairwise scatter plots

Optional arguments:
  --plotFile FILE, -o FILE
                        File to save the heatmap to. The file extension determines the format, so heatmap.pdf will
                        save the heatmap in PDF format. The available formats are: .png, .eps, .pdf and .svg.
  --skipZeros           By setting this option, genomic regions that have zero or missing (nan) values in all samples
                        are excluded.
  --labels sample1 sample2 [sample1 sample2 ...], -l sample1 sample2 [sample1 sample2 ...]
                        User defined labels instead of default labels from file names. Multiple labels have to be
                        separated by spaces, e.g. --labels sample1 sample2 sample3
  --plotTitle PLOTTITLE, -T PLOTTITLE
                        Title of the plot, to be printed on top of the generated image. Leave blank for no title.
                        (Default: )
  --plotFileFormat FILETYPE
                        Image format type. If given, this option overrides the image format based on the plotFile
                        ending. The available options are: png, eps, pdf and svg.
  --removeOutliers      If set, bins with very large counts are removed. Bins with abnormally high reads counts
                        artificially increase pearson correlation; that's why, multiBamSummary tries to remove
                        outliers using the median absolute deviation (MAD) method applying a threshold of 200 to only
                        consider extremely large deviations from the median. The ENCODE blacklist page
                        (https://sites.google.com/site/anshulkundaje/projects/blacklists) contains useful information
                        about regions with unusually high countsthat may be worth removing.
  --version             show program's version number and exit

Output optional options:
  --outFileCorMatrix FILE
                        Save matrix with pairwise correlation values to a tab-separated file.

Heatmap options:
  --plotHeight PLOTHEIGHT
                        Plot height in cm. (Default: 9.5)
  --plotWidth PLOTWIDTH
                        Plot width in cm. The minimum value is 1 cm. (Default: 11)
  --zMin ZMIN, -min ZMIN
                        Minimum value for the heatmap intensities. If not specified, the value is set automatically
  --zMax ZMAX, -max ZMAX
                        Maximum value for the heatmap intensities.If not specified, the value is set automatically
  --colorMap            Color map to use for the heatmap. Available values can be seen here:
                        http://matplotlib.org/examples/color/colormaps_reference.html
  --plotNumbers         If set, then the correlation number is plotted on top of the heatmap. This option is only
                        valid when plotting a heatmap.

Scatter plot options:
  --xRange XRANGE XRANGE
                        The X axis range. The default scales these such that the full range of dots is displayed.
  --yRange YRANGE YRANGE
                        The Y axis range. The default scales these such that the full range of dots is displayed.
  --log1p               Plot the natural log of the scatter plot after adding 1. Note that this is ONLY for plotting,
                        the correlation is unaffected.

example usages:
plotCorrelation -in results_file --whatToPlot heatmap --corMethod pearson -o heatmap.png

代表可以使用了。

su <你的用户名>就可以回到自己的账户。

  Python知识库 最新文章
Python中String模块
【Python】 14-CVS文件操作
python的panda库读写文件
使用Nordic的nrf52840实现蓝牙DFU过程
【Python学习记录】numpy数组用法整理
Python学习笔记
python字符串和列表
python如何从txt文件中解析出有效的数据
Python编程从入门到实践自学/3.1-3.2
python变量
上一篇文章      下一篇文章      查看所有文章
加:2022-04-22 18:32:27  更:2022-04-22 18:34:30 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/15 17:28:58-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码