From 89af9b6c89ad058234544cf8ec6468a94407d688 Mon Sep 17 00:00:00 2001 From: Glenn Hickey Date: Fri, 5 Apr 2024 09:57:04 -0400 Subject: [PATCH] auto-add rgfa prefix during rgfa conversion --- src/subcommand/convert_main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/subcommand/convert_main.cpp b/src/subcommand/convert_main.cpp index 7474f5a521e..d8981e1f02d 100644 --- a/src/subcommand/convert_main.cpp +++ b/src/subcommand/convert_main.cpp @@ -6,6 +6,7 @@ #include "../algorithms/find_gbwtgraph.hpp" #include "../io/save_handle_graph.hpp" #include "../gfa.hpp" +#include "../rgfa.hpp" #include "../gbwt_helper.hpp" #include "../gbwtgraph_helper.hpp" #include @@ -236,6 +237,13 @@ int main_convert(int argc, char** argv) { cerr << "[vg convert] warning: vg-protobuf output (-v / --vg-out) is deprecated. please use -p instead." << endl; } + // we interpret the user path selections as reference path selections (consistent with vg paths) + // so we need to add the rgfa keyword to pick up the nonref paths + if ((!rgfa_paths.empty() || !rgfa_prefixes.empty()) && + std::find(rgfa_prefixes.begin(), rgfa_prefixes.end(), RGFACover::rgfa_sample_name) == rgfa_prefixes.end()) { + rgfa_prefixes.push_back(RGFACover::rgfa_sample_name); + } + // with -F or -G we convert an alignment and not a graph if (input == input_gam || input == input_gaf) {