Skip to content

Commit 89af9b6

Browse files
committed
auto-add rgfa prefix during rgfa conversion
1 parent 9680149 commit 89af9b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/subcommand/convert_main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "../algorithms/find_gbwtgraph.hpp"
77
#include "../io/save_handle_graph.hpp"
88
#include "../gfa.hpp"
9+
#include "../rgfa.hpp"
910
#include "../gbwt_helper.hpp"
1011
#include "../gbwtgraph_helper.hpp"
1112
#include <vg/io/stream.hpp>
@@ -236,6 +237,13 @@ int main_convert(int argc, char** argv) {
236237
cerr << "[vg convert] warning: vg-protobuf output (-v / --vg-out) is deprecated. please use -p instead." << endl;
237238
}
238239

240+
// we interpret the user path selections as reference path selections (consistent with vg paths)
241+
// so we need to add the rgfa keyword to pick up the nonref paths
242+
if ((!rgfa_paths.empty() || !rgfa_prefixes.empty()) &&
243+
std::find(rgfa_prefixes.begin(), rgfa_prefixes.end(), RGFACover::rgfa_sample_name) == rgfa_prefixes.end()) {
244+
rgfa_prefixes.push_back(RGFACover::rgfa_sample_name);
245+
}
246+
239247

240248
// with -F or -G we convert an alignment and not a graph
241249
if (input == input_gam || input == input_gaf) {

0 commit comments

Comments
 (0)