安装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 <你的用户名>就可以回到自己的账户。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值