a-h-b / dadasnake

Amplicon sequencing workflow heavily using DADA2 and implemented in snakemake
GNU General Public License v3.0
45 stars 17 forks source link

pygments.util.ClassNotFound: no lexer for alias None found - bug or documention #5

Closed osilander closed 3 years ago

osilander commented 4 years ago

Hi, I'm trying to do the test run and have successfully generated a workflow.done file but also get the errors / warnings below. The docs mention "Don't worry if you see a few warnings from mv, such as mv: cannot stat ‘slurm*’: No such file or directory" but these errors seem more extensive than just that? (below I've copied the output from a re-run of the snakemake, hence the "Nothing to be done." However, the error/warning outputs were identical in the first run). Also the report.html file is empty.

Cheers.

OS: 16.04.6 dadasnake installed via github clone.

(base) olin@gru:/scratch/olin/dadasnake$ ./dadasnake -l -n "TESTRUN" -r config/config.test.yaml
Running workflow in current session - don't use this setting except with small datasets.
Building DAG of jobs...
Nothing to be done.
Complete log: /scratch/olin/dadasnake/.snakemake/log/2020-06-17T104604.069252.snakemake.log
mv: cannot stat 'slurm*': No such file or directory
mv: cannot stat 'snakejob.*': No such file or directory
mv: cannot stat '*log': No such file or directory
mv: cannot stat '*logfile': No such file or directory
Building DAG of jobs...
Creating report...
Adding readNumbers.tsv (0.00037 MB).
Adding primerNumbers_perLibrary.tsv (0.00044 MB).
Adding primerNumbers_perSample.tsv (0.00039 MB).
Adding finalNumbers_perSample.tsv (0.00053 MB).
Adding QC_1.1.fwd.pdf (0.1 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_1.1.fwd.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_1.1.rvs.pdf (0.12 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_1.1.rvs.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_1.2.fwd.pdf (0.029 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_1.2.fwd.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_1.2.rvs.pdf (0.033 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_1.2.rvs.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_filtered.1.fwd.pdf (0.02 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_filtered.1.fwd.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_filtered.1.rvs.pdf (0.017 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_filtered.1.rvs.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_filtered.2.fwd.pdf (0.012 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_filtered.2.fwd.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_filtered.2.rvs.pdf (0.011 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_filtered.2.rvs.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding mergedNumbers_perLibrary.tsv (0.00055 MB).
Adding mergedNumbers_perSample.tsv (0.00047 MB).
Adding filteredNumbers_perLibrary.tsv (0.00052 MB).
Adding filteredNumbers_perSample.tsv (0.00045 MB).
Traceback (most recent call last):
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/report/__init__.py", line 224, in code
    lexer = get_lexer_by_name(language)
  File "/home/olin/miniconda3/lib/python3.7/site-packages/pygments/lexers/__init__.py", line 107, in get_lexer_by_name
    raise ClassNotFound('no lexer for alias %r found' % _alias)
pygments.util.ClassNotFound: no lexer for alias None found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/__init__.py", line 547, in snakemake
    export_cwl=export_cwl)
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/workflow.py", line 514, in execute
    auto_report(dag, report)
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/report/__init__.py", line 577, in auto_report
    pygments_css=HtmlFormatter(style="trac").get_style_defs('.source')))
  File "/home/olin/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/home/olin/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/home/olin/miniconda3/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/report/report.html", line 474, in top-level template code
    {{ rule.code()|safe }}
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/report/__init__.py", line 226, in code
    except pygments.utils.ClassNotFound:
NameError: name 'pygments' is not defined
(base) olin@gru:/scratch/olin/dadasnake$ ./dadasnake -l -n "TESTRUN" -r config/config.test.yaml
Running workflow in current session - don't use this setting except with small datasets.
Building DAG of jobs...
Nothing to be done.
Complete log: /scratch/olin/dadasnake/.snakemake/log/2020-06-17T104930.617740.snakemake.log
mv: cannot stat 'slurm*': No such file or directory
mv: cannot stat 'snakejob.*': No such file or directory
mv: cannot stat '*log': No such file or directory
mv: cannot stat '*logfile': No such file or directory
Building DAG of jobs...
Creating report...
Adding readNumbers.tsv (0.00037 MB).
Adding primerNumbers_perLibrary.tsv (0.00044 MB).
Adding primerNumbers_perSample.tsv (0.00039 MB).
Adding finalNumbers_perSample.tsv (0.00053 MB).
Adding QC_1.1.fwd.pdf (0.1 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_1.1.fwd.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_1.1.rvs.pdf (0.12 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_1.1.rvs.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_1.2.fwd.pdf (0.029 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_1.2.fwd.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_1.2.rvs.pdf (0.033 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_1.2.rvs.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_filtered.1.fwd.pdf (0.02 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_filtered.1.fwd.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_filtered.1.rvs.pdf (0.017 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_filtered.1.rvs.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_filtered.2.fwd.pdf (0.012 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_filtered.2.fwd.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding QC_filtered.2.rvs.pdf (0.011 MB).
Failed to convert image to png with imagemagick convert: b"convert: not authorized `stats/QC_filtered.2.rvs.pdf' @ error/constitute.c/ReadImage/412.\nconvert: no images defined `png:-' @ error/convert.c/ConvertImageCommand/3210.\n"
Adding mergedNumbers_perLibrary.tsv (0.00055 MB).
Adding mergedNumbers_perSample.tsv (0.00047 MB).
Adding filteredNumbers_perLibrary.tsv (0.00052 MB).
Adding filteredNumbers_perSample.tsv (0.00045 MB).
Traceback (most recent call last):
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/report/__init__.py", line 224, in code
    lexer = get_lexer_by_name(language)
  File "/home/olin/miniconda3/lib/python3.7/site-packages/pygments/lexers/__init__.py", line 107, in get_lexer_by_name
    raise ClassNotFound('no lexer for alias %r found' % _alias)
pygments.util.ClassNotFound: no lexer for alias None found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/__init__.py", line 547, in snakemake
    export_cwl=export_cwl)
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/workflow.py", line 514, in execute
    auto_report(dag, report)
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/report/__init__.py", line 577, in auto_report
    pygments_css=HtmlFormatter(style="trac").get_style_defs('.source')))
  File "/home/olin/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/home/olin/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/home/olin/miniconda3/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/report/report.html", line 474, in top-level template code
    {{ rule.code()|safe }}
  File "/home/olin/miniconda3/lib/python3.7/site-packages/snakemake/report/__init__.py", line 226, in code
    except pygments.utils.ClassNotFound:
NameError: name 'pygments' is not defined
a-h-b commented 4 years ago

Hi - thanks for the question. You're right - there's another error that comes from snakemake when it tries to build the report. Could you let me know which snakemake version you are using? -A

osilander commented 4 years ago

snakemake 5.5.4

a-h-b commented 4 years ago

You'd have to update snakemake to avoid the error. Alternatively, leave the -r out of the dadasnake command (so it will not make a report, but the workflow should run and produce the results).

a-h-b commented 3 years ago

I am closing this issue. The minimal snakemake version is mentioned in the documentation now.