neherlab / pangraph

A bioinformatic toolkit to align genome assemblies into pangenome graphs
https://neherlab.github.io/pangraph
MIT License
87 stars 7 forks source link

GFA export edge case #26

Closed liampshaw closed 2 years ago

liampshaw commented 2 years ago

I think in pangraph export there is an edge case for gfa export of circular genomes.

If a circular genome consists of two blocks, it will only get one edge between these blocks, when there should be the reverse edge added to make the genome circular (e.g. when viewed in bandage.)

Example attached but the issue is that for a genome

P   genome1 IRXQDAJTWV+,PLHWRNNGJC+ TP:Z:circular*

pangraph exports only one edge:

L   IRXQDAJTWV  +   PLHWRNNGJC  +   *   RC:i:2

when for bandage to plot properly it should also export

L   IRXQDAJTWV  -   PLHWRNNGJC  -   *   RC:i:2

fake_example.tar.gz

liampshaw commented 2 years ago

For 2 circular genomes each of 2 blocks, sharing 1 common block (red), default pangraph export and plotting with bandage gives:

drawing

Expected plot which can be obtained by manually adding the extra edges:

drawing