Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f344b03
First pass at upgrade; mostly clean-up; also abstract "Plot" class
CodeByDrescher Dec 22, 2025
3846c50
Restructuring of files for organization and clarity
CodeByDrescher Dec 23, 2025
a5f06d6
[WIP] Adding features
CodeByDrescher Jan 8, 2026
de6339f
Fixed label / axis titling by expanding + updating libsedml
CodeByDrescher Jan 22, 2026
648fea0
Added algorithm to attempt to keep legend smaller
CodeByDrescher Jan 22, 2026
1ca4485
Semantic bug fixes, added cloning to sedml, fixed xml helper, etc.
CodeByDrescher Jan 23, 2026
4d65f06
Added model pruning and fixed bugs with writing models
CodeByDrescher Jan 27, 2026
664cbd2
Fixed NPE when mapping was null
CodeByDrescher Jan 27, 2026
6a66a80
Fixed bug where wrong variable type was created; wrong argument order
CodeByDrescher Jan 27, 2026
173984f
Fixed Plotting bug
CodeByDrescher Jan 28, 2026
ae1c4a3
Fixed comparing / hashing of SedBase + Change. Fixed another variable…
CodeByDrescher Jan 28, 2026
44d36fb
Added logging
CodeByDrescher Jan 28, 2026
d234763
Added safeguards to renaming of variable
CodeByDrescher Jan 28, 2026
26d6e3e
small bug fixes
CodeByDrescher Jan 28, 2026
15881fc
Attempting to solve why test is failing on remote
CodeByDrescher Jan 28, 2026
f5c261a
Fixing overzealous refactor
CodeByDrescher Jan 29, 2026
d32217d
Reducing require accuracy of pixels
CodeByDrescher Jan 29, 2026
42c5ad5
Fixed bad renames, and ensuring preserved order of biomodels
CodeByDrescher Jan 30, 2026
dbeabd1
Added Axis test (frist jlibsedml test!)
CodeByDrescher Jan 30, 2026
26d0bcb
Jim review modifications
CodeByDrescher Jan 30, 2026
a61751c
Jim review modifications II
CodeByDrescher Jan 30, 2026
6005781
Now using SSIM image comparison
CodeByDrescher Feb 2, 2026
f96f4be
Fixed incorrect formula
CodeByDrescher Feb 3, 2026
ca930c9
Making error clearer & findable
CodeByDrescher Feb 3, 2026
d36b0fd
Visually inspected results; look correct, getting detailed breakdown
CodeByDrescher Feb 3, 2026
c8f2f87
Attempting blurred solution
CodeByDrescher Feb 3, 2026
006b089
Accepting 90% accuracy MSSIM
CodeByDrescher Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ jobs:
mvn --batch-mode clean install dependency:copy-dependencies -Dgroups="${{ matrix.test-group }}"
fi

# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ failure() }}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}

CD:
name: CD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.vcell.sbml.OmexPythonUtils;
import org.vcell.sedml.ModelFormat;
import org.vcell.sedml.PublicationMetadata;
import org.vcell.sedml.SEDMLExporter;
import org.vcell.sedml.SedMLExporter;
import org.vcell.util.*;
import org.vcell.util.document.*;

Expand Down Expand Up @@ -466,7 +466,7 @@ public String query(BiomodelVCMLServerResource resource, User vcellUser) throws
return vcmlBigString.toString();
}

public ByteArrayRepresentation query(BiomodelOMEXServerResource resource, User vcellUser, boolean bSkipUnsupported, StringBuffer suggestedProjectName) throws SQLException, DataAccessException, XmlParseException, IOException, SEDMLExporter.SEDMLExportException, OmexPythonUtils.OmexValidationException {
public ByteArrayRepresentation query(BiomodelOMEXServerResource resource, User vcellUser, boolean bSkipUnsupported, StringBuffer suggestedProjectName) throws SQLException, DataAccessException, XmlParseException, IOException, SedMLExporter.SEDMLExportException, OmexPythonUtils.OmexValidationException {
if (vcellUser == null) {
vcellUser = VCellApiApplication.DUMMY_USER;
}
Expand All @@ -487,7 +487,7 @@ public ByteArrayRepresentation query(BiomodelOMEXServerResource resource, User v

Predicate<SimulationContext> simContextFilter = (SimulationContext sc) -> true;
if (bSkipUnsupported) {
Map<String, String> unsupportedApplications = SEDMLExporter.getUnsupportedApplicationMap(bioModel, modelFormat);
Map<String, String> unsupportedApplications = SedMLExporter.getUnsupportedApplicationMap(bioModel, modelFormat);
simContextFilter = (SimulationContext sc) -> !unsupportedApplications.containsKey(sc.getName());
}
String filenamePrefix = "VCDB_"+bioModelKey;
Expand All @@ -498,7 +498,7 @@ public ByteArrayRepresentation query(BiomodelOMEXServerResource resource, User v
suggestedProjectName.append(filenamePrefix);
try {
boolean bCreateOmexArchive = true;
SEDMLExporter.writeBioModel(bioModel, publicationMetadata, exportOmexFile, modelFormat, simContextFilter,
SedMLExporter.writeBioModel(bioModel, publicationMetadata, exportOmexFile, modelFormat, simContextFilter,
bHasPython, bRoundTripSBMLValidation, bCreateOmexArchive);
byte[] omexFileBytes = Files.readAllBytes(exportOmexFile.toPath());
return new ByteArrayRepresentation(omexFileBytes, BiomodelOMEXResource.OMEX_MEDIATYPE);
Expand Down
3 changes: 2 additions & 1 deletion vcell-cli/src/main/java/org/vcell/cli/run/ExecutionJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ public void executeArchive(boolean isBioSimSedml) throws BiosimulationsHdfWriter

private void executeSedmlDocument(String sedmlLocation, HDF5ExecutionResults cumulativeHdf5Results) throws IOException, PreProcessingException, ExecutionException {
BiosimulationLog.instance().updateSedmlDocStatusYml(sedmlLocation, BiosimulationLog.Status.QUEUED);
SedmlJob job = new SedmlJob(sedmlLocation, this.omexHandler, this.inputFile, this.outputDir, this.sedmlPath2d3d.toString(), this.cliRecorder, this.bKeepTempFiles, this.bExactMatchOnly, this.bSmallMeshOverride, this.logOmexMessage);
SedMLJob job = new SedMLJob(sedmlLocation, this.omexHandler, this.inputFile, this.outputDir, this.sedmlPath2d3d.toString(), this.cliRecorder, this.bKeepTempFiles, this.bExactMatchOnly, this.bSmallMeshOverride);
this.logOmexMessage.append("Processing ").append(job.SEDML_NAME).append(". ");
SedmlStatistics stats = job.preProcessDoc();
boolean hasSucceeded = job.simulateSedml(cumulativeHdf5Results);
this.anySedmlDocumentHasSucceeded |= hasSucceeded;
Expand Down
36 changes: 22 additions & 14 deletions vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jlibsedml.DataSet;
import org.jlibsedml.components.SId;
import org.jlibsedml.components.SedBase;
import org.jlibsedml.components.SedML;
import org.jlibsedml.components.dataGenerator.DataGenerator;
import org.jlibsedml.components.output.DataSet;
import org.jlibsedml.*;
import org.jlibsedml.components.output.Output;
import org.jlibsedml.components.output.Report;
import org.jlibsedml.components.simulation.UniformTimeCourse;
import org.vcell.cli.run.results.ValueHolder;
import org.vcell.sbml.vcell.lazy.LazySBMLNonSpatialDataAccessor;
import org.vcell.util.DataAccessException;
Expand Down Expand Up @@ -146,10 +153,11 @@ public static double[] interpLinear(double[] x, double[] y, double[] xi) throws
return yi;
}

public static HashMap<String, File> generateReportsAsCSV(SedML sedml, Map<DataGenerator, ValueHolder<LazySBMLNonSpatialDataAccessor>> organizedNonSpatialResults, File outDirForCurrentSedml) {
public static HashMap<SId, File> generateReportsAsCSV(SedMLDataContainer sedmlContainer, Map<DataGenerator, ValueHolder<LazySBMLNonSpatialDataAccessor>> organizedNonSpatialResults, File outDirForCurrentSedml) {
// finally, the real work
HashMap<String, File> reportsHash = new HashMap<>();
for (Output sedmlOutput : sedml.getOutputs()) {
SedML sedML = sedmlContainer.getSedML();
HashMap<SId, File> reportsHash = new HashMap<>();
for (Output sedmlOutput : sedML.getOutputs()) {
// We only want Reports
if (!(sedmlOutput instanceof Report sedmlReport)) {
if (logger.isDebugEnabled()) logger.info("Ignoring unsupported output `" + sedmlOutput.getId() + "` while CSV generation.");
Expand All @@ -168,11 +176,11 @@ public static HashMap<String, File> generateReportsAsCSV(SedML sedml, Map<DataGe
* * we search the sbml model to find the vcell variable name associated with the urn
*/
try {
List<DataSet> datasets = sedmlReport.getListOfDataSets();
List<DataSet> datasets = sedmlReport.getDataSets();
Map<DataSet, DataGenerator> dataGeneratorMapping = new LinkedHashMap<>();
for (DataSet dataset : datasets) {
DataGenerator referencedGenerator = sedml.getDataGeneratorWithId(dataset.getDataReference());
if (referencedGenerator == null) throw new NullPointerException("SedML DataGenerator referenced by report is missing!");
DataGenerator referencedGenerator = sedmlContainer.findDataGeneratorById(dataset.getDataReference());
if (null == referencedGenerator) throw new IllegalArgumentException("Unable to find data generator referenced in dataset: " + dataset.getDataReference());
if (!organizedNonSpatialResults.containsKey(referencedGenerator)) break;
dataGeneratorMapping.put(dataset, referencedGenerator);
}
Expand All @@ -184,22 +192,22 @@ public static HashMap<String, File> generateReportsAsCSV(SedML sedml, Map<DataGe

for (DataSet validDataSet: dataGeneratorMapping.keySet()) {
DataGenerator referencedGenerator = dataGeneratorMapping.get(validDataSet);
boolean isReservedVCellPrefix = validDataSet.getId().startsWith("__vcell_reserved_data_set_prefix__");
boolean isReservedVCellPrefix = validDataSet.getId().string().startsWith("__vcell_reserved_data_set_prefix__");
ValueHolder<LazySBMLNonSpatialDataAccessor> dataHolder = organizedNonSpatialResults.get(referencedGenerator);


boolean timeAlreadyIncluded = false;
int numTrials = dataHolder.listOfResultSets.size();
for(int i = 0; i < numTrials; i++) {
if (timeAlreadyIncluded) break;
if (validDataSet.getId().contains("time_")) timeAlreadyIncluded = true;
if (validDataSet.getId().string().contains("time_")) timeAlreadyIncluded = true;
LazySBMLNonSpatialDataAccessor data = dataHolder.listOfResultSets.get(i);

String formattedId = isReservedVCellPrefix ? "VCell::" + validDataSet.getId().substring(34) : validDataSet.getId();
String formattedId = isReservedVCellPrefix ? "VCell::" + validDataSet.getId().string().substring(34) : validDataSet.getId().string();
sb.append(RunUtils.generateCsvItem(formattedId, ',', false, i, numTrials));
sb.append(RunUtils.generateCsvItem(validDataSet.getLabel(), ',', true, i, numTrials));
String referencedGeneratorName = referencedGenerator.getName() == null ? "" : referencedGenerator.getName();
sb.append(RunUtils.generateCsvItem(referencedGeneratorName.isEmpty() ? referencedGenerator.getId() : referencedGenerator.getName(), ',', true, i, numTrials));
sb.append(RunUtils.generateCsvItem(referencedGeneratorName.isEmpty() ? referencedGenerator.getId().string() : referencedGenerator.getName(), ',', true, i, numTrials));
String[] dataStrings = Arrays.stream(data.getData().data()).boxed().map(String::valueOf).toArray(String[]::new);
sb.append(String.join(",", dataStrings)).append('\n');
} // end of trials loop
Expand Down Expand Up @@ -240,9 +248,9 @@ public static void zipResFiles(File dirFile) throws IOException {

// TODO: Add SED-ML name as base dirFile to avoid zipping all available CSV, PDF
// Map for naming to extension
Map<String, String> extensionListMap = new HashMap<String, String>() {{
put("csv", "reports.zip");
put("pdf", "plots.zip");
Map<String, String> extensionListMap = new HashMap<>() {{
this.put("csv", "reports.zip");
this.put("pdf", "plots.zip");
}};

for (String ext : extensionListMap.keySet()) {
Expand Down
Loading
Loading