Skip to content

vg filter cannot detect nodes field from gam file #4733

@cwatt

Description

@cwatt

1. What were you trying to do?
Extract nodes from a .gam file mapped using vg giraffe to a minigraph-cactus graph. See: https://github.com/vgteam/vg/wiki/Getting-alignment-statistics-with-vg-filter

2. What did you want to happen?
I wanted a .tsv file containing the nodes associated with each read.

3. What actually happened?
vg crashed because the node field was not detected in the .gam file. Below is a small portion of the very long error message:

Crash report for vg terminate called recursively
terminate called after throwing an instance of '━━━━━━━━━━v1.66.0 "Navetta"━std::runtime_error
terminate called recursively
terminate called recursively
━━━━━━━━━━━━━━━terminate called recursively
Caught signal 6 raised at address 0x22eebac; tracing with backward-cpp
━━━━━━━━━━━━━━━━━━━'
━  what():  error: Writing non-existent field to tsv: nodes
━━━━
Crash report for vg ━v1.66.0 "Navetta"
Caught signal 6 raised at address 0x22eebac; tracing with backward-cpp

However, the .json version of the .gam file clearly contains node ids. Example:

{"annotation": {"last_placed_stage": "none", "last_placed_stage_0bp": "none", "mapq_explored_cap": 230.56100035860723, "mapq_uncapped": 2147483647, "proper_pair": true, "secondary_scores": [161]}, "fragment_next": {"name": "seed_1_fragment_0_2"}, "identity": 1.0, "mapping_quality": 60, "name": "seed_1_fragment_0_1", "path": {"mapping": [{"edit": [{"from_length": 13, "to_length": 13}], "position": {"node_id": "109457256", "offset": "6"}, "rank": "1"}, {"edit": [{"from_length": 1, "to_length": 1}], "position": {"node_id": "109457257"}, "rank": "2"}, {"edit": [{"from_length": 113, "to_length": 113}], "position": {"node_id": "109457259"}, "rank": "3"}, {"edit": [{"from_length": 1, "to_length": 1}], "position": {"node_id": "109457260"}, "rank": "4"}, {"edit": [{"from_length": 1, "to_length": 1}], "position": {"node_id": "109457261"}, "rank": "5"}, {"edit": [{"from_length": 1, "to_length": 1}], "position": {"node_id": "109457262"}, "rank": "6"}, {"edit": [{"from_length": 4, "to_length": 4}], "position": {"node_id": "109457264"}, "rank": "7"}, {"edit": [{"from_length": 2, "to_length": 2}], "position": {"node_id": "109457265"}, "rank": "8"}, {"edit": [{"from_length": 3, "to_length": 3}], "position": {"node_id": "109457267"}, "rank": "9"}, {"edit": [{"from_length": 1, "to_length": 1}], "position": {"node_id": "109457268"}, "rank": "10"}, {"edit": [{"from_length": 11, "to_length": 11}], "position": {"node_id": "109457269"}, "rank": "11"}]}, "quality": "KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKBgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoGBgYKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKA==", "score": 161, "sequence": "[REDACTED]", "time_used": 0.00070879700000000005}

4. If you got a line like Stack trace path: /somewhere/on/your/computer/stacktrace.txt, please copy-paste the contents of that file here:

N/A

5. What data and command can the vg dev team use to make the problem happen?
vg filter --tsv-out "score;mapping_quality;nodes" mapped.gam > mapped-stats.tsv
I can't share this data. Any .gam file should work, I think.

6. What does running vg version say?

vg version v1.66.0 "Navetta"

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions