lh3 / minigraph

Sequence-to-graph mapper and graph generator
https://lh3.github.io/minigraph
MIT License
419 stars 38 forks source link

Overlapping segments #66

Closed elcortegano closed 2 years ago

elcortegano commented 2 years ago

Hi, I am having issues running the incremental graph generation with minigraph. The following error is returned:

[E::mg_index_core] minigraph doesn't work with graphs containing overlapping segments

Minigraph was run similarly as follows:

minigraph -cxggs target.gfa assembly1.hap1.fa assembly1.hap2.fa assembly2.hap1.fa assembly2.hap2.fa ...

What does it mean this error and what can be causing it? how to fix it? Thanks

lh3 commented 2 years ago

Sorry for the late response. Github inactivated my primary email and I didn't receive email notifications for a month.

Different contigs in assembly1.hap1.fa and assembly2.hap1.fa probably have identical names. You need to add a prefix to contig names such that every contig has a unique name across all input files. You may run

misc/mgutils.js renamefa assembly1#1 assembly1.hap1.fa > new-assembly1.hap1.fa

or write your own script.