gecrooks / weblogo

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

--color option not working for custom color scheme #139

Closed annahake closed 2 years ago

annahake commented 2 years ago

Hi,

I have previously used weblogo as a command line version with a custom color scheme: weblogo --format PNG --size large < alignment.fasta -o logo.png --alphabet 'AaRrNnDdCcEeQqGgHhIiLlKkMmFfPpSsTtWwYyVv*#' --composition equiprobable -X YES --errorbars NO --scale-width NO --resolution 800 -P "" -Y NO --color 'blue' 'ARNDCEQGHILKMFPSTWYV*' 'positive' --color 'orange' 'arndceqghilkmfpstwyv#' 'negative'

Now the tool takes only the first color option and disregards the other option. Could you help me on that?

Thank you in advance!

Anna

annahake commented 2 years ago

I found the issue. Now it treats the upper case amino acids the same as the lower case amino acids and therefore takes the first matching color scheme. Is there a way to circumvent that behaviour? In my case, I want to be able to discriminate the amino acid based on other characteristics and display the color accordingly.

gecrooks commented 2 years ago

The color scheme does not respect case. These seems to be a bug, which I have fixed on this branch: https://github.com/WebLogo/weblogo/tree/139-color-option

However, I will have to think about this change a bit before updating the master branch to make sure I'm not about to break something.

gecrooks commented 2 years ago

@kalekundert Do you have any insight on this issue? The weblogo colorscheme does not respect case, which seems to have been a feature you added a long while ago when you contributed an update to weblogo's colors. If I make the colorscheme case sensitive, does that break anything important?

kalekundert commented 2 years ago

I think I just thought that case-insensitive was more convenient, e.g. if the default color scheme specifies "DEKRH" as charged, it seems like it would be surprising if only upper-case sequences were highlighted correctly. But I don't think anything important would break if you change it back.

gecrooks commented 2 years ago

Thanks for the feedback Kale.

gecrooks commented 2 years ago

Fixed and released. You should be able to update weblogo and get your logo working.

annahake commented 2 years ago

Thanks Gavin and Kale for the fast reply and fix! Do you know if by updating the conda weblogo package, the newest version will be available or do I have to wait until a newer conda release is available?

gecrooks commented 2 years ago

That's a good question. I don't actually know how long it takes conda to update. But you can install the latest weblogo with pip install weblogo --upgrade. Then run weblogo --version to make sure the version is correct, 3.7.10