vgteam / vg

tools for working with genome variation graphs
https://biostars.org/tag/vg/
Other
1.09k stars 193 forks source link

vg view skipping with warning: node ID 0 is not allowed #355

Open jjfarrell opened 8 years ago

jjfarrell commented 8 years ago

When viewing some simulated mapped reads in a gam file, the warning a node ID 0 is not allowed is generated for each read. Any suggestions?

vg version v1.4.0-673-gdb1ee0c

vg index -k 11 -x chr11.xg -g chr11.gcsa chr11.vg 30 simulated reads of 150 bp are mapped vg map -r sim.30.fa -x chr11.xg -g chr11.gcsa -k 22 >aln30.gam 30 warnings are generated when viewing... vg view aln30.gam

[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
[vg] warning: node ID 0 is not allowed. Skipping.
H   VN:Z:1.0
edawson commented 8 years ago

Have you tried vg view -a aln.gam? We should throw a better warning, but if I remember right this is the error that occurs when one attempts to view an Alignment as a Graph (i.e. without the -a flag).

jjfarrell commented 8 years ago

Thanks! Yes, adding the -a parameter listed the mapped reads without the warnings. I can see now that the command can handle 7 different input formats. It may be helpful to have the default input file format be determined from the input file suffix (bam,gam,json,vg,fasta,fa, etc) when available.

adamnovak commented 8 years ago

I think what we should do is add some kind of tag or magic number to our format in which we encapsulate the protobuf-encoded data, so that we can't mix the protobuf files up. We could have an angry message come out of the stream code when we see one file type when expecting another.

The tough part is the template metaprogramming we would have to do to map back and forth between serializeable protobuf types and code numbers. Plus we'd potentially be breaking compatibility with existing serialized data.