gecrooks / weblogo

WebLogo 3: Sequence Logos redrawn
weblogo.threeplusone.com
Other
146 stars 39 forks source link

Many output options not working plus line artefacts in PNG #155

Closed MarttiT closed 11 months ago

MarttiT commented 1 year ago

Thanks for providing the great service with sequence logos. I'm a fan and have used Berkely weblogo for my research work and publications for years.

In the past few day I've been trying with several different MSAs at https://weblogo.threeplusone.com/, and I can only get the result shown in low-res PNG, JPEG, or EPS . In PNG and JPEG the images have flaws, horizontal lines across the lower part of the letter stacks (image attached). The three failing modes (hi-res PNG, PDF, SVG) give a wall of error messages like this one (from a pdf attempt):

ERROR: Unrecoverable error : Ghostscript conversion failed (Invalid postscript?). /usr/bin/gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -sstdout=%stderr -dColorConversionStrategy=/LeaveColorUnchanged -sOutputFile=- -dDEVICEWIDTHPOINTS=470 -dDEVICEHEIGHTPOINTS=640 -dSAFER -dNOPAUSE -r300 - Return code: 1 b"GPL Ghostscript 10.0.0 (2022-09-21)\nCopyright (C) 2022 Artifex Software, Inc. All rights reserved.\nThis software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:\nsee the file COPYING for details.\nQuerying operating system for font files...\nCan't find (or can't open) font file %rom%Resource/Font/%rom%Re.\nCan't find (or can't open) font file ArialMT.\nDidn't find this font on the system!\nSubstituting font Helvetica for ArialMT.\nLoading NimbusSans-Regular font from %rom%Resource/Font/NimbusSans-Regular... 4735392 3304669 1888848 585120 2 done.\nCan't find (or can't open) font file %rom%Resource/Font/%rom%Resourc.\nCan't find (or can't open) font file Arial-BoldMT.\nDidn't find this font on the system!\nSubstituting font Helvetica-Bold for Arial-BoldMT.\nLoading NimbusSans-Bold font from %rom%Resource/Font/NimbusSans-Bold... 4801472 3484878 1929248 624666 2 done.\nLoading NimbusMonoPS-Regular font from %rom%Resource/Font/NimbusMonoPS-Regular... 5029152 3716777 1969648 646102 2 done.\nError: /unknownerror in --.FAPIBuildChar--\nOperand stack:\n --dict:17/19(ro)(G)-- 78\nExecution stack:\n %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1974 1 3 %oparray_pop 1973 1 3 %oparray_pop 1972 1 3 %oparray_pop --nostringval-- 1961 1 3 %oparray_pop 1817 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %finish_show --nostringval-- --nostringval-- 11 3 0 --nostringval-- (gs_show_enum) %op_show_continue\nDictionary stack:\n --dict:771/1123(ro)(G)-- --dict:0/20(G)-- --dict:194/200(L)--\nCurrent allocation mode is local\nLast OS error: Permission denied\nGPL Ghostscript 10.00.0: Unrecoverable error, exit code 1\n"

I managed to get perfect pdf output on Dec 16th (example attached). The horizontal line artifacts were there between Nov 14th and 18th in PNG, and with fewer/thinner lines then.

Luckily the EPS output was clean this time so I got my results out, but for convenience I hope the other options will become usable at some point.

ca5 non-fish 52 seqlogo ca5a mam 80 seqlogo.pdf

gecrooks commented 1 year ago

Rats, I hoped I'd fixed this problem.

WebLogo generates postscript (eps) internally, and then uses Ghostscript to covert the postscript to other formats. Alas some recent version of Ghostscript started generating spurious lines and symbols. I thought that upgrading to Ghostscript version 10 would fix the problems, but apparently not.

I'll have another go, but this may not be easy to fix. It could be that Ghostscript is broken or it could be that WebLogo is generating invalid postscript which is causing these issue to show up. Either way, debugging postscript issues is not fun.

The workaround for now is (as you found) to download the eps and do the conversion locally. My mac for example seems to have no issues with WebLogo's eps files.

Bingbing19 commented 1 year ago

Hi, I saw the same problem when I tried get the output with bits as unit and in pdf format. It does not have problem when I tried the unit with "probability". I am in Weblogo 3.7.12 and download the eps and do the conversion locally seems solved the problem. Here is the error: ERROR: Unrecoverable error : Ghostscript conversion failed (Invalid postscript?). /usr/bin/gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -sstdout=%stderr -dColorConversionStrategy=/LeaveColorUnchanged -sOutputFile=- -dDEVICEWIDTHPOINTS=275 -dDEVICEHEIGHTPOINTS=80 -dSAFER -dNOPAUSE -r300 - Return code: 1 b"GPL Ghostscript 10.0.0 (2022-09-21)\nCopyright (C) 2022 Artifex Software, Inc. All rights reserved.\nThis software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:\nsee the file COPYING for details.\nQuerying operating system for font files...\nCan't find (or can't open) font file %rom%Resource/Font/%rom%Re.\nCan't find (or can't open) font file ArialMT.\nDidn't find this font on the system!\nSubstituting font Helvetica for ArialMT.\nLoading NimbusSans-Regular font from %rom%Resource/Font/NimbusSans-Regular... 4735392 3304668 1888848 585118 2 done.\nCan't find (or can't open) font file %rom%Resource/Font/%rom%Resourc.\nCan't find (or can't open) font file Arial-BoldMT.\nDidn't find this font on the system!\nSubstituting font Helvetica-Bold for Arial-BoldMT.\nLoading NimbusSans-Bold font from %rom%Resource/Font/NimbusSans-Bold... 4801472 3484877 1929248 623593 2 done.\nError: /unknownerror in --.FAPIBuildChar--\nOperand stack:\n --dict:17/19(ro)(G)-- 67\nExecution stack:\n %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1974 1 3 %oparray_pop 1973 1 3 %oparray_pop 1972 1 3 %oparray_pop --nostringval-- 1961 1 3 %oparray_pop 1817 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %finish_show --nostringval-- --nostringval-- 11 3 0 --nostringval-- (gs_show_enum) %op_show_continue\nDictionary stack:\n --dict:771/1123(ro)(G)-- --dict:0/20(G)-- --dict:194/200(L)--\nCurrent allocation mode is local\nLast OS error: Permission denied\nGPL Ghostscript 10.00.0: Unrecoverable error, exit code 1\n"

gecrooks commented 1 year ago

Update: This issue remains mysterious. Problems persist irrespective of which version of WebLogo or Ghostscript I install, but only on the AWS server. My mac laptop is fine. I suspect something changed on AWS, but don't currently know what, why, or when.

In the mean time, I have disabled generating anything but eps on weblogo.threeplusone.com. Better correct eps than randomly misrendered pdf or png.

go-bears commented 1 year ago

ouch that sound like it could be a culprit. maybe the base server got upgraded and ghostscript hasn't caught up with that. Is it being hosted on centos or ubuntu? or vice versa?

gecrooks commented 1 year ago

Centos. So one possible next step is to spin up an ubuntu aws instance, and see if the same problem persists.

go-bears commented 1 year ago

agree! centos is fussy.

gecrooks commented 11 months ago

Issue has been fixed, I hope. The problem appears to have been that the ArialMT font was not installed, so ghostscript was trying substitute some other font.

betteridiot commented 9 months ago

I know that this issue is marked "closed," but it appears that by happenstance, I might have been able to pinpoint a working version of ghostscript that would prevent this issue...since it still exists.

For context, I am a package author that wrote a simplified wrapper for WebLogo so as to constrain the power of WebLogo for a pared down use in a classroom environment.

Just recently, one of the courses that uses my package for demonstrating sequence logos put in an issue of exactly the same thing as above. They installed the most up-to-date version of ghostscript (10.02.01; via conda-forge) alongside WebLogo, but it came up with the same errors as mentioned by the OP. However, when I created a virtual environment to test the issue, I installed everything via Bioconda and everything worked fine. Turns out that the Bioconda version of ghostscript is pinned to 9.18.

Strangely, when my end-users dictated the size of the image to be "large", the issue went away.

gecrooks commented 8 months ago

Thanks, that's a useful datapoint.

hooimin7 commented 2 weeks ago

thank you @betteridiot