Closed samwichse closed 1 year ago
Hi, thank you for noticing this!
Spaces in node labels work fine if the labels are within (single or double) quotes (e.g., (('Taxon 1','Taxon 2'),('Taxon 3','Taxon 4'));
), but they are indeed lost if the are no quotes.
I have a fix that will be included in the next release; in the meantime, you can patch your version of TreeViewer like this:
PhyloTree.TreeNode.dll
file that should be located in the install directory of TreeViewer (on Linux, the default is /usr/lib/TreeViewer
)..bak
to it).PhyloTree.TreeNode.dll
that incorporates the fix.PhyloTree.TreeNode.dll
in place of the old one.In theory, these steps should also work on Windows and macOS, but since this DLL is not signed, the OS will probably complain and not let you use it (especially on macOS)... On Linux there should be no such issues.
That said, I think it is generally a good idea to avoid spaces in taxon names - you might find all sorts of weird/inconsistent behaviours otherwise (some programs remove them, some programs automatically replace them with underscores, some programs remove the space and everything else after it...). If you use something like accession numbers (or even if you just replace the spaces with underscores or periods), you can then use an attachment to add another attribute containing the taxon names, possibly with some formatting (e.g., italics). There is a section in one of the tutorials that shows how to do this.
By the way, I have not tested the program on Rocky Linux, so please do let me know if you find any strange bugs!
Thank you for the quick reply. I'll try it out as soon as I get back to work!
I usually keep everything with just underscores until I actually draw the tree, then replace the underscores with spaces, but that's a good idea with the attachment. I just started using TreeViewer today, so there is a lot i have yet to figure out!
Sam
On Fri, Aug 25, 2023, 4:06 PM Giorgio Bianchini @.***> wrote:
Hi, thank you for noticing this!
Spaces in node labels work fine if the labels are within (single or double) quotes (e.g., (('Taxon 1','Taxon 2'),('Taxon 3','Taxon 4'));), but they are indeed lost if the are no quotes.
I have a fix that will be included in the next release; in the meantime, you can patch your version of TreeViewer like this:
- Find the PhyloTree.TreeNode.dll file that should be located in the install directory of TreeViewer (on Linux, the default is /usr/lib/TreeViewer).
- Back it up somewhere, in case something goes wrong (e.g., rename it appending .bak to it).
- Download this file: PhyloTree.TreeNode.zip https://github.com/arklumpus/TreeViewer/files/12443110/PhyloTree.TreeNode.zip and extract it - it contains a new version of PhyloTree.TreeNode.dll that incorporates the fix.
- Place the new PhyloTree.TreeNode.dll in place of the old one.
In theory, these steps should also work on Windows and macOS, but since this DLL is not signed, the OS will probably complain and not let you use it (especially on macOS)... On Linux there should be no such issues.
That said, I think it is generally a good idea to avoid spaces in taxon names - you might find all sorts of weird/inconsistent behaviours otherwise (some programs remove them, some programs automatically replace them with underscores, some programs remove the space and everything else after it...). If you use something like accession numbers (or even if you just replace the spaces with underscores or periods), you can then use an attachment to add another attribute containing the taxon names, possibly with some formatting (e.g., italics). There is a section https://github.com/arklumpus/TreeViewer/wiki/Plotting-multiple-age-distributions#speciesName in one of the tutorials that shows how to do this.
By the way, I have not tested the program on Rocky Linux, so please do let me know if you find any strange bugs!
— Reply to this email directly, view it on GitHub https://github.com/arklumpus/TreeViewer/issues/16#issuecomment-1693874028, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR6ZHE3UL2OV47YVFOL6NFLXXEAUVANCNFSM6AAAAAA362SW5E . You are receiving this because you authored the thread.Message ID: @.***>
If you just need to replace all underscores with spaces, you can also do it more easily with the search/replace function.
You can open the Search panel by clicking on the Search button in the Actions tab (or pressing CTRL+F on Windows and Linux or CMD+F on macOS). Then, enter _
in the Search box (all the species in the tree will become highlighted) and enter
(i.e., a space) in the Replace with box. Then, click on the Replace all button. This will add an instance of the Replace attribute Further transformation module, replacing all underscores with spaces.
Hello, I'm using version 2.1.0 on RockyLinux 9, but I can't get spaces in my leaf labels. I can have underscores, but if I open the same nwk file with the underscores replaced with spaces, the labels are just all squished together with no spaces.
Label Attribute Name is set to "String"
If I click the labels, I can individually edit them to add spaces, but my tree has 75 items and this seems like a bug?