TongZhou2017 / itol.toolkit

Helper Functions for Interactive Tree Of Life (iTOL)
https://tongzhou2017.github.io/itol.toolkit/
Other
154 stars 17 forks source link

Manual color setting issue #47

Open mike-bioinf opened 1 week ago

mike-bioinf commented 1 week ago

Dear Sir, I encountered an issue when trying to manually set colors in a "color" column in annotation dataframes. Specifically, the associations between colors and data values are not inferred from the actual correspondence of values in the dataframe, but rather based on their alphanumerical order. I believe this is related to the conversion of these columns to factors and the subsequent association between their levels. In fact, pre-converting these columns to factors with custom levels resolves the issue. If this is the case, I believe this should be mentioned in the documentation to make users aware of the necessary pre-conversion. Anyway, thanks for the package.

TongZhou2017 commented 6 days ago

Dear Mike,

Thank you for bringing this issue to our attention and for your detailed explanation. You're absolutely correct—pre-converting the columns to factors with custom levels resolves this issue, as the associations are indeed based on the alphanumerical order by default.

We appreciate your suggestion, and we will make sure to update the documentation in the next version to highlight the importance of this pre-conversion step. This will help other users avoid similar confusion in the future.

Thanks again for your valuable feedback and support for the package!

Best regards,
Tong