Skip to content

edit accumulate can produce tiny negative placement coordinates #34

Description

@bcoltman

Hi,

I’m seeing an issue where .jplace files produced by:

gappa edit accumulate --threshold 0.95

are rejected by guppy check / guppy fpd because some placement locations are very slightly negative, e.g.:

invalid placement location in <query_id>: -2.22045e-16 < 0
invalid placement location in <query_id>: -6.93889e-18 < 0

This occurs across all accumulated files in this dataset. The affected edges generally have normal branch lengths, for example:

edge 426  branch_length 0.257455
edge 406  branch_length 0.118157
edge 381  branch_length 0.881322

The values look like machine-precision deviations from zero rather than meaningful negative placement locations. My guess is that some accumulated placements are landing exactly at branch endpoints, and floating-point arithmetic/writing results in tiny negative distal/proximal coordinates.

Would it make sense for edit accumulate or the .jplace writer to clamp placement coordinates to the valid branch interval when deviations are within numerical precision?

I can provide a small failing .jplace file if helpful.

Environment/details:

gappa version: v0.9.0
command: gappa edit accumulate --threshold 0.95

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