why does vg convert doesn't work?
2
0
Entering edit mode
15 months ago
Michal • 0

I am using vg version 1.49.0 on Ubuntu I am trying to convert a gam file to a gfa format and it is not working. I have the file hprc1004mapped.gam and I run the command:

./vg convert –G hprc1004mapped.gam > hprc1004mapped.gfa 

And I get the error:

error:[get_input_file_name] specify input filename, or "-" for standard input

When I try the command:

 ./vg convert -G -F hprc1004mapped.gam > hprc1004mapped.gaf

I get the error:

error[VPKG::load_one]: Correct input type not found in hprc1004mapped.gam while loading handlegraph::HandleGraph.

The same error I also get when I try to convert gbwt to xg file :

./vg convert -x hprc-v1.0-mc-grch38-minaf.0.1.gbwtx > hprc-v1.0-mc-grch38-minaf.0.1.gx
error:[get_input_file_name] unable to open input file: hprc-v1.0-mc-grch38-minaf.0.1.gbwtx
error[VPKG::load_one]: Could not open hprc-v1.0-mc-grch38-minaf.0.1.gbwtx while loading handlegraph::HandleGraph

Are these errors related? What am I doing wrong?

vg • 1.4k views
ADD COMMENT
2
Entering edit mode
15 months ago
Xian ▴ 80

vg convert requires a graph as a positional argument at the end of the command, and when you use the -G flag, you need to include the GAM file immediately after the flag. In your first command, it couldn't find the graph and in the second, it tried to load -F as the GAM file and the GAM file as the graph. Your command should look something like ./vg convert –G hprc1004mapped.gam [graph_file] > hprc1004mapped.gfa

The second problem is that you can't convert a GBWT to an xg because the GBWT stores haplotpyes through a graph, while the xg is the graph itself. It looks like you're using the hprc graphs, so there should be a gbz file that you can convert to an xg. You should be able to use the gbz for most things you need the xg for though; I'd recommend checking here to see if xg is the format you want https://github.com/vgteam/vg/wiki/File-Types

ADD COMMENT
0
Entering edit mode

It worked! Thank you. b.t.w can I use .gbz in "vg find"?

ADD REPLY
1
Entering edit mode

Awesome! Yeah, you should be able to use the .gbz file with the vg find -x flag, even though it's not an xg

ADD REPLY
1
Entering edit mode

Michal : Please accept this answer (green checkmark) to provide closure to this thread.

ADD REPLY
0
Entering edit mode
15 months ago

Also, keep in mind that (it might have been a typo in your commands) than GFA (pangenome) and GAF (mapping format) formats are completely different in pangenomes.

I've listed the formats here:

https://github.com/colindaven/awesome-pangenomes

ADD COMMENT

Login before adding your answer.

Traffic: 2594 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6