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

fix: error with gfa export of fully duplicated paths #19

Closed mmolari closed 2 years ago

mmolari commented 2 years ago

Fixes an error that would come up when exporting to gfa format with the --no-duplications flag, if one of the paths is composed of only duplicated blocks. In this case the list of exported nodes is empty, and I would hit the error in line 151 of the old version, when nodes[1] was called. I fixed it by simply avoid defining the path if no nodes are exported, and later avoid writing a path to file if undefined.