Compare commits
5 Commits
68ee9e4bb6
...
a5db89cb0b
| Author | SHA1 | Date | |
|---|---|---|---|
| a5db89cb0b | |||
| 1630f9ccba | |||
| d785aa0da2 | |||
| a7afeb6119 | |||
| f8167b0774 |
@@ -239,7 +239,7 @@ slightly less time than the simulation itself. Real elapsed time from start to f
|
|||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
* ~~Try invoking GC at end of workloads to reduce paging to disk~~ DONE
|
* ~~Try invoking GC at end of workloads to reduce paging to disk~~ DONE
|
||||||
* Hold graph data in memory until another graph is read-in? ~~ABANDONED~~ UNABANDONED
|
* Hold graph data in memory until another graph is read-in? ~~ABANDONED~~ ~~UNABANDONED~~ DONE
|
||||||
* ~~*No, this won't work, because BiGpairSEQ simulations alter the underlying graph based on filtering constraints. Changes would cascade with multiple experiments.*~~
|
* ~~*No, this won't work, because BiGpairSEQ simulations alter the underlying graph based on filtering constraints. Changes would cascade with multiple experiments.*~~
|
||||||
* Might have figured out a way to do it, by taking edges out and then putting them back into the graph. This may actually be possible. If so, awesome.
|
* Might have figured out a way to do it, by taking edges out and then putting them back into the graph. This may actually be possible. If so, awesome.
|
||||||
* See if there's a reasonable way to reformat Sample Plate files so that wells are columns instead of rows.
|
* See if there's a reasonable way to reformat Sample Plate files so that wells are columns instead of rows.
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ public class GraphDataObjectReader {
|
|||||||
BufferedInputStream fileIn = new BufferedInputStream(new FileInputStream(filename));
|
BufferedInputStream fileIn = new BufferedInputStream(new FileInputStream(filename));
|
||||||
ObjectInputStream in = new ObjectInputStream(fileIn))
|
ObjectInputStream in = new ObjectInputStream(fileIn))
|
||||||
{
|
{
|
||||||
|
System.out.println("Reading graph data from file. This may take some time");
|
||||||
|
System.out.println("File I/O time is not included in results");
|
||||||
data = (GraphWithMapData) in.readObject();
|
data = (GraphWithMapData) in.readObject();
|
||||||
} catch (FileNotFoundException | ClassNotFoundException ex) {
|
} catch (FileNotFoundException | ClassNotFoundException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|||||||
@@ -18,8 +18,11 @@ public class GraphDataObjectWriter {
|
|||||||
|
|
||||||
public void writeDataToFile() {
|
public void writeDataToFile() {
|
||||||
try (BufferedOutputStream bufferedOut = new BufferedOutputStream(new FileOutputStream(filename));
|
try (BufferedOutputStream bufferedOut = new BufferedOutputStream(new FileOutputStream(filename));
|
||||||
|
|
||||||
ObjectOutputStream out = new ObjectOutputStream(bufferedOut);
|
ObjectOutputStream out = new ObjectOutputStream(bufferedOut);
|
||||||
){
|
){
|
||||||
|
System.out.println("Writing graph and occupancy data to file. This may take some time.");
|
||||||
|
System.out.println("File I/O time is not included in results.");
|
||||||
out.writeObject(data);
|
out.writeObject(data);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import org.jgrapht.graph.SimpleWeightedGraph;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public abstract class GraphModificationFunctions {
|
public abstract class GraphModificationFunctions {
|
||||||
|
|
||||||
@@ -18,9 +19,11 @@ public abstract class GraphModificationFunctions {
|
|||||||
Integer weight = (int) graph.getEdgeWeight(e);
|
Integer weight = (int) graph.getEdgeWeight(e);
|
||||||
Integer[] edge = {source, target, weight};
|
Integer[] edge = {source, target, weight};
|
||||||
removedEdges.add(edge);
|
removedEdges.add(edge);
|
||||||
graph.removeEdge(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (Integer[] edge : removedEdges) {
|
||||||
|
graph.removeEdge(edge[0], edge[1]);
|
||||||
|
}
|
||||||
return removedEdges;
|
return removedEdges;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,9 +44,11 @@ public abstract class GraphModificationFunctions {
|
|||||||
Integer weight = (int) graph.getEdgeWeight(e);
|
Integer weight = (int) graph.getEdgeWeight(e);
|
||||||
Integer[] edge = {source, target, weight};
|
Integer[] edge = {source, target, weight};
|
||||||
removedEdges.add(edge);
|
removedEdges.add(edge);
|
||||||
graph.removeEdge(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (Integer[] edge : removedEdges) {
|
||||||
|
graph.removeEdge(edge[0], edge[1]);
|
||||||
|
}
|
||||||
return removedEdges;
|
return removedEdges;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,9 +71,11 @@ public abstract class GraphModificationFunctions {
|
|||||||
Integer intWeight = (int) graph.getEdgeWeight(e);
|
Integer intWeight = (int) graph.getEdgeWeight(e);
|
||||||
Integer[] edge = {source, target, intWeight};
|
Integer[] edge = {source, target, intWeight};
|
||||||
removedEdges.add(edge);
|
removedEdges.add(edge);
|
||||||
graph.removeEdge(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (Integer[] edge : removedEdges) {
|
||||||
|
graph.removeEdge(edge[0], edge[1]);
|
||||||
|
}
|
||||||
return removedEdges;
|
return removedEdges;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,8 +232,6 @@ public class InteractiveInterface {
|
|||||||
GraphWithMapData data = Simulator.makeGraph(cells, plate, true);
|
GraphWithMapData data = Simulator.makeGraph(cells, plate, true);
|
||||||
assert filename != null;
|
assert filename != null;
|
||||||
GraphDataObjectWriter dataWriter = new GraphDataObjectWriter(filename, data);
|
GraphDataObjectWriter dataWriter = new GraphDataObjectWriter(filename, data);
|
||||||
System.out.println("Writing graph and occupancy data to file. This may take some time.");
|
|
||||||
System.out.println("File I/O time is not included in results.");
|
|
||||||
dataWriter.writeDataToFile();
|
dataWriter.writeDataToFile();
|
||||||
System.out.println("Graph and Data file written to: " + filename);
|
System.out.println("Graph and Data file written to: " + filename);
|
||||||
System.gc();
|
System.gc();
|
||||||
@@ -277,11 +275,9 @@ public class InteractiveInterface {
|
|||||||
assert graphFilename != null;
|
assert graphFilename != null;
|
||||||
//check if this is the same graph we already have in memory.
|
//check if this is the same graph we already have in memory.
|
||||||
GraphWithMapData data;
|
GraphWithMapData data;
|
||||||
if(!(graphFilename.equals(BiGpairSEQ.getGraphFilename()) || BiGpairSEQ.getGraph() == null)) {
|
if(!(graphFilename.equals(BiGpairSEQ.getGraphFilename())) || BiGpairSEQ.getGraph() == null) {
|
||||||
BiGpairSEQ.clearGraph();
|
BiGpairSEQ.clearGraph();
|
||||||
//read object data from file
|
//read object data from file
|
||||||
System.out.println("Reading graph data from file. This may take some time");
|
|
||||||
System.out.println("File I/O time is not included in results");
|
|
||||||
GraphDataObjectReader dataReader = new GraphDataObjectReader(graphFilename);
|
GraphDataObjectReader dataReader = new GraphDataObjectReader(graphFilename);
|
||||||
data = dataReader.getData();
|
data = dataReader.getData();
|
||||||
//set new graph in memory and new filename
|
//set new graph in memory and new filename
|
||||||
|
|||||||
3
src/main/java/META-INF/MANIFEST.MF
Normal file
3
src/main/java/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Main-Class: BiGpairSEQ
|
||||||
|
|
||||||
@@ -249,13 +249,13 @@ public class Simulator {
|
|||||||
double pairingErrorRate = (double) falseCount / (trueCount + falseCount);
|
double pairingErrorRate = (double) falseCount / (trueCount + falseCount);
|
||||||
BigDecimal pairingErrorRateTrunc = new BigDecimal(pairingErrorRate, mc);
|
BigDecimal pairingErrorRateTrunc = new BigDecimal(pairingErrorRate, mc);
|
||||||
//get list of well concentrations
|
//get list of well concentrations
|
||||||
List<Integer> wellPopulations = Arrays.asList(data.getWellConcentrations());
|
Integer[] wellPopulations = data.getWellConcentrations();
|
||||||
//make string out of concentrations list
|
//make string out of concentrations list
|
||||||
StringBuilder populationsStringBuilder = new StringBuilder();
|
StringBuilder populationsStringBuilder = new StringBuilder();
|
||||||
populationsStringBuilder.append(wellPopulations.remove(0).toString());
|
populationsStringBuilder.append(wellPopulations[0].toString());
|
||||||
for(Integer i: wellPopulations){
|
for(int i = 1; i < wellPopulations.length; i++){
|
||||||
populationsStringBuilder.append(", ");
|
populationsStringBuilder.append(", ");
|
||||||
populationsStringBuilder.append(i.toString());
|
populationsStringBuilder.append(wellPopulations[i].toString());
|
||||||
}
|
}
|
||||||
String wellPopulationsString = populationsStringBuilder.toString();
|
String wellPopulationsString = populationsStringBuilder.toString();
|
||||||
//total simulation time
|
//total simulation time
|
||||||
|
|||||||
Reference in New Issue
Block a user