Skip to content

IQtree2 doesn't accept GTotree's partitions if a specific model is called #108

@Stian-2rz

Description

@Stian-2rz

Hey GTotree community,
First of all, pretty sure this is not a GTotree issue, but an IQtree2 issue where if a specific model is called (i.e with -m LG+I+G4 instead of -m MFP) the Partitions.txt file generated by GTotree will give an error

CHECKPOINT: Initial tree restored
ERROR: File not found AA

Note that running with the model finder (-m MFP) will still work.

In case anyone else encounters this, converting the Partitions.txt file to nexus format (as suggested by roblanf, an IQtree collaborator in IQtree Issue 314 ) fixes the issue and allows IQtree to run with GTotree partitions for all of the models I've tried so far (LG+I+G4, LG+R7, LG+C60+F+G)

I converted the Partitions.txt file to a .nex file with the following python script:

input_file = "Partitions.txt"
output_file = "Partitions.nex"

with open(input_file) as f:
    lines = [line.strip() for line in f if line.strip()]

with open(output_file, "w") as f:
    f.write("#NEXUS\n")
    f.write("begin sets;\n")
    for line in lines:
        parts = line.split(',')
        if len(parts) != 2:
            continue
        _, rest = parts
        name, coords = rest.split('=')
        name = name.strip().replace(" ", "_")
        coords = coords.strip()
        f.write(f"  charset {name} = {coords};\n")
    f.write("end;\n")

Don't know if there is anything to fix on GTotree's part here (this really is an Iqtree issue but given they have had open issues on this for almost a year I don't know if a fix is incoming), but as the nexus formatted file will run both with model finder and specific models, while the .txt format will only run with the model finder (as of Iqtree 2.4.0 at least) are there other use cases for the default format of Partitions.txt? Could the nexus format be the default output without breaking anything downstream in GTotree?

Best regards,
Stian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions