Skip to content

Commit 2db0b0c

Browse files
committed
Refuse to load GFA/FASTG with duplicate node names
1 parent d9c665a commit 2db0b0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graph/assemblygraph.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,9 @@ void AssemblyGraph::buildDeBruijnGraphFromGfa(QString fullFileName, bool *unsupp
616616

617617
QString nodeName = lineParts.at(1);
618618
if (nodeName.isEmpty())
619-
nodeName = "node";
619+
nodeName = getUniqueNodeName("node");
620+
if (m_deBruijnGraphNodes.contains(nodeName + "+"))
621+
throw "load error";
620622

621623
QByteArray sequence = lineParts.at(2).toLocal8Bit();
622624

@@ -972,6 +974,8 @@ void AssemblyGraph::buildDeBruijnGraphFromFastg(QString fullFileName)
972974
nodeName += "-";
973975
else
974976
nodeName += "+";
977+
if (m_deBruijnGraphNodes.contains(nodeName))
978+
throw "load error";
975979

976980
QString nodeDepthString = thisNodeDetails.at(5);
977981
if (negativeNode)

0 commit comments

Comments
 (0)