Sort vertex lists by vertex label before making adjacency matrix
This commit is contained in:
@@ -105,6 +105,7 @@ public class Simulator implements GraphModificationFunctions {
|
||||
Vertex alphaVertex = new Vertex(SequenceType.CDR3_ALPHA, seq, alphaWellCounts.get(seq), plateAtoVMap.get(seq));
|
||||
alphaVertices.add(alphaVertex);
|
||||
}
|
||||
Collections.sort(alphaVertices);
|
||||
graphGenerator.first(alphaVertices);
|
||||
//the list of beta vertices
|
||||
//List<Integer> betaVertices = new ArrayList<>(plateVtoBMap.keySet());//This will work because LinkedHashMap preserves order of entry
|
||||
@@ -113,6 +114,7 @@ public class Simulator implements GraphModificationFunctions {
|
||||
Vertex betaVertex = new Vertex(SequenceType.CDR3_BETA, seq, betaWellCounts.get(seq), plateBtoVMap.get(seq));
|
||||
betaVertices.add(betaVertex);
|
||||
}
|
||||
Collections.sort(betaVertices);
|
||||
graphGenerator.second(betaVertices);
|
||||
//use adjacency matrix of weight created previously
|
||||
graphGenerator.weights(weights);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Vertex implements Serializable {
|
||||
public class Vertex implements Serializable, Comparable<Vertex> {
|
||||
private SequenceType type;
|
||||
private Integer vertexLabel;
|
||||
private Integer sequence;
|
||||
@@ -89,4 +89,9 @@ public class Vertex implements Serializable {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Vertex other) {
|
||||
return this.vertexLabel - other.getVertexLabel();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user