-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a question while using vg. #4261
Comments
If you want Python code to read vg's formats directly, you can try either the libbdsg Python bindings which can read most .vg files (which are usually now in PackedGraph format), or pystream-protobuf which knows how to decode vg's Protobuf-based formats like .snarls, .gam, and .vg as written straight from If you do want to convert to a text-based format, you have some options in vg: You can use You can use The |
Thank you, I get it. I want to read gam format and i check out the pystream-protobuf. I found that I need to import stream and vg_pb2 to parse GAM file. I install stream, but I don't know how to use vg_pb2. |
It looks like all the non-message fields just become Python fields. So if you want to print out all the read names, you would get the |
@adamnovak Thank you! And I have another question: I use vg snarl to get the snarl fie of a variation graph. Can I get the reads that mapping to each snarl?(It means I can get snarl and reads that match to a special snarl) Does vg support it? |
It looks like you can take your snarls file and provide it to But we don't have a way to ask
This would work way better if we actually had C++ code somewhere to pull all the nodes in a specified snarl, or in each snarl, and grab the reads touching them. If you want to do it as a batch process and not just look at one snarl and its reads, you can make it work with
And you would also need the graph loaded in order to traverse the "nets" that the new snarl decomposition API uses:
But then you can loop over all your reads with
Then you can collect all the unique snarls that all the nodes visited by the read appear in, and then take the read and store it somewhere where you can look at it when you want to think about each of those snarls. |
You might want to skip the trivial snarls that don't have any contents between their bounding nodes. I think you can ID them because |
Now If I want to execute vg's special format files like .vg,.snarls,.gam and so on. How can I read it directly to python with out transfer the special format to normal format(like json or txt)?
Thank you!
The text was updated successfully, but these errors were encountered: