Skip to content

matUtils extract creates invalid MAT/NWK with branch lengths of 0 #392

@aofarrel

Description

@aofarrel

In various circumstances, matUtils extract will create invalid MATs/nwks that have all branch lengths set to 0.

  • For affected MATs (-o), the result is a tree that has branch lengths that do not match the number of mutations in said branches.
  • For affected nwks (-t), the result is basically useless there is no list of mutations to fall back upon.

Update I've attached a script and small PB to demonstrate the issue.
proof_of_concept.txt
70.pb.txt (.txt file extension so github will upload it)

Affected commands (not exhaustive)

  • matUtils extract -i -z -o (select some random number of samples to keep, output MAT)
  • matUtils extract -i -s -o (select samples to keep, output MAT)
  • matUtils extract -i -s -p -o (select samples to prune, output MAT)
  • matUtils extract -i -s -E -o (select samples to keep, try -E as a Hail Mary even though that's for -t, output MAT)
  • matUtils extract -i -s -E -t (select samples to keep, do not recalculate branch lengths, output nwk) --> This is the only situation I've found that affects -t output

Unaffected commands (also not exhaustive)

  • matUtils extract -i -o
  • matUtils extract -i -t
  • matUtils extract -i -t
  • matUtils extract -i -E -t

Specific examples

Valid input tree
Image

Invalid MAT (per NWK inside)
Image

Invalid NWK
Image

Exploring an invalid MAT using BTE
Image

NWK output in auspice and Microreact (they're trying their best, bless their hearts)
Image
Image

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