I annotated a phylogenic tree in a .treefile but I can't open the exported annotated .treefile which I saved as a different file.
This is the error "Import Error Error reading tree file: unknown command 'begin' in TREES block". I have compared the annotated .treefile to the original .treefile and sure there is a begin command but I assume it's part of the figtree code for the annotation.
I deleted it to just to check and I got another error ": Unable to read file: java.io.EOFException".
This is most likely not a forum-type question, as there should be a definitive answer rather than just opinions. But to get a definitive answer, I think you may need to explain this part better.
I annotated a phylogenic tree in a .treefile but I can't open the exported annotated .treefile which I saved as a different file.
Based on the limited explanation you gave, I suspect that you have a Nexus file. Since all tree files are plain text, you should be able to open them in any text editor and verify. This is how Nexus files may look like:
#NEXUS
BEGIN DATA;
DIMENSIONS NTAX=115 NCHAR=15338;
FORMAT DATATYPE=PROTEIN INTERLEAVE=yes GAP=-;
Or like this:
#NEXUS[ID: 8939877847]
begin taxa;
dimensions ntax=115;
taxlabels
FigTree should be able to read Nexus files, which could mean that the one you have is somehow malformed.
Sorry about the categorisation. Yes, it is a nexus file. The phylogenetic tree was generated with iQTree and then I added annotations with Figtree.
On inspecting the file again, I added the "end" command to the tree block and now Figtree opens the file but doesn't show the annotations even though the nexus file contains a figtree block.