Skip to content
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 about vg giraffe #4472

Open
pioneer-pi opened this issue Dec 7, 2024 · 5 comments
Open

I have a question about vg giraffe #4472

pioneer-pi opened this issue Dec 7, 2024 · 5 comments

Comments

@pioneer-pi
Copy link

Hello, I use vg giraffe to map reads to pangenome.giraffe.gbz and get map.gam. I check map.gam and find it's different with the result of gam file which map use vg map. Some tags are different. And I have two questions:

  1. I check the result of *.gam with vg giraffe, I can't find the information about which chr this read map to? If I want to extract reads which mapping to chr1 from map.gam file. There is no xg file.How should I do?
  2. If I want to use the map.gam file to augment the org vg graph.(Like vg augment -x *.xg -A *.gam *.gam > *_aug.vg). Can I use this function with vg giraffe
@jeizenga
Copy link
Contributor

jeizenga commented Dec 8, 2024

If you are mapping to a graph in which chromosomes correspond to connected components in the graph, you can split the GAM into chromosome-wise GAMs with vg chunk -C -P. GAMs from vg giraffe should work the same in vg augment as GAMs from vg map, as long as you are augmented a graph with equivalent node IDs.

@pioneer-pi
Copy link
Author

Thank you. There is another question. If I wanna do Whole genome read mapping using vg giraffe. So I get the whole_genome.giraffe.gbz, whole_genome.dist and whole_genome.min.
Now I want to extract a variation graph of specific chr(like chr20 or others) from whole_genome.giraffe.gbz. Because I wanna use the result of read mapping from vg giraffe to augment the giraffe and get the specific region.

@xchang1
Copy link
Contributor

xchang1 commented Dec 11, 2024

vg chunk can be used to find a subgraph of a graph as well. You can use it with -x whole_genome.giraffe.gbz -C -P as with the GAM, and it will output the subgraph.

@pioneer-pi
Copy link
Author

@xchang1 Thank you! I get it. But there is a confusion about the gam result of vg giraffe. Compared with the gam result of vg map, there are some different tags. A tag called "refpos" is missing. I guess the meaning of this tag is mapping position of read. So can I keep this tag with vg giraffe

@xchang1
Copy link
Contributor

xchang1 commented Dec 12, 2024

You can use vg annotate to annotate the mapped reads with the positions that they overlap the reference on the graph.

Depending on what you're using it for, it might be better to use vg surject to convert the gam file to a bam/sam file. surject will try to project the alignment onto the linear reference, so it will produce a better alignment to the reference than just using annotate to find the overlap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants