Skip to content

Commit 16e3d61

Browse files
committed
treat phase block as subrange to hand converted gbz
1 parent 286ec9f commit 16e3d61

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/rgfa.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ string RGFACover::make_rgfa_path_name(const string& path_name, int64_t start, in
2323
PathMetadata::parse_path_name(path_name, path_sense, path_sample, path_locus,
2424
path_haplotype, path_phase_block, path_subrange);
2525
if (path_subrange == PathMetadata::NO_SUBRANGE) {
26-
path_subrange = make_pair(0, 0);
26+
if (path_phase_block != PathMetadata::NO_PHASE_BLOCK && path_phase_block > 0) {
27+
// gbz puts subranges into phase blocks
28+
// so we interpret them as subranges here, which allows
29+
// things like vg convert graph.gbz | vg paths -x - -f ... to make cover
30+
path_subrange.first = path_phase_block;
31+
path_subrange.second = PathMetadata::NO_END_POSITION;
32+
} else {
33+
path_subrange = make_pair(0, 0);
34+
}
2735
}
2836

2937
// we move the sample into the locus

0 commit comments

Comments
 (0)