Entering edit mode
16 months ago
Wenhai
•
0
Is there a way to quickly calculate the nodes' average coverage of variation graph from the read alignment file (.gam, .json) ?
Thank you in advance!
You can convert the
.gaminto a.packfile usingvg packand then query a table of the node coverages usingvg pack -d.What is the meaning of fields in the table? I found that there are multiple records for the same node_id. I don't quite understand this table. The first line also seems a bit strange.
Each node consists of a number of bases, so the full position of a base in the pangenome graph is given by the combination of 1) the node ID, and 2) the offset of the base on the node (numbered 0,...,len(node) - 1), which are given by the
node.idandnode.offsetcolumns. Theseq.posis an alternate assignment of identifiers that are given numbers starting at 0. However, theseq.poswon't tell you which positions are on the same node, if that's what you're interested in.My understanding is that each record represents the coverage of the base. For example,
1 227651 0 6indicates that the coverage of the first base of node 227651 is 6. So the sum of all base coverage of this node divided by the length of this node can obtain the average coverage depth of that node. Is my understanding right?Yes, that's it.
I got it. Thanks.