robotoD / GenoVi

GenoVi, an automated customizable circular genome visualizer for bacteria and archaea
Other
86 stars 11 forks source link

Python errors in running GenoVi #5

Open iwilkie opened 1 year ago

iwilkie commented 1 year ago

Hi,

I was hoping to try out GenoVi to visualise a few of my genomes, but have run into an issue I was hoping you could help me with.

From what I can tell there seem to be two different issues, one is something related to the cairoSVG library, which doesn't seem to be a major issue, whereas the other one actually stops the run and seems to be related to with the GenoVi python script itself. Here's the command I submitted and the output:

$ genovi -i PROKKA_02082023.gbk -cs paradise -s complete --size --cogs_unclassified --title 'M30B9 sp.' --title_position top --italic_words 1 -te

There's been an error finding cairoSVG library, so PNG images might be different from expected. Please prefer using SVG output.
/Users/iwilkie/opt/anaconda3/envs/genovi/lib/python3.7/site-packages/Bio/GenBank/Scanner.py:1219: BiopythonParserWarning: Premature end of file in sequence data
  "Premature end of file in sequence data", BiopythonParserWarning
genovi-temp/contig_1-genovi_bands.kar created succesfully.
genovi-temp/contig_1-genovi_tRNA_pos.txt created succesfully.
genovi-temp/contig_1-genovi_tRNA_neg.txt created succesfully.
genovi-temp/contig_1-genovi_rRNA_pos.txt created succesfully.
genovi-temp/contig_1-genovi_rRNA_neg.txt created succesfully.
genovi-temp/contig_1-genovi_CDS_pos.txt created succesfully.
genovi-temp/contig_1-genovi_CDS_neg.txt created succesfully.
Transforming GenBank record LBDLHKHK_1 to .fna
Done
Drawing 1...
Traceback (most recent call last):
  File "/Users/iwilkie/opt/anaconda3/envs/genovi/bin/genovi", line 8, in <module>
    sys.exit(main())
  File "/Users/iwilkie/opt/anaconda3/envs/genovi/lib/python3.7/site-packages/scripts/GenoVi.py", line 685, in main
    visualiseGenome(*get_args())
  File "/Users/iwilkie/opt/anaconda3/envs/genovi/lib/python3.7/site-packages/scripts/GenoVi.py", line 414, in visualiseGenome
    pCDS_colour = CDS_positive, nCDS_colour = CDS_negative, tRNA_colour = tRNA, rRNA_colour = rRNA, GC_content_colour = GC_content, font_colour = font_colour)
  File "/Users/iwilkie/opt/anaconda3/envs/genovi/lib/python3.7/site-packages/scripts/addText.py", line 52, in addText
    source = open(inFile)
FileNotFoundError: [Errno 2] No such file or directory: 'genovi/genovi.svg'

Would you happen to have any recommendations for how to fix/avoid this issue, and how to go forward?

I really appreciate any help you can provide, thanks in advance!

iwilkie commented 1 year ago

For reference I just installed GenoVi in a fresh environment right before testing it:

Setup of the environment and GenoVi installation (very long) ```bash $ conda config --add channels bioconda $ conda create -n genovi python=3.7 circos Collecting package metadata (current_repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 22.9.0 latest version: 23.3.1 Please update conda by running $ conda update -n base -c conda-forge conda ## Package Plan ## environment location: /Users/iwilkie/opt/anaconda3/envs/genovi added / updated specs: - circos - python=3.7 The following NEW packages will be INSTALLED: ca-certificates conda-forge/osx-64::ca-certificates-2022.12.7-h033912b_0 None circos bioconda/noarch::circos-0.69.9-hdfd78af_0 None expat conda-forge/osx-64::expat-2.5.0-hf0c8a7f_1 None font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0 None font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0 None font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0 None font-ttf-ubuntu conda-forge/noarch::font-ttf-ubuntu-0.83-hab24e00_0 None fontconfig conda-forge/osx-64::fontconfig-2.14.2-h5bb23bf_0 None fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0 None fonts-conda-forge conda-forge/noarch::fonts-conda-forge-1-0 None freetype conda-forge/osx-64::freetype-2.12.1-h3f81eb7_1 None giflib conda-forge/osx-64::giflib-5.2.1-hb7f2c08_3 None icu conda-forge/osx-64::icu-72.1-h7336db1_0 None lerc conda-forge/osx-64::lerc-4.0.0-hb486fe8_0 None libcxx conda-forge/osx-64::libcxx-16.0.0-h71dddab_0 None libdeflate conda-forge/osx-64::libdeflate-1.18-hac1461d_0 None libexpat conda-forge/osx-64::libexpat-2.5.0-hf0c8a7f_1 None libffi conda-forge/osx-64::libffi-3.4.2-h0d85af4_5 None libgd conda-forge/osx-64::libgd-2.3.3-h3d994df_6 None libiconv conda-forge/osx-64::libiconv-1.17-hac89ed1_0 None libjpeg-turbo conda-forge/osx-64::libjpeg-turbo-2.1.5.1-hb7f2c08_0 None libpng conda-forge/osx-64::libpng-1.6.39-ha978bb4_0 None libsqlite conda-forge/osx-64::libsqlite-3.40.0-ha978bb4_0 None libtiff conda-forge/osx-64::libtiff-4.5.0-hedf67fa_6 None libwebp conda-forge/osx-64::libwebp-1.3.0-ha9aa8fa_0 None libwebp-base conda-forge/osx-64::libwebp-base-1.3.0-hb7f2c08_0 None libzlib conda-forge/osx-64::libzlib-1.2.13-hfd90126_4 None ncurses conda-forge/osx-64::ncurses-6.3-h96cf925_1 None openssl conda-forge/osx-64::openssl-3.1.0-hfd90126_0 None perl conda-forge/osx-64::perl-5.32.1-2_h0d85af4_perl5 None perl-b-cow conda-forge/osx-64::perl-b-cow-0.007-pl5321hb7f2c08_0 None perl-carp bioconda/noarch::perl-carp-1.38-pl5321hdfd78af_4 None perl-clone bioconda/osx-64::perl-clone-0.46-pl5321h1e3017b_0 None perl-config-gener~ bioconda/noarch::perl-config-general-2.65-pl5321hdfd78af_0 None perl-digest-perl-~ bioconda/noarch::perl-digest-perl-md5-1.9-pl5321hdfd78af_2 None perl-exporter bioconda/noarch::perl-exporter-5.72-pl5321hdfd78af_2 None perl-exporter-tiny bioconda/noarch::perl-exporter-tiny-1.002002-pl5321hdfd78af_0 None perl-extutils-mak~ conda-forge/noarch::perl-extutils-makemaker-7.70-pl5321hd8ed1ab_0 None perl-font-ttf bioconda/noarch::perl-font-ttf-1.06-pl5321hdfd78af_1 None perl-gd bioconda/osx-64::perl-gd-2.76-pl5321hb8176d5_1 None perl-io-string bioconda/noarch::perl-io-string-1.08-pl5321hdfd78af_4 None perl-list-moreuti~ bioconda/noarch::perl-list-moreutils-0.430-pl5321hdfd78af_0 None perl-list-moreuti~ bioconda/osx-64::perl-list-moreutils-xs-0.430-pl5321ha5712d3_1 None perl-math-bezier bioconda/noarch::perl-math-bezier-0.01-pl5321hdfd78af_2 None perl-math-round bioconda/noarch::perl-math-round-0.07-pl5321hdfd78af_2 None perl-math-vecstat bioconda/noarch::perl-math-vecstat-0.08-pl5321hdfd78af_2 None perl-module-imple~ bioconda/noarch::perl-module-implementation-0.09-pl5321hdfd78af_3 None perl-module-runti~ bioconda/noarch::perl-module-runtime-0.016-pl5321hdfd78af_2 None perl-number-format bioconda/noarch::perl-number-format-1.75-pl5321hdfd78af_4 None perl-params-valid~ bioconda/osx-64::perl-params-validate-1.31-pl5321h1e3017b_0 None perl-pathtools bioconda/osx-64::perl-pathtools-3.75-pl5321ha5712d3_3 None perl-readonly bioconda/noarch::perl-readonly-2.05-pl5321hdfd78af_1 None perl-regexp-common bioconda/noarch::perl-regexp-common-2017060201-pl5321hdfd78af_1 None perl-scalar-list-~ bioconda/osx-64::perl-scalar-list-utils-1.62-pl5321ha5712d3_0 None perl-set-intspan bioconda/noarch::perl-set-intspan-1.19-pl5321hdfd78af_2 None perl-statistics-b~ bioconda/noarch::perl-statistics-basic-1.6611-pl5321hdfd78af_3 None perl-svg bioconda/noarch::perl-svg-2.87-pl5321hdfd78af_0 None perl-test-fatal bioconda/noarch::perl-test-fatal-0.016-pl5321hdfd78af_0 None perl-text-format bioconda/noarch::perl-text-format-0.62-pl5321hdfd78af_0 None perl-time-hires bioconda/osx-64::perl-time-hires-1.9764-pl5321ha5712d3_2 None perl-try-tiny bioconda/noarch::perl-try-tiny-0.31-pl5321hdfd78af_1 None perl-xml-parser bioconda/osx-64::perl-xml-parser-2.44-pl5321h50c80e2_8 None pip conda-forge/noarch::pip-23.0.1-pyhd8ed1ab_0 None python conda-forge/osx-64::python-3.7.12-hf3644f1_100_cpython None readline conda-forge/osx-64::readline-8.2-h9e318b2_1 None setuptools conda-forge/noarch::setuptools-67.6.1-pyhd8ed1ab_0 None sqlite conda-forge/osx-64::sqlite-3.40.0-h9ae0607_0 None tk conda-forge/osx-64::tk-8.6.12-h5dbffcc_0 None wheel conda-forge/noarch::wheel-0.40.0-pyhd8ed1ab_0 None xz conda-forge/osx-64::xz-5.2.6-h775f41a_0 None zlib conda-forge/osx-64::zlib-1.2.13-hfd90126_4 None zstd conda-forge/osx-64::zstd-1.5.2-hbc0c0cd_6 None Proceed ([y]/n)? y Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate genovi # # To deactivate an active environment, use # # $ conda deactivate Retrieving notices: ...working... done $conda activate genovi $ pip install genovi Collecting genovi Using cached genovi-0.4.3-py3-none-any.whl Collecting Pillow Using cached Pillow-9.5.0-cp37-cp37m-macosx_10_10_x86_64.whl (3.4 MB) Collecting BioPython>=1.79 Using cached biopython-1.81-cp37-cp37m-macosx_10_9_x86_64.whl (2.7 MB) Collecting natsort>=8.2.0 Using cached natsort-8.3.1-py3-none-any.whl (38 kB) Collecting deepnog>=1.2.3 Using cached deepnog-1.2.3-py3-none-any.whl (67 kB) Collecting matplotlib>=3.5.2 Using cached matplotlib-3.5.3-cp37-cp37m-macosx_10_9_x86_64.whl (7.3 MB) Collecting tqdm>=4.35.0 Using cached tqdm-4.65.0-py3-none-any.whl (77 kB) Collecting cairosvg>=2.5.2 Using cached CairoSVG-2.7.0-py3-none-any.whl (43 kB) Collecting torch>=1.2.0 Using cached torch-1.13.1-cp37-none-macosx_10_9_x86_64.whl (135.3 MB) Collecting seaborn>=0.12 Using cached seaborn-0.12.2-py3-none-any.whl (293 kB) Collecting argparse Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB) Collecting numpy>=1.20.2 Using cached numpy-1.21.6-cp37-cp37m-macosx_10_9_x86_64.whl (16.9 MB) Collecting scikit-learn Using cached scikit_learn-1.0.2-cp37-cp37m-macosx_10_13_x86_64.whl (7.8 MB) Collecting pandas>=1.2.4 Using cached pandas-1.3.5-cp37-cp37m-macosx_10_9_x86_64.whl (11.0 MB) Collecting cssselect2 Using cached cssselect2-0.7.0-py3-none-any.whl (15 kB) Collecting tinycss2 Using cached tinycss2-1.2.1-py3-none-any.whl (21 kB) Collecting cairocffi Using cached cairocffi-1.5.0-py3-none-any.whl Collecting defusedxml Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB) Collecting tensorboard Using cached tensorboard-2.11.2-py3-none-any.whl (6.0 MB) Collecting PyYAML Using cached PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl (189 kB) Collecting fonttools>=4.22.0 Using cached fonttools-4.38.0-py3-none-any.whl (965 kB) Collecting cycler>=0.10 Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB) Collecting pyparsing>=2.2.1 Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB) Collecting kiwisolver>=1.0.1 Using cached kiwisolver-1.4.4-cp37-cp37m-macosx_10_9_x86_64.whl (65 kB) Collecting packaging>=20.0 Using cached packaging-23.0-py3-none-any.whl (42 kB) Collecting python-dateutil>=2.7 Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Collecting pytz>=2017.3 Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB) Collecting typing_extensions Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB) Collecting joblib>=0.11 Using cached joblib-1.2.0-py3-none-any.whl (297 kB) Collecting scipy>=1.1.0 Using cached scipy-1.7.3-cp37-cp37m-macosx_10_9_x86_64.whl (33.0 MB) Collecting threadpoolctl>=2.0.0 Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB) Collecting six>=1.5 Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting cffi>=1.1.0 Using cached cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl (178 kB) Collecting webencodings Using cached webencodings-0.5.1-py2.py3-none-any.whl (11 kB) Collecting google-auth<3,>=1.6.3 Using cached google_auth-2.17.2-py2.py3-none-any.whl (178 kB) Requirement already satisfied: setuptools>=41.0.0 in /Users/iwilkie/opt/anaconda3/envs/genovi/lib/python3.7/site-packages (from tensorboard->deepnog>=1.2.3->genovi) (67.6.1) Collecting absl-py>=0.4 Using cached absl_py-1.4.0-py3-none-any.whl (126 kB) Collecting tensorboard-plugin-wit>=1.6.0 Using cached tensorboard_plugin_wit-1.8.1-py3-none-any.whl (781 kB) Collecting google-auth-oauthlib<0.5,>=0.4.1 Using cached google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB) Collecting grpcio>=1.24.3 Using cached grpcio-1.53.0-cp37-cp37m-macosx_10_10_universal2.whl (8.5 MB) Collecting requests<3,>=2.21.0 Using cached requests-2.28.2-py3-none-any.whl (62 kB) Collecting tensorboard-data-server<0.7.0,>=0.6.0 Using cached tensorboard_data_server-0.6.1-py3-none-macosx_10_9_x86_64.whl (3.5 MB) Collecting werkzeug>=1.0.1 Using cached Werkzeug-2.2.3-py3-none-any.whl (233 kB) Collecting markdown>=2.6.8 Using cached Markdown-3.4.3-py3-none-any.whl (93 kB) Collecting protobuf<4,>=3.9.2 Using cached protobuf-3.20.3-cp37-cp37m-macosx_10_9_x86_64.whl (981 kB) Requirement already satisfied: wheel>=0.26 in /Users/iwilkie/opt/anaconda3/envs/genovi/lib/python3.7/site-packages (from tensorboard->deepnog>=1.2.3->genovi) (0.40.0) Collecting pycparser Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB) Collecting rsa<5,>=3.1.4 Using cached rsa-4.9-py3-none-any.whl (34 kB) Collecting cachetools<6.0,>=2.0.0 Using cached cachetools-5.3.0-py3-none-any.whl (9.3 kB) Collecting pyasn1-modules>=0.2.1 Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB) Collecting requests-oauthlib>=0.7.0 Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB) Collecting importlib-metadata>=4.4 Using cached importlib_metadata-6.1.0-py3-none-any.whl (21 kB) Collecting urllib3<1.27,>=1.21.1 Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB) Collecting idna<4,>=2.5 Using cached idna-3.4-py3-none-any.whl (61 kB) Collecting certifi>=2017.4.17 Using cached certifi-2022.12.7-py3-none-any.whl (155 kB) Collecting charset-normalizer<4,>=2 Using cached charset_normalizer-3.1.0-cp37-cp37m-macosx_10_9_x86_64.whl (121 kB) Collecting MarkupSafe>=2.1.1 Using cached MarkupSafe-2.1.2-cp37-cp37m-macosx_10_9_x86_64.whl (13 kB) Collecting zipp>=0.5 Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB) Collecting pyasn1<0.5.0,>=0.4.6 Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB) Collecting oauthlib>=3.0.0 Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB) Installing collected packages: webencodings, tensorboard-plugin-wit, pytz, pyasn1, argparse, zipp, urllib3, typing_extensions, tqdm, tinycss2, threadpoolctl, tensorboard-data-server, six, rsa, PyYAML, pyparsing, pycparser, pyasn1-modules, protobuf, Pillow, packaging, oauthlib, numpy, natsort, MarkupSafe, joblib, idna, grpcio, fonttools, defusedxml, cycler, charset-normalizer, certifi, cachetools, absl-py, werkzeug, torch, scipy, requests, python-dateutil, kiwisolver, importlib-metadata, google-auth, cssselect2, cffi, BioPython, scikit-learn, requests-oauthlib, pandas, matplotlib, markdown, cairocffi, seaborn, google-auth-oauthlib, cairosvg, tensorboard, deepnog, genovi Successfully installed BioPython-1.81 MarkupSafe-2.1.2 Pillow-9.5.0 PyYAML-6.0 absl-py-1.4.0 argparse-1.4.0 cachetools-5.3.0 cairocffi-1.5.0 cairosvg-2.7.0 certifi-2022.12.7 cffi-1.15.1 charset-normalizer-3.1.0 cssselect2-0.7.0 cycler-0.11.0 deepnog-1.2.3 defusedxml-0.7.1 fonttools-4.38.0 genovi-0.4.3 google-auth-2.17.2 google-auth-oauthlib-0.4.6 grpcio-1.53.0 idna-3.4 importlib-metadata-6.1.0 joblib-1.2.0 kiwisolver-1.4.4 markdown-3.4.3 matplotlib-3.5.3 natsort-8.3.1 numpy-1.21.6 oauthlib-3.2.2 packaging-23.0 pandas-1.3.5 protobuf-3.20.3 pyasn1-0.4.8 pyasn1-modules-0.2.8 pycparser-2.21 pyparsing-3.0.9 python-dateutil-2.8.2 pytz-2023.3 requests-2.28.2 requests-oauthlib-1.3.1 rsa-4.9 scikit-learn-1.0.2 scipy-1.7.3 seaborn-0.12.2 six-1.16.0 tensorboard-2.11.2 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 threadpoolctl-3.1.0 tinycss2-1.2.1 torch-1.13.1 tqdm-4.65.0 typing_extensions-4.5.0 urllib3-1.26.15 webencodings-0.5.1 werkzeug-2.2.3 zipp-3.15.0 ```

After setting up the environment and installing GenoVi, I tested it via GenoVi --help which returned the normal help page with no issues/errors/comments.

vsaona commented 1 year ago

Hi, this error probable means Circos could not generate the initial SVG image, because the input files didn't have expected format.

Is it possible for you to send me the Prokka-generated file you are using? Of course, it will be treated with strict confidentiality, used only for debugging purposes and deleted right afterwards. If not possible, I would like to know if it has any special characteristics. Does it have one or more replicons? Are there replicons with no coding sequences? Is there anything special in this file?

Also, do the test cases work properly on your computer? It would be interesting to run test cases or some other GenBank file to fully check it is not a problem in your environment.

iwilkie commented 1 year ago

Hi @vsaona, thanks for the reply!

I've since tried a couple of things to no avail, but I think the issue might be the environment itself. Based on the error I was getting when I tried to run my file, I thought it might be a dependency issue, so I installed cairosvg in the environment.

Installing `cairosvg` in the `genovi` environment (genovi) iwilkie@bigmem-3:~$ conda install -c conda-forge cairosvg Collecting package metadata (current_repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 4.14.0 latest version: 23.3.1 Please update conda by running $ conda update -n base -c conda-forge conda ## Package Plan ## environment location: /home/iwilkie/miniconda3/envs/genovi added / updated specs: - cairosvg The following packages will be downloaded: package | build ---------------------------|----------------- cairo-1.16.0 | hb05425b_4 1.4 MB cairocffi-1.4.0 | pyhd8ed1ab_0 69 KB conda-forge cairosvg-2.6.0 | pyhd8ed1ab_0 42 KB conda-forge cssselect2-0.2.1 | pyh9f0ad1d_1 30 KB conda-forge defusedxml-0.7.1 | pyhd8ed1ab_0 23 KB conda-forge glib-2.69.1 | he621ea3_2 1.9 MB lcms2-2.12 | h3be6417_0 312 KB libwebp-1.2.4 | h11a3e52_1 86 KB pillow-9.4.0 | py37h6a678d5_0 721 KB python_abi-3.7 | 2_cp37m 4 KB conda-forge tinycss2-1.2.1 | pyhd8ed1ab_0 23 KB conda-forge webencodings-0.5.1 | py_1 12 KB conda-forge ------------------------------------------------------------ Total: 4.6 MB The following NEW packages will be INSTALLED: cairo pkgs/main/linux-64::cairo-1.16.0-hb05425b_4 cairocffi conda-forge/noarch::cairocffi-1.4.0-pyhd8ed1ab_0 cairosvg conda-forge/noarch::cairosvg-2.6.0-pyhd8ed1ab_0 cffi conda-forge/linux-64::cffi-1.15.0-py37h036bc23_0 cssselect2 conda-forge/noarch::cssselect2-0.2.1-pyh9f0ad1d_1 defusedxml conda-forge/noarch::defusedxml-0.7.1-pyhd8ed1ab_0 giflib conda-forge/linux-64::giflib-5.2.1-h36c2ea0_2 glib pkgs/main/linux-64::glib-2.69.1-he621ea3_2 lcms2 pkgs/main/linux-64::lcms2-2.12-h3be6417_0 libwebp pkgs/main/linux-64::libwebp-1.2.4-h11a3e52_1 libxcb pkgs/main/linux-64::libxcb-1.15-h7f8727e_0 pcre conda-forge/linux-64::pcre-8.45-h9c3ff4c_0 pillow pkgs/main/linux-64::pillow-9.4.0-py37h6a678d5_0 pixman conda-forge/linux-64::pixman-0.40.0-h36c2ea0_0 pycparser conda-forge/noarch::pycparser-2.21-pyhd8ed1ab_0 python_abi conda-forge/linux-64::python_abi-3.7-2_cp37m tinycss2 conda-forge/noarch::tinycss2-1.2.1-pyhd8ed1ab_0 webencodings conda-forge/noarch::webencodings-0.5.1-py_1 The following packages will be SUPERSEDED by a higher-priority channel: ca-certificates pkgs/main::ca-certificates-2023.01.10~ --> conda-forge::ca-certificates-2022.12.7-ha878542_0 certifi pkgs/main/linux-64::certifi-2022.12.7~ --> conda-forge/noarch::certifi-2022.12.7-pyhd8ed1ab_0 Proceed ([y]/n)? y Downloading and Extracting Packages lcms2-2.12 | 312 KB | ########################################################################################################################################### | 100% libwebp-1.2.4 | 86 KB | ########################################################################################################################################### | 100% defusedxml-0.7.1 | 23 KB | ########################################################################################################################################### | 100% cssselect2-0.2.1 | 30 KB | ########################################################################################################################################### | 100% cairo-1.16.0 | 1.4 MB | ########################################################################################################################################### | 100% cairocffi-1.4.0 | 69 KB | ########################################################################################################################################### | 100% cairosvg-2.6.0 | 42 KB | ########################################################################################################################################### | 100% python_abi-3.7 | 4 KB | ########################################################################################################################################### | 100% glib-2.69.1 | 1.9 MB | ########################################################################################################################################### | 100% tinycss2-1.2.1 | 23 KB | ########################################################################################################################################### | 100% webencodings-0.5.1 | 12 KB | ########################################################################################################################################### | 100% pillow-9.4.0 | 721 KB | ########################################################################################################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done Retrieving notices: ...working... done

I then ran the same command that I initially ran (shown in the first message of this issue), but got the same error.

Next, I ran the test case (I should've started here, I know, but I only spotted the file afterwards), which worked! I then ran the same command as the test case but with my own file (genovi -i ../03.function/prokka/PROKKA_02082023.gbk -s draft -cs paradise --cogs_unclassified -bc white), which also worked :)

I then started adding flags I had initially tried, one try at a time, to figure out which one was causing the issue, and it seems to be related to the --title_position top flag. Since genovi generates svg files I don't really mind, but I thought I'd let you know.

Here's the output if I run the same command I was trying when I came across the error, except without the --title_position top flag (it works!):

(genovi) iwilkie@bigmem-3:/hpc-stage/iwilkie/isolate/06.genovi$ ls
(genovi) iwilkie@bigmem-3:/hpc-stage/iwilkie/isolate/06.genovi$ genovi -i ../03.function/prokka/PROKKA_02082023.gbk -cs paradise -s complete --size --cogs_unclassified --title 'M30B9 sp.' --italic_words 1 -te
/home/iwilkie/miniconda3/envs/genovi/lib/python3.7/site-packages/Bio/GenBank/Scanner.py:1219: BiopythonParserWarning: Premature end of file in sequence data
  "Premature end of file in sequence data", BiopythonParserWarning
genovi-temp/contig_1-genovi_bands.kar created succesfully.
genovi-temp/contig_1-genovi_tRNA_pos.txt created succesfully.
genovi-temp/contig_1-genovi_tRNA_neg.txt created succesfully.
genovi-temp/contig_1-genovi_rRNA_pos.txt created succesfully.
genovi-temp/contig_1-genovi_rRNA_neg.txt created succesfully.
genovi-temp/contig_1-genovi_CDS_pos.txt created succesfully.
genovi-temp/contig_1-genovi_CDS_neg.txt created succesfully.
Transforming GenBank record LBDLHKHK_1 to .fna
Done
Drawing 1...
Converting to png...
Converting to png...

WARNING! PNG version of image may look weird because italic text transformation is not yet properly implemented.
Please prefer using the svg version instead.

deleting temporary files
(genovi) iwilkie@bigmem-3:/hpc-stage/iwilkie/isolate/06.genovi$ ls *
circos.svg

genovi:
genovi.png  genovi.svg  genovi-contig_1.png  genovi-contig_1.svg  genovi_Gral_Stats.csv

Thanks again for commenting, unfortunately I am not at liberty to share the gbk file I am working with, but let me know if you want me to try anything else to try and narrow down this problem further (e.g. sharing the yml file of the environment?)

jsleavit commented 1 year ago

I am having the same issue described above. I tried running the test case on a gbk file downloaded from the test genomes available here in this repository, and still get the same error. I tried installing cairosvg, but to no avail, the same error occurs. Might there be another solution?

Svnipni commented 1 year ago

I think Im having a similar albeit it different issue. Genovi seems to get stuck on my specific .gbk as it worked out of the box for a few of my other files. Sadly, this file in particular is one I especially wanted to see.

Here's the output:

....
Transforming Genbank record SAMPLE_542_3532 to .fna
Done
Drawing...
Converting to png...
Traceback (most recent call last):
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/xml/etree/ElementTree.py", line 1716, in close
    self.parser.Parse(b"", True) # end of data
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
xml.parsers.expat.ExpatError: no element found: line 3, column 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/svni/mambaforge/envs/genovi/bin/genovi", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/site-packages/scripts/GenoVi.py", line 685, in main
    visualiseGenome(*get_args())
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/site-packages/scripts/GenoVi.py", line 594, in visualiseGenome
    svg2png(bytestring = file.read(), write_to = output_file + "/" + output_file + ".png")
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/site-packages/cairosvg/__init__.py", line 55, in svg2png
    return surface.PNGSurface.convert(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/site-packages/cairosvg/surface.py", line 129, in convert
    tree = Tree(
           ^^^^^
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/site-packages/cairosvg/parser.py", line 390, in __init__
    tree = ElementTree.fromstring(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/site-packages/defusedxml/common.py", line 127, in fromstring
    return parser.close()
           ^^^^^^^^^^^^^^
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/xml/etree/ElementTree.py", line 1718, in close
    self._raiseerror(v)
  File "/home/svni/mambaforge/envs/genovi/lib/python3.11/xml/etree/ElementTree.py", line 1618, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: no element found: line 3, column 0

There seems to be a sudden end to my file? I'm not certain how to decipher this or how I could fix my .gbk file. Any help would be much appreciated.

Edit: The .gbk file that did work had considerably fewer contigs. 56 total, as opposed to the above 3532... So that was the culprit. Re-assembly from raw-reads and more stringent coverage parameters resulted in a new assembly with only 53 contigs and genovi worked!

microbemarsh commented 9 months ago

Same here, I really don't want to have to reassemble to visualize