pangenome / pggb

the pangenome graph builder
https://doi.org/10.1038/s41592-024-02430-3
MIT License
368 stars 41 forks source link

Suggestion for 1D graph visualisation #146

Closed brettChapman closed 1 year ago

brettChapman commented 2 years ago

Hi

I've been using the 1D graph visualizations to identify regions of high variation across the pangenome graph, and also slicing the pangenome graph by different germ plasm (I'm working with Barley), to identify striking differences between groups of haplotypes (see attached 2 different haplotype groups for examples).

My question is, is there a way to add chromosome coordinates to the visualisation, so that I can then proceed to narrow in on specific regions of interest. I know a common coordinate across the entire pangenome can be based on a consensus graph coordinate, but perhaps there could be node ID on the x axis in major/minor ticks or some estimate of the number of Mbps from the start to end of the chromosome, just to give a ball-park idea of the region to zoom into.

Thanks.

barley_pangenome_graph_7H og rowtype6 viz_inv

barley_pangenome_graph_7H og rowtype2 viz_inv

brettChapman commented 2 years ago

Is there any way to add genomic coordinates to the 1D graph image, much like mashmap produces coordinates from a pairwise alignment? We could potentionally provide a chosen reference path to refer to the genomic coordinates for the visualization. At the moment this is a bottleneck for further analysis we're carrying out based on the 1D pangenome graphs, like the ones I provided earlier above. Alternatively, is there a tool I can use on the PAF files generated during the PGGB run which could help. Thanks.

Morex_v2_chr1H_ZDM02064_v1_chr1H_pangenome_1H_pctid-95

ekg commented 2 years ago

Totally agree. We need to force a reference order and/or show the reference order more clearly in the odgi viz view.

To not get blocked though, I'll suggest something already ready:

I usually use the 2D plots like this to understand pairwise relationships.

You can obtain them using odgi untangle, which optionally writes PAF format. You'll need to choose the target and query paths.

On Thu, Jan 20, 2022, 09:34 Brett Chapman @.***> wrote:

Is there any way to add genomic coordinates to the 1D graph image, much like mashmap produces coordinates from a pairwise alignment? We could potentionally provide a chosen reference path to refer to the genomic coordinates for the visualization. At the moment this is a bottleneck for further analysis we're carrying out based on the 1D pangenome graphs, like the ones I provided earlier above. Alternatively, is there a tool I can use on the PAF files generated during the PGGB run which could help. Thanks.

[image: Morex_v2_chr1H_ZDM02064_v1_chr1H_pangenome_1H_pctid-95] https://user-images.githubusercontent.com/8529807/150301596-68b1d61f-efca-4f88-88fd-cef8ccc2c0c1.png

— Reply to this email directly, view it on GitHub https://github.com/pangenome/pggb/issues/146#issuecomment-1017233202, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDQEK4ZKNGHYXU7UUNLWLUW7CJLANCNFSM5JIU72TA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

brettChapman commented 2 years ago

Thanks @ekg, I look forward to seeing something implemented in PGGB.

For now I'm using odgi untangle to get the PAF files and then I'm visualising the chromosome coordinates of inversions and gaps in the reference using dot plot tools such as D-Genies, to come up with a scale to overlay on the 1D pangenome graph plots. We're currently writing up a paper, and having a scale to refer to in the figure is essential. Thanks.

subwaystation commented 2 years ago

@brettChapman there is now a method to sort a graph with odgi by a given reference path or by given reference paths. See https://odgi.readthedocs.io/en/latest/rst/tutorials/sort_layout.html#visualize-the-mhc-by-path-position.