【问题标题】:Dependencies plot-vcfstats in conda environmentconda 环境中的依赖关系 plot-vcfstats
【发布时间】:2021-12-08 02:13:58
【问题描述】:

我有一个 conda 环境,其中安装了包括 bcftools 在内的软件包。我正在使用bcftools stats 在我的 VCF 文件上生成一些统计信息。然后,我想使用plot-vcfstats 绘制生成的统计数据,同样来自 bcftools。但是,当我在我的 conda 环境中安装 bcftools 时,这个命令结果依赖于某些未安装的软件包。我运行plot-vcfstats时得到的输出:

Parsing bcftools stats output: test.txt
Plotting graphs: python3 plot.py
Traceback (most recent call last):
  File "plot.py", line 54, in <module>
    import matplotlib as mpl
ModuleNotFoundError: No module named 'matplotlib'
The command exited with non-zero status 256:
        python3 plot.py

matplotlib 可以很容易地使用 conda 安装,所以我这样做了,但随后出现以下错误:

Parsing bcftools stats output: test.txt
Plotting graphs: python3 plot.py
Neither pdflatex or tectonic were found in your PATH, impossible to create a PDF at /home/nick/miniconda3/envs/variantcallingpipeline/bin/plot-vcfstats line 112.
        main::error("Neither pdflatex or tectonic were found in your PATH, impossi"...) called at /home/nick/miniconda3/envs/variantcallingpipeline/bin/plot-vcfstats line 1934
        main::create_pdf(HASH(0x7fffc2f047b0)) called at /home/nick/miniconda3/envs/variantcallingpipeline/bin/plot-vcfstats line 73

但是,我找不到安装 pdflatextectonic 依赖项的简单方法,甚至可能需要更多依赖项。所以,我想知道是否有一种简单的方法来安装plot-vcfstats(或任何工具)的所有必需依赖项,如果这一切都可以使用 conda。

编辑:我刚刚尝试通过以下方式安装pdflatextectonic

conda install -c conda-forge texlive-core

这将错误更改为:

Parsing bcftools stats output: test.txt
Plotting graphs: python3 plot.py
Note: The xcolor.sty package not available, black and white tables only...

Creating PDF: pdflatex summary.tex >plot-vcfstats.log 2>&1
The command exited with non-zero status, please consult the output of pdflatex: .plot-vcfstats.log

 at /home/nick/miniconda3/envs/test/bin/plot-vcfstats line 112.
        main::error("The command exited with non-zero status, please consult the o"...) called at /home/nick/miniconda3/envs/test/bin/plot-vcfstats line 2206
        main::create_pdf(HASH(0x7fffd8101f90)) called at /home/nick/miniconda3/envs/test/bin/plot-vcfstats line 73

日志文件包含以下内容:

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
 restricted \write18 enabled.

kpathsea: Running mktexfmt pdflatex.fmt
Can't locate mktexlsr.pl in @INC (@INC contains: /home/nick/miniconda3/envs/test/share/tlpkg /home/nick/miniconda3/envs/test/share/texmf-dist/scripts/texlive /home/nick/.t_coffee/perl/lib/perl5 /home/nick/.t_coffee/perl/lib/perl5 /home/nick/miniconda3/envs/test/lib/perl5/5.32/site_perl /home/nick/miniconda3/envs/test/lib/perl5/site_perl /home/nick/miniconda3/envs/test/lib/perl5/5.32/vendor_perl /home/nick/miniconda3/envs/test/lib/perl5/vendor_perl /home/nick/miniconda3/envs/test/lib/perl5/5.32/core_perl /home/nick/miniconda3/envs/test/lib/perl5/core_perl .) at /home/nick/miniconda3/envs/test/bin/mktexfmt line 23.
BEGIN failed--compilation aborted at /home/nick/miniconda3/envs/test/bin/mktexfmt line 25.
I can't find the format file `pdflatex.fmt'!

【问题讨论】:

    标签: python dependencies conda pdflatex bcftools


    【解决方案1】:

    看起来很乱。 this open issue 中的一些 cmets 暗示 Conda 的 texlive-core 已损坏,但并不清楚那里是否有权威回应。

    osx-64平台上,我可以获得半功能环境:

    mamba create -n vcfstats bcftools vcftools python matplotlib numpy tectonic
    

    然后运行,使用 test.vcf

    conda activate vcfstats
    
    bcftools stats test.vcf > test.vchk
    
    plot-vcfstats -p outdir test.vchk
    ## this fails with complaints about pdflatex, but continuing...
    
    cd outdir
    tectonic summary.tex
    ## then renders the pdf without issue
    

    失败对我来说可能是独一无二的,因为路径上有一个pdflatex,在/usr/local/bin/pdflatex 下,plot-vcfstats 代码优先考虑pdflatex(如果存在)。那就是它使用这个代码:

    my $engine = '';
    system('command -v pdflatex >/dev/null');
    if ($? == 0) { $engine = 'pdflatex'; }
    else
    {
       system('command -v tectonic >/dev/null');
       if ($? == 0) { $engine = 'tectonic'; }
    }
    

    对于在 PATH 上还没有 pdflatex 的用户,单独使用 Conda tectonic 包应该可以开箱即用。例如,这似乎是what Galaxy uses 在其容器中运行bcftools stats

    【讨论】:

    • 谢谢!像你说的那样创建环境并运行bcftools stats 然后运行plot-vcfstats 也导致我失败(根据日志文件,这是原因:! LaTeX Error: File multirow.sty not found.),但随后在输出目录中使用构造会呈现 . pdf。
    猜你喜欢
    • 2016-11-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-28
    相关资源
    最近更新 更多