Search in sources :

Example 41 with BigString

use of org.vcell.util.BigString in project vcell by virtualcell.

the class BNGOutput method insertEntitiesInNetFile.

public void insertEntitiesInNetFile(String entities, String kind) {
    if (entities == null) {
        return;
    }
    HashSet<Integer> netFileIndices = new HashSet<Integer>();
    for (int i = 0; i < bng_filenames.length; i++) {
        if (bng_filenames[i].toLowerCase().endsWith(BNG_NET_FILE_SUFFIX)) {
            netFileIndices.add(i);
        }
    }
    if (netFileIndices.size() != 1) {
        throw new RuntimeException("BioNetGen was unable to generate reaction network.");
    }
    int location = netFileIndices.iterator().next();
    String s = bng_fileContents[location].toString();
    String prologue = s.substring(0, s.indexOf("begin " + kind));
    String epilogue = s.substring(s.indexOf("end " + kind));
    String d = prologue;
    d += "begin " + kind + "\n";
    d += entities;
    d += epilogue;
    bng_fileContents[location] = new BigString(d);
}
Also used : BigString(org.vcell.util.BigString) BigString(org.vcell.util.BigString) HashSet(java.util.HashSet)

Example 42 with BigString

use of org.vcell.util.BigString in project vcell by virtualcell.

the class BNGOutput method extractCompartmentsFromNetFile.

public void extractCompartmentsFromNetFile() {
    HashSet<Integer> netFileIndices = new HashSet<Integer>();
    for (int i = 0; i < bng_filenames.length; i++) {
        if (bng_filenames[i].toLowerCase().endsWith(BNG_NET_FILE_SUFFIX)) {
            netFileIndices.add(i);
        }
    }
    if (netFileIndices.size() != 1) {
        throw new RuntimeException("BioNetGen was unable to generate reaction network.");
    }
    int location = netFileIndices.iterator().next();
    String s = bng_fileContents[location].toString();
    String p = BNGOutputFileParser.extractCompartments(s);
    bng_fileContents[location] = new BigString(p);
}
Also used : BigString(org.vcell.util.BigString) BigString(org.vcell.util.BigString) HashSet(java.util.HashSet)

Example 43 with BigString

use of org.vcell.util.BigString in project vcell by virtualcell.

the class LocalUserMetaDbServerMessaging method saveMathModel.

/**
 * getVersionInfo method comment.
 * @throws RemoteException
 */
public BigString saveMathModel(BigString mathModelXML, String[] independentSims) throws DataAccessException {
    try {
        log.print("LocalUserMetaDbServerMessaging.saveMathModel()");
        BigString savedMathModelXML = dbServerProxy.saveMathModel(mathModelXML, independentSims);
        return savedMathModelXML;
    } catch (DataAccessException e) {
        log.exception(e);
        throw e;
    } catch (Throwable e) {
        log.exception(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : BigString(org.vcell.util.BigString) DataAccessException(org.vcell.util.DataAccessException)

Example 44 with BigString

use of org.vcell.util.BigString in project vcell by virtualcell.

the class LocalUserMetaDbServerMessaging method saveMathModelAs.

/**
 * getVersionInfo method comment.
 * @throws RemoteException
 */
public BigString saveMathModelAs(BigString mathModelXML, String newName, String[] independentSims) throws DataAccessException {
    try {
        log.print("LocalUserMetaDbServerMessaging.saveMathModel(newName=" + newName + ")");
        BigString savedMathModelXML = dbServerProxy.saveMathModelAs(mathModelXML, newName, independentSims);
        return savedMathModelXML;
    } catch (DataAccessException e) {
        log.exception(e);
        throw e;
    } catch (Throwable e) {
        log.exception(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : BigString(org.vcell.util.BigString) DataAccessException(org.vcell.util.DataAccessException)

Example 45 with BigString

use of org.vcell.util.BigString in project vcell by virtualcell.

the class LocalUserMetaDbServerMessaging method getGeometryXML.

/**
 * getVersionInfo method comment.
 * @throws RemoteException
 */
public BigString getGeometryXML(KeyValue geometryKey) throws DataAccessException {
    try {
        log.print("LocalUserMetaDbServerMessaging.getGeometryXML(key=" + geometryKey + ")");
        BigString geometryXML = dbServerProxy.getGeometryXML(geometryKey);
        return geometryXML;
    } catch (DataAccessException e) {
        log.exception(e);
        throw e;
    } catch (Throwable e) {
        log.exception(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : BigString(org.vcell.util.BigString) DataAccessException(org.vcell.util.DataAccessException)

Aggregations

BigString (org.vcell.util.BigString)55 DataAccessException (org.vcell.util.DataAccessException)39 KeyValue (org.vcell.util.document.KeyValue)24 XmlParseException (cbit.vcell.xml.XmlParseException)22 BioModel (cbit.vcell.biomodel.BioModel)19 XMLSource (cbit.vcell.xml.XMLSource)19 SQLException (java.sql.SQLException)16 Simulation (cbit.vcell.solver.Simulation)15 User (org.vcell.util.document.User)15 BioModelInfo (org.vcell.util.document.BioModelInfo)13 SimulationContext (cbit.vcell.mapping.SimulationContext)12 SimulationStatusPersistent (cbit.vcell.server.SimulationStatusPersistent)10 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)10 RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)9 MathException (cbit.vcell.math.MathException)8 ExpressionException (cbit.vcell.parser.ExpressionException)8 VCSimulationIdentifier (cbit.vcell.solver.VCSimulationIdentifier)6 Connection (java.sql.Connection)6 MessageEvent (cbit.rmi.event.MessageEvent)5 MappingException (cbit.vcell.mapping.MappingException)5