Skip to content

left_tail_length, right_tail_length and longest_attempted_connection are always 0 #5120

Description

@parsaeskandar

I was fixing a merge conflict with master on my giraffe-server branch (#4879) and noticed that the lt:i: and rt:i: tags changed to 0 for every read. I looked into it and it comes from master, not from my branch: plain vg giraffe gives the same.

Since #5093, three annotations are set from Path::length() in src/minimizer_mapper_from_chains.cpp. The two tail lengths:

set_annotation(result, "left_tail_length", (double) left_tail.path.length());
set_annotation(result, "longest_attempted_connection", (double) longest_attempted_connection);
set_annotation(result, "right_tail_length", (double) right_tail.path.length());

so length() reads the optional length field of the message (vg.proto line 106), which nothing sets. It is not the length of the path, so all three are always 0.

Besides the tags, Surjector reads the two tail lengths to drop anchors inside the tails when prune_tail_region_anchors is on. With 0 it never drops any:

vg/src/surjector.cpp

Lines 4826 to 4827 in a7934aa

bool fully_in_left_tail = (left_tail_length > 0 && anchor_read_end <= left_tail_length);
bool fully_in_right_tail = (right_tail_length > 0 && anchor_read_start >= right_tail_begin);

To see it, from the test directory:

vg construct -a -r small/x.fa -v small/x.vcf.gz > x.vg
vg gbwt -o x-haps.gbwt -x x.vg -v small/x.vcf.gz
vg gbwt -x x.vg -g x.gbz x-haps.gbwt
vg giraffe -Z x.gbz -f reads/small.recombined.fq -b hifi > mapped.gam
vg view -aj mapped.gam | jq -c '.annotation | {left_tail_length, right_tail_length, longest_attempted_connection}'

Now:

{"left_tail_length":0,"right_tail_length":0,"longest_attempted_connection":0}

With a build from before #5093:

{"left_tail_length":67,"right_tail_length":33,"longest_attempted_connection":71}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions