Hi again,
I couldn't understand the source of the problem yet. But at least exporting the trees to nexus and running treeannotator (v1.10.4) works fine (tried in the 1000 trees file). Thanks a lot Remco and Santiago for the feedback.
For future references: Since I couldn't find a nice way to convert such big files from newick to nexus I wrote a python3 script (see below) to include some "nexus formatting" within the newick files as temporary solution or workaround. Works pretty fast, and so far I haven't got any problem/bug (tested in Ubuntu 20.04.2).
Best,
Miguel.
'
#!/usr/bin/env python3
import argparse
import sys
import os
parser = argparse.ArgumentParser(description="Converts newick trees in a single file to nexus format by simply just adding headings and terminal formatting.")
# Add the arguments to the parser
parser.add_argument("-t", "--tree_in", dest="tree_in", required=True,
help="Tree(s) file.")
parser.add_argument("-o", "--tree_out", dest="tree_out", required=True,
help="Tree(s) file output.")
parser.add_argument("-r", "--overwrite", dest="remove", required=False, default=None, action="store_true",
help="Overwrite already existing output.")
args = parser.parse_args()
if os.path.exists(args.tree_out):
print("\n Warning! File", args.tree_out,"already exists.")
if args.remove is not None:
print(" Overwriting...\n")
os.remove(args.tree_out)
else:
print(" Please choose other name for the output tree fle or consider using the option to overwrite (-r/--overwrite).\n")
sys.exit(1)
with open(args.tree_out, "a") as outfile:
print("#NEXUS", file=outfile)
print("Begin trees;", file=outfile)
c = 0
for line in open(args.tree_in):
c += 1
print(f"\ttree tree_{c} = [&R] {line}", file=outfile, end="")
print("end;", file=outfile)
'