-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
vcell-core/src/main/java/cbit/vcell/simdata/n5/N5Exporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package cbit.vcell.simdata.n5; | ||
|
||
import cbit.vcell.export.server.ExportConstants; | ||
import cbit.vcell.resource.PropertyLoader; | ||
import cbit.vcell.simdata.*; | ||
import cbit.vcell.solver.VCSimulationDataIdentifier; | ||
import cbit.vcell.solver.VCSimulationIdentifier; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.vcell.util.document.KeyValue; | ||
import org.vcell.util.document.User; | ||
|
||
import java.io.File; | ||
import java.util.Arrays; | ||
|
||
public class N5Exporter implements ExportConstants { | ||
private final static Logger lg = LogManager.getLogger(N5Exporter.class); | ||
|
||
public N5Exporter() { | ||
|
||
} | ||
|
||
public static void main(String[] args) throws Exception { | ||
String primaryDirStr = "~/.vcell/simdata/temp"; | ||
PropertyLoader.loadProperties(); | ||
//System.setProperty(PropertyLoader.installationRoot,"/Users/schaff/workspace/vcell"); | ||
User user = new User("schaff", new KeyValue("17")); | ||
KeyValue simKey = new KeyValue("1128909032"); | ||
VCSimulationIdentifier vcSimID = new VCSimulationIdentifier(simKey, user); | ||
VCSimulationDataIdentifier vcdID = new VCSimulationDataIdentifier(vcSimID, 0); | ||
|
||
Cachetable cachetable = new Cachetable(10 * Cachetable.minute, 1000000L); | ||
File primaryDir = new File(primaryDirStr); | ||
DataSetControllerImpl dataSetControllerImpl = new DataSetControllerImpl(cachetable, primaryDir, null); | ||
double[] allTimes = dataSetControllerImpl.getDataSetTimes(vcdID); | ||
|
||
// get dataset identifier for vcSimID | ||
VCData vcData = dataSetControllerImpl.getVCData(vcdID); | ||
OutputContext outputContext = new OutputContext(null); | ||
DataIdentifier[] dataIdentifiers = vcData.getVarAndFunctionDataIdentifiers(outputContext); | ||
DataIdentifier DexDataIdentifier = Arrays.stream(dataIdentifiers).filter(di -> di.getName().equals("Dex")).findFirst().get(); | ||
SimDataBlock simDataBlock = vcData.getSimDataBlock(outputContext, DexDataIdentifier.getName(), allTimes[0]); | ||
double[] Dex_dataBlockValues = simDataBlock.getData(); // X,Y,Z raster for time 0 for variable cAMP | ||
System.out.println("Dex_dataBlockValues.length = " + Dex_dataBlockValues.length); | ||
System.out.println("Dex_dataBlockValues[0] = " + Dex_dataBlockValues[0]); | ||
|
||
} | ||
} |