Moving inference.metabolic to probs repository.
This commit is contained in:
		@@ -1,303 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.LinkedList;
 | 
			
		||||
 | 
			
		||||
import eva2.server.go.individuals.AbstractEAIndividual;
 | 
			
		||||
import eva2.server.go.individuals.ESIndividualDoubleData;
 | 
			
		||||
import eva2.server.go.individuals.InterfaceDataTypeDouble;
 | 
			
		||||
import eva2.server.go.problems.AbstractOptimizationProblem;
 | 
			
		||||
import eva2.server.go.problems.InterfaceHasInitRange;
 | 
			
		||||
import eva2.tools.Mathematics;
 | 
			
		||||
import eva2.tools.des.RKSolver;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This class provides a collection of methods to compare two curves one against
 | 
			
		||||
 * the other and to optimize the parameters of a model to be fitted as close as
 | 
			
		||||
 * possible to given measurements.
 | 
			
		||||
 *
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 * @date Sept. 18 2006
 | 
			
		||||
 */
 | 
			
		||||
public abstract class AbstractCurveFittingProblem extends
 | 
			
		||||
		AbstractOptimizationProblem implements InterfaceHasInitRange,
 | 
			
		||||
		Serializable {
 | 
			
		||||
 | 
			
		||||
	protected AbstractEAIndividual best = null;
 | 
			
		||||
 | 
			
		||||
	protected LinkedList<String> metabolites;
 | 
			
		||||
 | 
			
		||||
	protected TimeSeries timeSeries;
 | 
			
		||||
 | 
			
		||||
	protected double xOffSet, noise, yOffSet;
 | 
			
		||||
 | 
			
		||||
	protected int m_ProblemDimension;
 | 
			
		||||
 | 
			
		||||
	protected double t0, t1;
 | 
			
		||||
 | 
			
		||||
	protected RKSolver solver;
 | 
			
		||||
 | 
			
		||||
	protected boolean monteCarlo = false;
 | 
			
		||||
 | 
			
		||||
	protected double[][] initRange;
 | 
			
		||||
 | 
			
		||||
	public AbstractCurveFittingProblem() {
 | 
			
		||||
		m_Template = new ESIndividualDoubleData();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void setIndividualTemplate(AbstractEAIndividual indy) {
 | 
			
		||||
		m_Template = indy;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * This method allows you to swich to an initialization that is completely
 | 
			
		||||
	 * by chance instead of a certain more sophisticated initialization
 | 
			
		||||
	 * procedure.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param mc
 | 
			
		||||
	 *            If true, a Monte Carlo initialization will be performed. Else
 | 
			
		||||
	 *            another possibly more sophisticated procedure will be started.
 | 
			
		||||
	 */
 | 
			
		||||
	public void setMonteCarloInitialization(boolean mc) {
 | 
			
		||||
		this.monteCarlo = mc;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @param individual
 | 
			
		||||
	 */
 | 
			
		||||
	public void evaluate(AbstractEAIndividual individual) {
 | 
			
		||||
		double fitness[] = this
 | 
			
		||||
				.doEvaluation(((InterfaceDataTypeDouble) individual)
 | 
			
		||||
						.getDoubleData());
 | 
			
		||||
		individual.SetFitness(fitness);
 | 
			
		||||
		if (this.best == null) {
 | 
			
		||||
			this.best = (AbstractEAIndividual) individual.clone();
 | 
			
		||||
		} else if (this.best.getFitness(0) > individual.getFitness(0)) {
 | 
			
		||||
			this.best = (AbstractEAIndividual) individual.clone();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @param x
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public double[] doEvaluation(double[] x) {
 | 
			
		||||
		double freturn[] = new double[1], fitness = 0;
 | 
			
		||||
		double[][] result = model(x);
 | 
			
		||||
 | 
			
		||||
		if (result == null) {
 | 
			
		||||
			freturn[0] = Double.MAX_VALUE;
 | 
			
		||||
			return freturn;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		freturn[0] = 0;
 | 
			
		||||
		if (this.solver != null)
 | 
			
		||||
			if (this.solver.isUnstable()) {
 | 
			
		||||
				freturn[0] += 10000;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		// for all metabolites
 | 
			
		||||
		for (int i = 0; (i < metabolites.size())
 | 
			
		||||
				&& (freturn[0] < Double.MAX_VALUE); i++)
 | 
			
		||||
			try {
 | 
			
		||||
				/*
 | 
			
		||||
				 * Metabolites, which have not been considered in the
 | 
			
		||||
				 * measurements should also be able to be simulated. They
 | 
			
		||||
				 * shouldn't contribute to the overall fitness.
 | 
			
		||||
				 */
 | 
			
		||||
				if (!timeSeries.containsMetabolite(metabolites.get(i)
 | 
			
		||||
						.toString())
 | 
			
		||||
						|| (timeSeries.numberOfMeasurements(metabolites.get(i)
 | 
			
		||||
								.toString()) == 0))
 | 
			
		||||
					continue;
 | 
			
		||||
 | 
			
		||||
				double[] times = this.timeSeries.getTimes(this.metabolites.get(
 | 
			
		||||
						i).toString()), values = this.timeSeries
 | 
			
		||||
						.getValues(this.metabolites.get(i).toString()), mvalue = new double[times.length];
 | 
			
		||||
				// model
 | 
			
		||||
				// values
 | 
			
		||||
 | 
			
		||||
				// tests:
 | 
			
		||||
				// boolean name = false;
 | 
			
		||||
				// for all measured times for the current metabolite
 | 
			
		||||
				for (int j = 0, min = 0, max = result.length - 1; j < times.length; j++) {
 | 
			
		||||
					/*
 | 
			
		||||
					 * This happens, if the parameters are that bad that the
 | 
			
		||||
					 * model function doesn't even produce sensefull values.
 | 
			
		||||
					 */
 | 
			
		||||
					if (result[result.length - 1][0] < times[j]) {
 | 
			
		||||
						mvalue[j] = Math.max(10000, 10000 * values[j]);
 | 
			
		||||
						continue;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
					if (times[j] != result[j][0]) {
 | 
			
		||||
						/*
 | 
			
		||||
						 * Seek the right time value from the model with an
 | 
			
		||||
						 * approach in logarithmic time. The variables min and
 | 
			
		||||
						 * max have been defined as an additional start
 | 
			
		||||
						 * condition of the for loop.
 | 
			
		||||
						 */
 | 
			
		||||
						int t = Math.round((max + min) / 2), t_old = t;
 | 
			
		||||
						do {
 | 
			
		||||
							t_old = t;
 | 
			
		||||
							if (result[t][0] < times[j]) {
 | 
			
		||||
								if (t < max)
 | 
			
		||||
									min = t + 1;
 | 
			
		||||
								else
 | 
			
		||||
									min = t;
 | 
			
		||||
							} else if (result[t][0] > times[j]) {
 | 
			
		||||
								if (t > min)
 | 
			
		||||
									max = t - 1;
 | 
			
		||||
								else
 | 
			
		||||
									max = t;
 | 
			
		||||
							} else
 | 
			
		||||
								break;
 | 
			
		||||
							t = Math.round((max + min) / 2);
 | 
			
		||||
						} while (t != t_old);
 | 
			
		||||
						/*
 | 
			
		||||
						 * Set min and max for the search of the next time
 | 
			
		||||
						 * (measured times are assumed to be ordered).
 | 
			
		||||
						 */
 | 
			
		||||
						min = t;
 | 
			
		||||
						max = result.length - 1;
 | 
			
		||||
 | 
			
		||||
						/*
 | 
			
		||||
						 * The model value for the i-th metabolite at time j is
 | 
			
		||||
						 * given by result[t][i+1] because the first column of
 | 
			
		||||
						 * result is the time.
 | 
			
		||||
						 */
 | 
			
		||||
						mvalue[j] = result[t][i + 1];
 | 
			
		||||
 | 
			
		||||
						/*
 | 
			
		||||
						 * These steps are necessary if the resulting model
 | 
			
		||||
						 * contains more than one value for one time step. In
 | 
			
		||||
						 * this case for the fitness the model value with the
 | 
			
		||||
						 * greatest distance to the measured value should be
 | 
			
		||||
						 * considered.
 | 
			
		||||
						 */
 | 
			
		||||
						int up = t, down = t;
 | 
			
		||||
						while (up < result.length - 1)
 | 
			
		||||
							if (result[up][0] == result[up + 1][0])
 | 
			
		||||
								up++;
 | 
			
		||||
							else
 | 
			
		||||
								break;
 | 
			
		||||
						while (down > 0)
 | 
			
		||||
							if (result[down][0] == result[down - 1][0])
 | 
			
		||||
								down--;
 | 
			
		||||
							else
 | 
			
		||||
								break;
 | 
			
		||||
						if (up != down)
 | 
			
		||||
							for (int k = down; k < up; k++)
 | 
			
		||||
								if (Math.abs(result[k][i + 1] - values[j]) > Math
 | 
			
		||||
										.abs(mvalue[j] - values[j]))
 | 
			
		||||
									mvalue[j] = result[k][i + 1];
 | 
			
		||||
 | 
			
		||||
						if ((result[t][0] > times[j]) && (t > 0)) {
 | 
			
		||||
							if (result[t - 1][0] < times[j]) {
 | 
			
		||||
								/*
 | 
			
		||||
								 * if (!name) {
 | 
			
		||||
								 * System.out.println(metabolites.get(i)+":");
 | 
			
		||||
								 * name=true; } System.out.println(
 | 
			
		||||
								 * result[t-1][0]+" = result["+(t-1)+"][0] <
 | 
			
		||||
								 * times["+j+"] = "+times[j]+" & "
 | 
			
		||||
								 * +result[t][0]+" = result["+t+"][0] >
 | 
			
		||||
								 * times["+j+"] = "+times[j]);//
 | 
			
		||||
								 */
 | 
			
		||||
								mvalue[j] = Mathematics.linearInterpolation(
 | 
			
		||||
										times[j], result[t - 1][0],
 | 
			
		||||
										result[t][0], result[t - 1][i + 1],
 | 
			
		||||
										mvalue[j]);
 | 
			
		||||
							} // otherwise we don't want to interpolate with
 | 
			
		||||
							// the value before
 | 
			
		||||
							// down.
 | 
			
		||||
						} else if ((result[t][0] < times[j])
 | 
			
		||||
								&& (t < result.length - 1)) {
 | 
			
		||||
							if (result[t + 1][0] > times[j]) {
 | 
			
		||||
								mvalue[j] = Mathematics.linearInterpolation(
 | 
			
		||||
										times[j], result[t][0],
 | 
			
		||||
										result[t + 1][0], mvalue[j],
 | 
			
		||||
										result[t + 1][i + 1]);
 | 
			
		||||
							} /*
 | 
			
		||||
								 * we don't want to interpolate with the value
 | 
			
		||||
								 * after up. This would propably smooth the
 | 
			
		||||
								 * error function.
 | 
			
		||||
								 */
 | 
			
		||||
						}
 | 
			
		||||
						/*
 | 
			
		||||
						 * We are lucky: the model already contains this time
 | 
			
		||||
						 * point. So we just need to use the given model value.
 | 
			
		||||
						 */
 | 
			
		||||
					} else {
 | 
			
		||||
						mvalue[j] = result[j][i + 1];
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
					/*
 | 
			
		||||
					 * This also happens with bad parameter values. Give a heavy
 | 
			
		||||
					 * weight to the current metabolite.
 | 
			
		||||
					 */
 | 
			
		||||
					if ((mvalue[j] == Double.NaN) || (mvalue[j] < 0))
 | 
			
		||||
						mvalue[j] = Math.max(10000, 10000 * values[j]);
 | 
			
		||||
				} // end for all times
 | 
			
		||||
 | 
			
		||||
				// average distance over all times
 | 
			
		||||
				/*
 | 
			
		||||
				 * fitness = Mathematics.dist(mvalue, values, 2)/times.length;
 | 
			
		||||
				 * freturn[0] += fitness;//
 | 
			
		||||
				 */
 | 
			
		||||
 | 
			
		||||
				// fitness = Mathematics.dist(mvalue, values, 2);
 | 
			
		||||
				fitness = Mathematics.relDist(mvalue, values, 10000);
 | 
			
		||||
				System.out.println(metabolites.get(i) + "\t" + fitness);
 | 
			
		||||
 | 
			
		||||
				if (!Double.isNaN(fitness) && !Double.isInfinite(fitness)) {
 | 
			
		||||
					freturn[0] += fitness;
 | 
			
		||||
				} else
 | 
			
		||||
					freturn[0] += 99999999999999999.; // TODO this should be
 | 
			
		||||
				// managed
 | 
			
		||||
				// differently?
 | 
			
		||||
 | 
			
		||||
			} catch (Exception exc) {
 | 
			
		||||
				exc.printStackTrace();
 | 
			
		||||
			}
 | 
			
		||||
		if (Double.isInfinite(freturn[0])
 | 
			
		||||
				|| (freturn[0] > 99999999999999999999.))
 | 
			
		||||
			freturn[0] = 99999999999999999999.;
 | 
			
		||||
		return freturn;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * This method returns the best individual of the complete optimization
 | 
			
		||||
	 * process, which is not neccessarily identical to the best individual of
 | 
			
		||||
	 * the final population.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return best The best Individual of the complete optimization process
 | 
			
		||||
	 */
 | 
			
		||||
	public AbstractEAIndividual getOverallBestIndividual() {
 | 
			
		||||
		return this.best;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Computes the differential equation describing the decrease or increase of
 | 
			
		||||
	 * the current metabolite in the metabolic network.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param x
 | 
			
		||||
	 *            The current parameters of the differential equation describing
 | 
			
		||||
	 *            the metabolic network.
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	public abstract double[][] model(double[] x);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	public int getProblemDimension() {
 | 
			
		||||
		return m_ProblemDimension;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public double[][] getInitRange() {
 | 
			
		||||
		return initRange;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void SetInitRange(double[][] initRange) {
 | 
			
		||||
		this.initRange = initRange;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,195 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.LinkedList;
 | 
			
		||||
 | 
			
		||||
import wsi.ra.math.RNG;
 | 
			
		||||
import eva2.server.go.individuals.AbstractEAIndividual;
 | 
			
		||||
import eva2.server.go.individuals.ESIndividualDoubleData;
 | 
			
		||||
import eva2.server.go.individuals.InterfaceDataTypeDouble;
 | 
			
		||||
import eva2.server.go.populations.Population;
 | 
			
		||||
import eva2.server.go.problems.inference.metabolic.odes.AbstractValineSystem;
 | 
			
		||||
import eva2.tools.des.RKSolver;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Super class for many simulation problems of the valine and leucine reaction
 | 
			
		||||
 * network in C. glutamicum.
 | 
			
		||||
 *
 | 
			
		||||
 * @since 2.0
 | 
			
		||||
 * @version
 | 
			
		||||
 * @author Andreas Dräger (draeger) <andreas.draeger@uni-tuebingen.de>
 | 
			
		||||
 *         Copyright (c) ZBiT, University of Tübingen, Germany Compiler:
 | 
			
		||||
 *         JDK 1.6.0
 | 
			
		||||
 * @date Sep 6, 2007
 | 
			
		||||
 */
 | 
			
		||||
public abstract class AbstractValineCurveFittingProblem extends
 | 
			
		||||
		AbstractCurveFittingProblem implements Serializable {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Start values for: DHIV, IPM, AcLac, Val, Leu, KIV, KIC in this order.
 | 
			
		||||
	 */
 | 
			
		||||
	protected final double[] y = { 0.132, 0.0227, 0.236, 29.4, 0.209, 13.1,
 | 
			
		||||
			0.0741 };
 | 
			
		||||
 | 
			
		||||
	protected AbstractValineSystem system;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = -194867821991525140L;
 | 
			
		||||
 | 
			
		||||
	public AbstractValineCurveFittingProblem(
 | 
			
		||||
			AbstractValineCurveFittingProblem avcfp) {
 | 
			
		||||
		if (avcfp.m_Template != null)
 | 
			
		||||
			this.m_Template = (AbstractEAIndividual) ((AbstractEAIndividual) avcfp.m_Template)
 | 
			
		||||
					.clone();
 | 
			
		||||
		this.system = avcfp.system;
 | 
			
		||||
		this.m_ProblemDimension = this.system.getNumberOfParameters();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Default constructor for simulation of the valine data.
 | 
			
		||||
	 */
 | 
			
		||||
	public AbstractValineCurveFittingProblem(AbstractValineSystem system) {
 | 
			
		||||
		this.solver = new RKSolver(.01);
 | 
			
		||||
		this.system = system;
 | 
			
		||||
		this.m_ProblemDimension = system.getNumberOfParameters();
 | 
			
		||||
		solver.setWithLinearCalc(false);
 | 
			
		||||
		m_Template = new ESIndividualDoubleData();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see eva2.server.go.OptimizationProblems.AbstractOptimizationProblem#initProblem()
 | 
			
		||||
	 */
 | 
			
		||||
	public void initProblem() {
 | 
			
		||||
		this.best = null;
 | 
			
		||||
		this.metabolites = new LinkedList<String>();
 | 
			
		||||
 | 
			
		||||
		this.timeSeries = new TimeSeries();
 | 
			
		||||
 | 
			
		||||
		// this.metabolites.add("PYR"); // 46
 | 
			
		||||
		// this.metabolites.add("AKG"); // 47
 | 
			
		||||
		// this.metabolites.add("ALA"); // 47
 | 
			
		||||
		// this.metabolites.add("NAD"); // 47
 | 
			
		||||
		this.metabolites.add("DHIV"); // 44
 | 
			
		||||
		// this.metabolites.add("nadp"); // 45
 | 
			
		||||
		// this.metabolites.add("Glut"); // 47
 | 
			
		||||
		this.metabolites.add("2IPM"); // 45
 | 
			
		||||
		this.metabolites.add("AcLac"); // 40
 | 
			
		||||
		this.metabolites.add("Val"); // 46
 | 
			
		||||
		this.metabolites.add("Leu"); // 47
 | 
			
		||||
		this.metabolites.add("KIV"); // 47
 | 
			
		||||
		this.metabolites.add("KIC"); // 47
 | 
			
		||||
 | 
			
		||||
		this.t0 = -3.894;
 | 
			
		||||
		this.t1 = 20.643;
 | 
			
		||||
 | 
			
		||||
		this.xOffSet = RNG.gaussianDouble(0.1);
 | 
			
		||||
		this.yOffSet = RNG.gaussianDouble(0.1);
 | 
			
		||||
		this.noise = RNG.gaussianDouble(0.1);
 | 
			
		||||
		initRange = new double[m_ProblemDimension][2];
 | 
			
		||||
		for (int i = 0; i < initRange.length; i++) {
 | 
			
		||||
			initRange[i][0] = 0;
 | 
			
		||||
			initRange[i][1] = 2;
 | 
			
		||||
		}
 | 
			
		||||
		this.SetInitRange(initRange);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void initPopulation(Population population) {
 | 
			
		||||
		int i;
 | 
			
		||||
		AbstractEAIndividual tmpIndy;
 | 
			
		||||
 | 
			
		||||
		best = null;
 | 
			
		||||
		population.clear();
 | 
			
		||||
 | 
			
		||||
		((InterfaceDataTypeDouble) m_Template)
 | 
			
		||||
				.setDoubleDataLength(initRange.length);
 | 
			
		||||
 | 
			
		||||
		// set the range
 | 
			
		||||
		double[][] range = getParameterRanges();
 | 
			
		||||
		((InterfaceDataTypeDouble) m_Template).SetDoubleRange(range);
 | 
			
		||||
 | 
			
		||||
		// for (i = 0; i < population.getPopulationSize(); i++) {
 | 
			
		||||
		Population tmpPop = new Population();
 | 
			
		||||
		if (population.getPopulationSize() < 250)
 | 
			
		||||
			tmpPop.setPopulationSize(250);
 | 
			
		||||
		else
 | 
			
		||||
			tmpPop.setPopulationSize(population.getPopulationSize());
 | 
			
		||||
		for (i = 0; i < tmpPop.getPopulationSize(); i++) {
 | 
			
		||||
			tmpIndy = (AbstractEAIndividual) ((AbstractEAIndividual) m_Template)
 | 
			
		||||
					.clone();
 | 
			
		||||
			// tmpIndy.init(this);
 | 
			
		||||
 | 
			
		||||
			// ////// B E G I N N ///////////////
 | 
			
		||||
			int j;
 | 
			
		||||
			double params[] = new double[m_ProblemDimension];
 | 
			
		||||
 | 
			
		||||
			for (j = 0; j < params.length; j++) {
 | 
			
		||||
				if (monteCarlo)
 | 
			
		||||
					params[j] = RNG.randomDouble(range[j][0], range[j][1]);
 | 
			
		||||
				else
 | 
			
		||||
					params[j] = RNG.gaussianDouble(1) + 1;
 | 
			
		||||
				if (params[j] < range[j][0]) {
 | 
			
		||||
					params[j] = range[j][0];
 | 
			
		||||
				}
 | 
			
		||||
				if (params[j] > range[j][1]) {
 | 
			
		||||
					params[j] = range[j][1];
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			tmpIndy.initByValue(params, this);
 | 
			
		||||
			// ////////E N D E /////////////////
 | 
			
		||||
 | 
			
		||||
			tmpPop.add(tmpIndy);
 | 
			
		||||
			// population.add(tmpIndy);
 | 
			
		||||
 | 
			
		||||
			// /////// B E G I N N //////////////
 | 
			
		||||
			((InterfaceDataTypeDouble) tmpIndy).SetDoublePhenotype(params);
 | 
			
		||||
			tmpIndy.resetConstraintViolation();
 | 
			
		||||
			params = ((InterfaceDataTypeDouble) tmpIndy).getDoubleData();
 | 
			
		||||
			for (j = 0; j < params.length; j++)
 | 
			
		||||
				if ((params[j] < ((InterfaceDataTypeDouble) m_Template)
 | 
			
		||||
						.getDoubleRange()[j][0])
 | 
			
		||||
						|| (params[j] > ((InterfaceDataTypeDouble) m_Template)
 | 
			
		||||
								.getDoubleRange()[j][1]))
 | 
			
		||||
					System.out.println("Verletzung!\t" + params[j]);// */
 | 
			
		||||
			if (tmpIndy.violatesConstraint())
 | 
			
		||||
				System.out.println("Constraint violation: "
 | 
			
		||||
						+ tmpIndy.getConstraintViolation());
 | 
			
		||||
			// ////// E N D E /////////////////
 | 
			
		||||
		}
 | 
			
		||||
		tmpPop.init();
 | 
			
		||||
 | 
			
		||||
		for (i = 0; i < population.getPopulationSize(); i++)
 | 
			
		||||
			population.add(tmpPop.remove(tmpPop.getIndexOfBestIndividual()));
 | 
			
		||||
		population.init();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * This method returns a matrix whose number of lines equals the number of
 | 
			
		||||
	 * parameters and which has two columns. In each line of this matrix the
 | 
			
		||||
	 * lower and the upper bound for the corresponding parameter are defined.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	protected abstract double[][] getParameterRanges();
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see simulation.AbstractCurveFittingProblem#model(double[])
 | 
			
		||||
	 */
 | 
			
		||||
	public double[][] model(double[] x) {
 | 
			
		||||
		try {
 | 
			
		||||
			system.setParameters(x);
 | 
			
		||||
			return solver.solveAtTimePointsIncludingTime(system, y,
 | 
			
		||||
					this.timeSeries.getTimes());
 | 
			
		||||
		} catch (Exception e) {
 | 
			
		||||
			e.printStackTrace();
 | 
			
		||||
			return null;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,81 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
import eva2.server.go.individuals.AbstractEAIndividual;
 | 
			
		||||
import eva2.server.go.individuals.InterfaceDataTypeDouble;
 | 
			
		||||
import eva2.server.go.problems.inference.metabolic.odes.AbstractValineSystem;
 | 
			
		||||
 | 
			
		||||
// Created at 2007-01-23
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public abstract class AbstractValineSplineFittingProblem extends
 | 
			
		||||
		AbstractValineCurveFittingProblem implements Serializable {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Default Serial Verison ID
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Constructor
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param s
 | 
			
		||||
	 */
 | 
			
		||||
	public AbstractValineSplineFittingProblem(AbstractValineSystem s) {
 | 
			
		||||
		super(s);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public AbstractValineSplineFittingProblem(GMAKiProblem problem) {
 | 
			
		||||
		super(problem);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public void evaluate(AbstractEAIndividual individual) {
 | 
			
		||||
		double fitness[] = new double[] { 0 }, result[][] = model(((InterfaceDataTypeDouble) individual)
 | 
			
		||||
				.getDoubleData());
 | 
			
		||||
 | 
			
		||||
		if (result == null) {
 | 
			
		||||
			fitness[0] = Double.MAX_VALUE;
 | 
			
		||||
		} else {
 | 
			
		||||
 | 
			
		||||
			if (solver != null)
 | 
			
		||||
				if (solver.isUnstable()) {
 | 
			
		||||
					fitness[0] += 10000;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
			for (int i = 0; i < result.length; i++) { // for all times
 | 
			
		||||
				double spline[] = new double[] { // get the spline values at
 | 
			
		||||
						// the
 | 
			
		||||
						// current time point.
 | 
			
		||||
						system.getDHIV(result[i][0]),
 | 
			
		||||
						system.getIPM(result[i][0]),
 | 
			
		||||
						system.getAcLac(result[i][0]),
 | 
			
		||||
						system.getVal(result[i][0]),
 | 
			
		||||
						system.getLeu(result[i][0]),
 | 
			
		||||
						system.getKIV(result[i][0]),
 | 
			
		||||
						system.getKIC(result[i][0]) };
 | 
			
		||||
				for (int j = 1; j < result[i].length
 | 
			
		||||
						&& (fitness[0] < Double.MAX_VALUE); j++)
 | 
			
		||||
					// for all metabolites
 | 
			
		||||
					if (spline[j - 1] != 0)
 | 
			
		||||
						fitness[0] += Math
 | 
			
		||||
								.pow(
 | 
			
		||||
										((result[i][j] - spline[j - 1]) / spline[j - 1]),
 | 
			
		||||
										2);
 | 
			
		||||
					else
 | 
			
		||||
						fitness[0] += 10000;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		individual.SetFitness(fitness);
 | 
			
		||||
		if (this.best == null) {
 | 
			
		||||
			this.best = (AbstractEAIndividual) individual.clone();
 | 
			
		||||
		} else if (this.best.getFitness(0) > individual.getFitness(0)) {
 | 
			
		||||
			this.best = (AbstractEAIndividual) individual.clone();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,85 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import eva2.server.go.problems.inference.metabolic.odes.CKMMiSystem;
 | 
			
		||||
import eva2.server.go.strategies.InterfaceOptimizer;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Created at 2007-02-04
 | 
			
		||||
 *
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public class CKMMiProblem extends AbstractValineCurveFittingProblem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = 3459101339325025847L;
 | 
			
		||||
 | 
			
		||||
	public CKMMiProblem() {
 | 
			
		||||
		super(new CKMMiSystem());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public CKMMiProblem(CKMMiProblem ckmmiProblem) {
 | 
			
		||||
		super(ckmmiProblem);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getName() {
 | 
			
		||||
		return "CKMMiProblem";
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	protected double[][] getParameterRanges() {
 | 
			
		||||
		int i;
 | 
			
		||||
		double[][] range = new double[m_ProblemDimension][2];
 | 
			
		||||
		for (i = 0; i < 9; i++) { // double[] kcat = new double[9]; // ->
 | 
			
		||||
			// p[0..9]
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		for (i = 9; i < 12; i++) { // double[] ki = new double[3]; // ->
 | 
			
		||||
			// p[9..11]
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		for (i = 12; i < 28; i++) { // double[] km = new double[16]; // ->
 | 
			
		||||
			// p[12..27]
 | 
			
		||||
			range[i][0] = 1E-8;
 | 
			
		||||
			range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		for (i = 28; i < 31; i++) { // double[] vm = new double[3]; // ->
 | 
			
		||||
			// p[28..30]
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		for (i = 31; i < 34; i++) { // double[] kmm = new double[3]; // ->
 | 
			
		||||
			// p[31..33]
 | 
			
		||||
			range[i][0] = 1E-8;
 | 
			
		||||
			range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		for (i = 34; i < 37; i++) { // double[] kia = new double[3]; // ->
 | 
			
		||||
			// p[34..36]
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 1E+8;
 | 
			
		||||
		}
 | 
			
		||||
		for (i = 37; i < 40; i++) { // double[] kib = new double[3]; // ->
 | 
			
		||||
			// p[37..39]
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 1E+8;
 | 
			
		||||
		}
 | 
			
		||||
		range[40][0] = 1E-8; // double acCoA = 0; // -> p[40]
 | 
			
		||||
		range[40][1] = 2000;
 | 
			
		||||
		return range;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Object clone() {
 | 
			
		||||
		return new CKMMiProblem(this);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getStringRepresentationForProblem(InterfaceOptimizer opt) {
 | 
			
		||||
		return "Parameter optimization problem for the valine and leucine biosynthesis"
 | 
			
		||||
				+ " in C. glutamicum, where 7 reactions are modeled using convenience kinetics"
 | 
			
		||||
				+ " and 3 reactions with Michaelis Menten kinetics. Only two reactions"
 | 
			
		||||
				+ " are considered reversible.";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,80 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import eva2.server.go.problems.InterfaceMultimodalProblem;
 | 
			
		||||
import eva2.server.go.problems.inference.metabolic.odes.CKMMrSystem;
 | 
			
		||||
import eva2.server.go.strategies.InterfaceOptimizer;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This class is a problem of the valine/leucine biosynthesis in C. glutamicum
 | 
			
		||||
 * and uses a combination of Michaelis-Menten and Convenience Kinetic, both
 | 
			
		||||
 * reversible.
 | 
			
		||||
 *
 | 
			
		||||
 * @date 2007-02-05
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public class CKMMrProblem extends AbstractValineCurveFittingProblem implements
 | 
			
		||||
		InterfaceMultimodalProblem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 *
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = -3120557413810402464L;
 | 
			
		||||
 | 
			
		||||
	public CKMMrProblem() {
 | 
			
		||||
		super(new CKMMrSystem());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public CKMMrProblem(CKMMrProblem ckmmrprob) {
 | 
			
		||||
		super(ckmmrprob);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getName() {
 | 
			
		||||
		return "CKMMrProblem";
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 * @see eva2.server.go.problems.inference.metabolic.AbstractValineCurveFittingProblem#getParameterRanges()
 | 
			
		||||
	 */
 | 
			
		||||
	public double[][] getParameterRanges() {
 | 
			
		||||
		int i;
 | 
			
		||||
 | 
			
		||||
		// double[] kcat = null, // <- params[0..6]
 | 
			
		||||
		// bcat = null, // <- params[7..13]
 | 
			
		||||
		// km = null, // <- params[14..43]
 | 
			
		||||
		// ki = null, // <- params[44..46]
 | 
			
		||||
		// vm = null, // <- params[47..50]
 | 
			
		||||
		// kia = null, // <- params[51..53]
 | 
			
		||||
		// kib = null; // <params[54..56]
 | 
			
		||||
		// double acCoA = 0, // <- params[57]
 | 
			
		||||
		// coA = 0; // <- params[58]
 | 
			
		||||
 | 
			
		||||
		// set the range
 | 
			
		||||
		double[][] range = new double[m_ProblemDimension][2];
 | 
			
		||||
		for (i = 0; i < range.length; i++) {
 | 
			
		||||
			// Reaktionen, bei denen CO2 entsteht, sind wahrscheinlich
 | 
			
		||||
			// irreversibel.
 | 
			
		||||
			if ((i < 14) || ((43 < i) && (i < 51)))
 | 
			
		||||
				range[i][0] = 0;
 | 
			
		||||
			else
 | 
			
		||||
				range[i][0] = 1E-8;
 | 
			
		||||
			if ((i > 50) && (i < 57))
 | 
			
		||||
				range[i][1] = 1E+8;
 | 
			
		||||
			else
 | 
			
		||||
				range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		return range;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Object clone() {
 | 
			
		||||
		return new CKMMrProblem(this);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getStringRepresentationForProblem(InterfaceOptimizer opt) {
 | 
			
		||||
		return "Parameter optimization problem for the valine and leucine biosynthesis"
 | 
			
		||||
				+ " in C. glutamicum, where 7 reactions are modeled using convenience kinetics"
 | 
			
		||||
				+ " and 3 reactions with Michaelis Menten kinetics. Only two reactions"
 | 
			
		||||
				+ " are considered irreversible.";
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -1,69 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import eva2.server.go.problems.inference.metabolic.odes.GMAKiSystem;
 | 
			
		||||
import eva2.server.go.strategies.InterfaceOptimizer;
 | 
			
		||||
 | 
			
		||||
// Created at 2007-02-02
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public class GMAKiProblem extends AbstractValineSplineFittingProblem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial version id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = -3635573692736142863L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Default constructor for simulation of the valine data.
 | 
			
		||||
	 */
 | 
			
		||||
	public GMAKiProblem() {
 | 
			
		||||
		super(new GMAKiSystem());
 | 
			
		||||
		m_ProblemDimension = system.getNumberOfParameters();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public GMAKiProblem(GMAKiProblem gmakiProblem) {
 | 
			
		||||
		super(gmakiProblem);
 | 
			
		||||
		this.m_ProblemDimension = system.getNumberOfParameters();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getName() {
 | 
			
		||||
		return "GMAKiProblem";
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 * @see eva2.server.go.problems.inference.metabolic.AbstractValineCurveFittingProblem#getParameterRanges()
 | 
			
		||||
	 */
 | 
			
		||||
	protected double[][] getParameterRanges() {
 | 
			
		||||
		int i;
 | 
			
		||||
		// set the range
 | 
			
		||||
		double[][] range = new double[this.m_ProblemDimension][2];
 | 
			
		||||
		for (i = 0; i < 12; i++) {
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		for (i = 12; i < this.m_ProblemDimension; i++) {
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 8;
 | 
			
		||||
		}
 | 
			
		||||
		return range;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see eva2.server.go.problems.AbstractOptimizationProblem#clone()
 | 
			
		||||
	 */
 | 
			
		||||
	public Object clone() {
 | 
			
		||||
		return new GMAKiProblem(this);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getStringRepresentationForProblem(InterfaceOptimizer opt) {
 | 
			
		||||
		return "Parameter optimization problem for the valine and leucine biosynthesis"
 | 
			
		||||
				+ " in C. glutamicum, where all reactions are modeled using generalized"
 | 
			
		||||
				+ " mass-action kinetics. Only two reactions are considered irreversible.";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,70 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import eva2.server.go.problems.InterfaceMultimodalProblem;
 | 
			
		||||
import eva2.server.go.problems.inference.metabolic.odes.GMAKrSystem;
 | 
			
		||||
import eva2.server.go.strategies.InterfaceOptimizer;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * In this problem, the valine/leucine reaction network in C. glutamicum is
 | 
			
		||||
 * simulated using a generalized mass-action approach.
 | 
			
		||||
 *
 | 
			
		||||
 * @since 2.0
 | 
			
		||||
 * @version
 | 
			
		||||
 * @author Andreas Dräger (draeger) <andreas.draeger@uni-tuebingen.de>
 | 
			
		||||
 *         Copyright (c) ZBiT, University of Tübingen, Germany Compiler:
 | 
			
		||||
 *         JDK 1.6.0
 | 
			
		||||
 * @date Sep 6, 2007
 | 
			
		||||
 */
 | 
			
		||||
public class GMAKrProblem extends AbstractValineCurveFittingProblem implements
 | 
			
		||||
		InterfaceMultimodalProblem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = 3423204672190772267L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Default constructor for simulation of the valine data.
 | 
			
		||||
	 */
 | 
			
		||||
	public GMAKrProblem() {
 | 
			
		||||
		super(new GMAKrSystem());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public GMAKrProblem(GMAKrProblem gmakrprob) {
 | 
			
		||||
		super(gmakrprob);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getName() {
 | 
			
		||||
		return "GMAKrProblem";
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 * @see eva2.server.go.problems.inference.metabolic.AbstractValineCurveFittingProblem#getParameterRanges()
 | 
			
		||||
	 */
 | 
			
		||||
	protected double[][] getParameterRanges() {
 | 
			
		||||
		int i;
 | 
			
		||||
		double[][] range = new double[m_ProblemDimension][2];
 | 
			
		||||
		for (i = 0; i < 18; i++) {
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		for (i = 18; i < m_ProblemDimension; i++) {
 | 
			
		||||
			range[i][0] = 0;
 | 
			
		||||
			range[i][1] = 2000;
 | 
			
		||||
		}
 | 
			
		||||
		return range;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Object clone() {
 | 
			
		||||
		return new GMAKrProblem(this);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getStringRepresentationForProblem(InterfaceOptimizer opt) {
 | 
			
		||||
		return "Parameter optimization problem for the valine and leucine biosynthesis"
 | 
			
		||||
				+ " in C. glutamicum, where all reactions are modeled using generalized"
 | 
			
		||||
				+ " mass-action kinetics. Only two reactions are considered irreversible.";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,111 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import eva2.server.go.problems.inference.metabolic.odes.GMMiSystem;
 | 
			
		||||
import eva2.server.go.strategies.InterfaceOptimizer;
 | 
			
		||||
 | 
			
		||||
// Created at 2007-01-18
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public class GMMiProblem extends AbstractValineCurveFittingProblem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = -7344294007783094303L;
 | 
			
		||||
 | 
			
		||||
	public GMMiProblem() {
 | 
			
		||||
		super(new GMMiSystem());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public GMMiProblem(GMMiProblem gmmiproblem) {
 | 
			
		||||
		super(gmmiproblem);
 | 
			
		||||
		this.m_ProblemDimension = system.getNumberOfParameters();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public String getName() {
 | 
			
		||||
		return "GMMiProblem";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see eva2.server.go.problems.inference.metabolic.AbstractValineCurveFittingProblem#getParameterRanges()
 | 
			
		||||
	 */
 | 
			
		||||
	protected double[][] getParameterRanges() {
 | 
			
		||||
		int i;
 | 
			
		||||
		double[][] range = new double[m_ProblemDimension][2];
 | 
			
		||||
 | 
			
		||||
		// BRENDA: k+1 k+2 k+4 k+5 k+7 k+8 k+9 l1 l2 Ki1 Ki2 Ki3 vm1 vm2 vm3
 | 
			
		||||
		// kia1
 | 
			
		||||
		// kia2 kia3 kib1 kib2 kib3 km1 km2 km3
 | 
			
		||||
		double[] min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 | 
			
		||||
				0, 0, 0, 1E-8, 1E-8, 1E-8 }, max = { 2000, 2000, 2000, 2000,
 | 
			
		||||
				2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000,
 | 
			
		||||
				2000, 1E+8, 1E+8, 1E+8, 1E+8, 1E+8, 1E+8, 2000, 2000, 2000 };
 | 
			
		||||
 | 
			
		||||
		/*
 | 
			
		||||
		 * for (i = 0; i < 7; i++) { // k, rate constants for forward reaction
 | 
			
		||||
		 * range[i][0] = 0.01; range[i][1] = 2000; } for (i = 7; i < 9; i++) { //
 | 
			
		||||
		 * l, rate constants for backward reaction range[i][0] = 0.01;
 | 
			
		||||
		 * range[i][1] = 2000; } for (i = 9; i < 12; i++) { // ki, Rate constant
 | 
			
		||||
		 * for inhibition of uncertain mechanism range[i][0] = 0.01; range[i][1] =
 | 
			
		||||
		 * 100; } for (i = 12; i < 15; i++) { // vm, Maximal reaction velocity
 | 
			
		||||
		 * range[i][0] = 0.1; range[i][1] = 2000; } for (i = 15; i < 18; i++) { //
 | 
			
		||||
		 * kia' == km/kia, Rate constant for inhibition of the enzyme
 | 
			
		||||
		 * range[i][0] = 0; range[i][1] = 100; } for (i = 18; i < 21; i++) { //
 | 
			
		||||
		 * kib' == 1/kib, Rate constant for inhibition of the enzyme substrate
 | 
			
		||||
		 * complex range[i][0] = 0; range[i][1] = 100; } for (i = 21; i < 24;
 | 
			
		||||
		 * i++) { // km, the Michaelis-Menten constant range[i][0] = 0.01;
 | 
			
		||||
		 * range[i][1] = 2000; } // AcCo, Constant specifying the concentration
 | 
			
		||||
		 * of Acetyl-CoA // This is not needed because p_4 already includes
 | 
			
		||||
		 * Acetyl-CoA implicitely. //range[24][0] = 0.01; //range[24][1] = 100; //
 | 
			
		||||
		 */
 | 
			
		||||
		for (i = 0; i < range.length; i++) {
 | 
			
		||||
			range[i][0] = min[i];
 | 
			
		||||
			range[i][1] = max[i];
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/*
 | 
			
		||||
		 * double initial[] = new double[] { 15.625991725476922, 2000.0, 0.0010,
 | 
			
		||||
		 * 0.0010, 0.0014167666438540366, 0.03914648793059087,
 | 
			
		||||
		 * 0.0012346931715111, 0.0010, 0.002922248833329009, 50.00050096623751,
 | 
			
		||||
		 * 25.00075000582071, 87.5001338911313, 0.0010, 0.0010, 0.0010,
 | 
			
		||||
		 * 99.99692409764904, 99.9470190144952, 100.0, 99.99999925494194,
 | 
			
		||||
		 * 99.99994374811648, 99.9999922933057, 2000.0, 1999.9999939464062,
 | 
			
		||||
		 * 2000.0,
 | 
			
		||||
		 *
 | 
			
		||||
		 * 30.76270291064184, 1000.0004988358473, 0.0010, 0.0010,
 | 
			
		||||
		 * 0.0017147897187887668, 0.04677587864891996, 0.0010852159729891494,
 | 
			
		||||
		 * 0.0010, 0.0025497199896605963, 96.87503280922212, 12.500875002910353,
 | 
			
		||||
		 * 93.75044398773962, 0.0010, 0.0010, 0.0010, 99.9999962747097,
 | 
			
		||||
		 * 99.98389044776184, 100.0, 99.90234374997726, 99.9999973224476,
 | 
			
		||||
		 * 99.99389646109051, 1999.9999701976926, 1999.9999664724041, 2000.0
 | 
			
		||||
		 *
 | 
			
		||||
		 *
 | 
			
		||||
		 * //10.773224990548886, 505.8899553355387, 0.0010, 0.0010, 0.0010,
 | 
			
		||||
		 * 0.0010, 0.0010, 0.0010, 0.0010, 100.0, //100.0, 100.0, 0.0010,
 | 
			
		||||
		 * 0.0010, 0.0010, 100.0, 0.0, 100.0, 100.0, 100.0, 0.0, 2000.0, 2000.0,
 | 
			
		||||
		 * 2000.0,
 | 
			
		||||
		 *
 | 
			
		||||
		 * //0.016, 6.1, 0.001, 0.001, 0.001, 0.01, 0.005, 0.7, 0.011, 0.011,
 | 
			
		||||
		 * 0.012, 35.3, 0.4, 0.001, 0.001, 0.001, 5, 5, 0.001, 5, 5, 10.9, 5, 5 };
 | 
			
		||||
		 * double choice = RandomNumberGenerator.randomDouble(0, 1);//
 | 
			
		||||
		 */
 | 
			
		||||
		return range;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Object clone() {
 | 
			
		||||
		return new GMMiProblem(this);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getStringRepresentationForProblem(InterfaceOptimizer opt) {
 | 
			
		||||
		return "Parameter optimization problem for the valine and leucine biosynthesis"
 | 
			
		||||
				+ " in C. glutamicum, where 7 reactions are modeled using generalized"
 | 
			
		||||
				+ " mass-action kinetics and 3 reactions using Michaelis-Menten kinetics. "
 | 
			
		||||
				+ "Only two reactions are considered reversible.";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,85 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import eva2.server.go.problems.inference.metabolic.odes.GMMrSystem;
 | 
			
		||||
import eva2.server.go.strategies.InterfaceOptimizer;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Created at 2007-02-04.
 | 
			
		||||
 *
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public class GMMrProblem extends AbstractValineCurveFittingProblem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial version id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = -3889975340670999788L;
 | 
			
		||||
 | 
			
		||||
	public GMMrProblem() {
 | 
			
		||||
		super(new GMMrSystem());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public GMMrProblem(GMMrProblem gmmrproblem) {
 | 
			
		||||
		super(gmmrproblem);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public String getName() {
 | 
			
		||||
		return "GMMrProblem";
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 * @see eva2.server.go.problems.inference.metabolic.AbstractValineCurveFittingProblem#getParameterRanges()
 | 
			
		||||
	 */
 | 
			
		||||
	protected double[][] getParameterRanges() {
 | 
			
		||||
		int i;
 | 
			
		||||
		/*
 | 
			
		||||
		 * a // <- params[0..6] 7 b // <- params[7..13] 7 vm // <-
 | 
			
		||||
		 * params[14..17] 4 km // <- params[18..21] 4 kia // <- params[22..24] 3
 | 
			
		||||
		 * kib // <- params[25..27] 3 ki // <- params[28..30] 3
 | 
			
		||||
		 */
 | 
			
		||||
		double[][] range = new double[m_ProblemDimension][2];
 | 
			
		||||
		double min[] = { 0.000000000, 0.000000000, 0.000000000, 0.000000000,
 | 
			
		||||
				0.000000000, 0.000000000, 0.000000000, 0.000000000,
 | 
			
		||||
				0.000000000, 0.000000000, 0.000000000, 0.000000000,
 | 
			
		||||
				0.000000000, 0.000000000, 0.000000000, 0.000000000,
 | 
			
		||||
				0.000000000, 0.000000000, 0.000000000, 0.000000000,
 | 
			
		||||
				0.407343614, 0.059890210, 0.008423761, 0.000000000,
 | 
			
		||||
				0.000000000, 0.000000000, 0.432428055, 0.000000000,
 | 
			
		||||
				0.000000000, 0.000000000, 0.000000000 };
 | 
			
		||||
		double max[] = { 16.012590, 10.398386, 14.983890, 9.367657, 16.011989,
 | 
			
		||||
				7.229141, 409.395094, 3.348859, 65.532900, 424.407762,
 | 
			
		||||
				426.881040, 2.753995, 6.234599, 8.552800, 2.216418, 16.623249,
 | 
			
		||||
				1031.701261, 9.238867, 9.110233, 6.765434, 8.693675, 6.798338,
 | 
			
		||||
				5.628473, 5.364593, 8.438638, 9.185120, 6.459422, 12.470121,
 | 
			
		||||
				426.124248, 335.241456, 638.222487 };
 | 
			
		||||
		for (i = 0; i < range.length; i++) {
 | 
			
		||||
			// Reaktionen, bei denen CO2 entsteht, sind wahrscheinlich
 | 
			
		||||
			// irreversibel.
 | 
			
		||||
			// if (i < 18) //((i == 7) || (i == 12))
 | 
			
		||||
			range[i][0] = min[i]; // 0;
 | 
			
		||||
			/*
 | 
			
		||||
			 * else range[i][0] = 1E-8;/
 | 
			
		||||
			 */
 | 
			
		||||
			if ((21 < i) && (i < 28))
 | 
			
		||||
				range[i][1] = max[i]; // 1E+8;
 | 
			
		||||
			else
 | 
			
		||||
				range[i][1] = max[i]; // 2000;
 | 
			
		||||
		}
 | 
			
		||||
		return range;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Object clone() {
 | 
			
		||||
		return new GMMrProblem(this);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public String getStringRepresentationForProblem(InterfaceOptimizer opt) {
 | 
			
		||||
		return "Parameter optimization problem for the valine and leucine biosynthesis"
 | 
			
		||||
				+ " in C. glutamicum, where 7 reactions are modeled using generalized"
 | 
			
		||||
				+ " mass-action kinetics and 3 reactions using Michaelis-Menten kinetics. "
 | 
			
		||||
				+ "Only two reactions are considered irreversible.";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,243 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
import java.util.Iterator;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.StringTokenizer;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This class is able to parse and store the contents of a time series data
 | 
			
		||||
 * file. These files are supposed to be a matrix, whose columns are separated by
 | 
			
		||||
 * spaces or tabs. Every row is supposed to contain a time value in the first
 | 
			
		||||
 * column. Every other column contains the concentration of the appropriate
 | 
			
		||||
 * metabolite. Because the concentrations of different metabolites are not
 | 
			
		||||
 * measured at the same time, it is possible that some values equal -1 or "NaN".
 | 
			
		||||
 * For a given metabolite this class provides methods to extract the appropriate
 | 
			
		||||
 * times as well as the concentration values from this file.
 | 
			
		||||
 *
 | 
			
		||||
 * @since 2.0
 | 
			
		||||
 * @version
 | 
			
		||||
 * @author Andreas Dräger (draeger) <andreas.draeger@uni-tuebingen.de>
 | 
			
		||||
 *         Copyright (c) ZBiT, University of Tübingen, Germany Compiler:
 | 
			
		||||
 *         JDK 1.6.0
 | 
			
		||||
 * @date Sep 6, 2007
 | 
			
		||||
 */
 | 
			
		||||
public class TimeSeries implements Serializable {
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
	 *
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = 5744947450930268722L;
 | 
			
		||||
 | 
			
		||||
String                      dataFile[]      = new String[] {
 | 
			
		||||
      "\"Time\" \"PYR\"          \"AKG\"   \"ALA\"   \"NAD\"     \"DHIV\"  \"nadp\"     \"Glut\"     \"2IPM\"    \"AcLac\"  \"Val\"      \"Leu\"    \"KIV\"     \"KIC\"",
 | 
			
		||||
      "-3.894  0.69956151035		4.640691888659999	0.8149815245099999	0.43831117728999996	0.12919945973		NaN			39.91322431689	0.01634219825	0.22846321864000002	25.300234279730002	0.31457001595	13.06542276153	0.12828553615000002",
 | 
			
		||||
      "-3.429  0.6887305946		4.4648219135		0.9733354471500001	0.46283738647		0.09269418599		0.01751164422		34.689755620279996	0.016622587119999997	0.26529057205	27.855794163480002	0.21601742448	12.27325468611	0.08806661914",
 | 
			
		||||
      "-2.964  0.648489239		5.16446833661		1.08501337472		0.510398731		0.09668719327		0.015292064690000001	35.94424701067	0.0218616059	0.24372308822	27.512009946459997	0.19358187491999998	11.83868901432	0.08060740248	",
 | 
			
		||||
      "-2.499  0.66263247645		5.46655875364		1.25007291486		0.54709779337		0.27832465706		0.02017254508		42.09304165779	0.02271131235	0.31096389668	31.734637769419997	0.26547698208000003	9.74938023117	0.09527994438000001	",
 | 
			
		||||
      "-2.037  0.78148116407		5.01023940504		1.1274704877		0.54374513457		0.10951589105		0.023434610419999998	38.623872567220005	0.02310058527	0.23193180999000002	28.68948017027	0.27338539200999995	9.8790791622	0.06856701949	",
 | 
			
		||||
      "-1.572  0.7976018096		4.50327160849		0.9657423536899999	0.58804343197		0.07731788865		0.021456078269999998	39.65098562534	0.02122962586	NaN	23.23780871601	0.21372010324	7.35589658416	0.04408823098	",
 | 
			
		||||
      "-1.107  0.62138120097		5.527992933249999	1.11320796018		0.55468774709		0.19127059402000002	0.02151432978		37.43103867786	0.021760915119999998	0.1961057295	28.06503640484	0.25571800238	7.77390798856	0.08440327591999999	",
 | 
			
		||||
      "-0.642  0.61440001723		5.6582676904		1.0934342424799999	0.57892866745		0.29234911798		0.02163427084		41.73288066597	0.02358943064	0.23458068462	31.36134966529	0.28291670151	8.77177024347	0.0732470093	",
 | 
			
		||||
      "0.363   0.70849102753		5.6485532671600005	1.07913785266		0.5494837929699999	0.22848890345		0.03264048454		40.837490521439996	0.02034557524	0.25195151103	27.336329975730003	0.1981060288	6.68584901645	0.07329936145	",
 | 
			
		||||
      "0.828   0.7284264133299999	5.24081938936		1.20656221781		0.56038053457		0.50828902006		0.02799224444		43.839863948079994	0.02365648322	0.33595864068	30.40658463215	0.25328480297	7.46481961657	0.06727204061	",
 | 
			
		||||
      "1.293   2.35072982926		12.865197464340001	2.91425720335		0.6174561459100001	0.51680611101		0.0180555805		45.00192868082	0.02789099302	0.27282017381999996	35.47319021015	0.34012252203000004	12.4841096615	0.12075887125	",
 | 
			
		||||
      "1.758   1.9467590874099998	9.85083850897		2.38135380833		0.47990344534		0.36137563687		0.02083824064		39.874833705	0.02603135155	0.24703878422	35.24799025209	0.25499939033	10.58660287792	0.12011356083	",
 | 
			
		||||
      "2.220   1.76234822871		12.57168005228		2.535743239		0.58312865514		0.17860360497		0.018047886200000002	48.82282962176	0.02531203769	NaN	31.84083292177	0.21013809416	8.79825645884	0.10474495756	",
 | 
			
		||||
      "2.685   1.92439252352		11.2260038878		2.8335955021		0.49220203429		0.16592713605		0.0278326992		39.75506759172	0.02115183034	0.24700121622	29.23941353308	0.22169631684000002	8.94277598226	0.09683684583	",
 | 
			
		||||
      "3.150   1.92008237217		10.682979534100001	2.63737602928		0.36735949621999997	0.1546055768		0.01515236183		39.012881840679995	NaN	0.46143297886	35.812552779769995	0.28387244697	14.20243053826	0.10933158105	",
 | 
			
		||||
      "4.620   1.81992606678		11.067551454270001	2.70934921435		0.40725580208999995	0.24849740356		0.027964720069999997	40.42309102465	0.0170493166	0.42824885292	37.17528380543	0.33573709864	15.33969385816	0.10861095009	",
 | 
			
		||||
      "5.085   1.45412618172		8.37506633272		2.5510691881399996	0.5402956812899999	0.29017599822		0.029667666019999997	52.86610489844	0.01551224716	0.37018809756000004	42.07773461152	0.32912302835999996	16.97282365372	0.1127063518	",
 | 
			
		||||
      "5.550   1.7963431670299999	10.9951402722		3.2730762781499996	0.49909124182		0.36584625016		0.031689318279999996	49.69757534082	0.030182574599999998	0.50230756817	44.18764066063	0.34318150693	14.45568137413	0.13087029789	",
 | 
			
		||||
      "6.015   1.79488675167		10.58210664143		2.82815659112		0.42028499769		0.33884287302		0.02904992542		47.618463449870006	0.02065291348	0.38243112459999995	41.68555649409	0.31270596242	14.18407754513	0.12297689406000001	",
 | 
			
		||||
      "6.477   1.71658915979		13.051632359080001	2.86429255047		0.69044126446		0.2906864281		0.02542790495		52.905505205989996	0.0363051233	0.46612294623	51.36020781111	0.52323119427	15.99708653385	0.13462198459000002	",
 | 
			
		||||
      "6.942   1.70200349375		11.29511994965		2.47410519106		0.61838724543		0.74141022319		0.02954918008		52.05561320903	0.03626130189	0.36020464648	47.08381733066	0.39496256108	15.29065040412	0.12714131781000002	",
 | 
			
		||||
      "7.407   1.4797133761099999	10.85092666902		2.73282139173		0.60893255673		0.91712444816		0.031866304570000004	54.69762263264	0.034354864900000004	0.50457338093	42.85485451463	0.35559022922000005	11.0783278302	0.11004224548000001	",
 | 
			
		||||
      "7.872   1.9687388421799998	12.632535436100001	3.38129932903		0.6733727859399999	1.19712426006		0.02287925851		69.03104100976	0.0346858365	0.6115046939	52.213982982809995	0.44352030561	14.17030298056	0.11817042216	",
 | 
			
		||||
      "8.877   1.66191235556		10.202950777509999	2.7018080554500004	0.65431385574		0.8630518573		0.03842550936		55.18740808596	0.03100906854	0.43636326995	44.94372991982	0.39590424030000004	11.87915174242	0.12055380252	",
 | 
			
		||||
      "9.342   1.79446423883		9.223736902639999	2.82086676673		0.46928184702		0.25036756575999997	0.0261580927		44.218411563610005	0.02307492312	0.37136132062	34.8715067452	0.23048150172999998	9.83227607934	0.08369892896	",
 | 
			
		||||
      "9.807   2.02936743557		10.926146897779999	3.40942786382		0.4943626997		0.41616779600000003	0.020775668350000002	57.63290012324	0.02453204368	0.59384364452	41.567799898539995	0.37314942280999996	11.524438278929999	0.10958751164	",
 | 
			
		||||
      "10.272  1.96339182674		11.26182399865		3.6725323889699997	0.51033452936		0.38195138421		0.02349833226		68.82889744295	0.02130776115	0.56596184217	43.85824526299	0.3563165939	10.882216090570001	0.11761378372	",
 | 
			
		||||
      "10.734  1.69522699956		9.28644900764		3.09521900994		0.46748976233		0.25486955073		0.024124165519999997	56.23949510944	0.01806823073	NaN	36.05982284756	0.25298007274	8.86586676025	0.07157556397999999	",
 | 
			
		||||
      "11.199  1.87021691917		9.68208305253		3.2919709268000004	0.5270903229299999	0.42322311943		0.0327964463		59.54087126072	0.022691202100000002	0.47737124454999996	41.842194656909996	0.28466758982	11.91006067162	0.09872917755999999	",
 | 
			
		||||
      "11.664  2.23471175262		12.19887299453		3.6051454388299997	0.54389398527		0.54313316601		0.01479252184		63.04737515095	0.02776861734	0.48410774037	46.409590689800005	0.44546516811	12.6862786223	0.10475246765999999	",
 | 
			
		||||
      "12.129  1.58626042008		9.99097297113		3.7513050785999997	0.42925918395999996	0.44080053731999996	0.013039703409999999	54.332315720649994	0.02735050961	0.31900140121	39.37877381533	0.32147277213000003	10.09758737431	0.08824555916	",
 | 
			
		||||
      "13.134  1.09179740401		6.491353226309999	2.26052958713		0.5481437170200001	NaN			0.01664214786		49.99620609066	0.02341309598	NaN	32.90242406736	0.29822072293	7.4630383928	0.0570285326	",
 | 
			
		||||
      "13.599  1.3879954566700001	9.38597812226		3.67292411291		0.41493699655		0.35712124297000003	0.01725904447		49.842043735	0.025759816390000002	0.40749356039	36.65749859265	0.31221753187	8.49907762956	0.08041935436999999	",
 | 
			
		||||
      "14.064  1.46398956252		9.514586394050001	3.8008622291900003	0.48941052945		0.43946239095		0.01718538349		54.47374486523	0.02895368422	0.48952197341	40.26813532416	0.40474806982	9.42390966864	0.07994405853	",
 | 
			
		||||
      "14.529  1.38755206855		8.484590611449999	3.2508142214399998	0.4940005127		0.48337445569		0.01893519951		47.84282639242	0.026125384369999997	0.4407703548	41.362606442570005	0.27053364357	11.06193869222	0.1028701703	",
 | 
			
		||||
      "14.991  0.88675119894		6.09938485345		2.0966046727900003	0.51403159937		0.25811120551		0.0228857864		44.11169057688	0.021193232819999998	NaN	31.027494313570003	0.22906790417	7.52510837768	0.053950203	",
 | 
			
		||||
      "15.456  1.8352414024800001	8.469270941569999	3.3301897663099997	0.4957035248		0.26361946777		0.025116875570000002	36.08517318062	0.025039514409999998	0.38916760052	38.21581762714	0.2746950311	11.731711424339998	0.12009641433	",
 | 
			
		||||
      "15.921  1.3283163392300001	8.17980680802		3.0409809543		0.38135485122		0.31612171511000003	0.01517163163		32.72595199009	0.02671292861	0.34622186149	42.07802536984	0.2542175654	12.23730313735	0.13746139785	",
 | 
			
		||||
      "16.386  1.0127505969		4.742491586150001	1.84597095725		0.34553761760999996	NaN	NaN		23.37116254961		NaN	NaN	NaN	0.15254582637	6.9247716185999995	0.07113160166999999	",
 | 
			
		||||
      "17.391  1.3310395982		7.94156759798		2.53879431682		0.48983728463		0.28795700924		0.026527055879999997	26.57827416636	0.02478540202	0.32631108383999996	33.95632215865	0.23618178628	10.48083524196	0.12515650878	",
 | 
			
		||||
      "17.856  0.95469028533		6.2343780867100005	2.17715476263		0.38729195765999996	0.28723013923		0.02123345169		24.49108607053	0.02618426224	0.29861161455	32.8592195428	0.2472225415	10.106162722479999	0.10923677735	",
 | 
			
		||||
      "18.321  NaN			5.49182392648		1.46886777519		0.34474738841999997	0.40646871383		0.01547566737		20.63720807926	0.02820014831	0.24058040600000002	40.71516409524	0.24270642545999999	14.12503277772	0.12899961175000002	",
 | 
			
		||||
      "18.786  0.82619105906		5.95530539146		2.299362329		0.44373946309		0.41075036223		0.02555677606		38.20802369971	0.02900285112	0.32959703389	34.213028316030005	0.25023635697	9.12222153162	0.10197379988000001	",
 | 
			
		||||
      "19.248  1.25881942787		6.53214282703		2.7302141736600003	0.50467802709		0.41526312678		0.02242466065		36.837815626659996	0.02483324467	0.38040913803	33.23783851764	0.23737761148	9.48079376972	0.11263783924000001	",
 | 
			
		||||
      "19.713  1.18507811227		5.4310205666		2.1360162267800002	0.46222885974		NaN			0.03397622205		28.19338823663	0.02104977904	NaN	25.47234120703	0.14638363385	7.60817737184	0.08542327693999999	",
 | 
			
		||||
      "20.178  0.98680703323		6.8729957498		2.34703189167		0.36189835991		0.35197395012		0.0170510439		26.43911126279	0.03024185129	0.30588350463	36.72827117308	0.23660664184000002	13.6943897464	0.16017717532	",
 | 
			
		||||
      "20.643  0.97377667062		6.15710096877		2.10492373702		0.46580796436000005	0.38984610765		0.020551778160000003	28.19084298145	0.02817732147	0.31660453741	33.563565688000004	0.17354025424	11.137671980450001	0.11278907400999999"};
 | 
			
		||||
 | 
			
		||||
  private int                 dataFileLineCnt = dataFile.length;
 | 
			
		||||
 | 
			
		||||
  private Map<String, Object> names;
 | 
			
		||||
 | 
			
		||||
  public static void main(String args[]) {
 | 
			
		||||
    new TimeSeries();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * This constructs a new instance of this class from the given file. All
 | 
			
		||||
   * entries of the given file are stored in a <java>String</java> matrix. The
 | 
			
		||||
   * names of the metabolites are stored in a hash for easy retrival.
 | 
			
		||||
   *
 | 
			
		||||
   * @param fileName
 | 
			
		||||
   */
 | 
			
		||||
  public TimeSeries() {
 | 
			
		||||
    try {
 | 
			
		||||
      int i = 0, j = 0;
 | 
			
		||||
      this.names = new HashMap<String, Object>();
 | 
			
		||||
      StringTokenizer st = new StringTokenizer(dataFile[0]);
 | 
			
		||||
 | 
			
		||||
      // Lesen zum ersten Mal und initialisieren Matrix.
 | 
			
		||||
      for (j = 0; st.hasMoreElements(); st.nextElement(), j++);
 | 
			
		||||
 | 
			
		||||
      String data[][] = new String[dataFileLineCnt - 1][j];
 | 
			
		||||
 | 
			
		||||
      // Jetzt in Matrix einlesen.
 | 
			
		||||
      for (i = 0; i < dataFileLineCnt; i++) {
 | 
			
		||||
        j = 0;
 | 
			
		||||
        st = new StringTokenizer(dataFile[i]);
 | 
			
		||||
        while (st.hasMoreElements())
 | 
			
		||||
          if (i > 0)
 | 
			
		||||
            data[i - 1][j++] = st.nextElement().toString();
 | 
			
		||||
          else names.put(st.nextElement().toString().replaceAll("\"", ""),
 | 
			
		||||
              new Integer(j++));
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      /*
 | 
			
		||||
       * for (i=0; i<data.length; i++) { System.out.print("\n"+data[i][0]+" ");
 | 
			
		||||
       * for (j=1; j<data[0].length; j++) { double val =
 | 
			
		||||
       * Double.parseDouble(data[i][j])/1000; System.out.print(val+"\t"); } }
 | 
			
		||||
       */
 | 
			
		||||
 | 
			
		||||
      /*
 | 
			
		||||
       * names becomes a hash pointing to matrices.
 | 
			
		||||
       */
 | 
			
		||||
      Iterator<String> iter = names.keySet().iterator();
 | 
			
		||||
      while (iter.hasNext())
 | 
			
		||||
        try {
 | 
			
		||||
          double values[][];
 | 
			
		||||
          int tcol = 0, count = 0;
 | 
			
		||||
          String name = iter.next().toString();
 | 
			
		||||
 | 
			
		||||
          i = 0;
 | 
			
		||||
          j = ((Integer) names.get(name)).intValue();
 | 
			
		||||
          for (i = 0; i < data.length; i++)
 | 
			
		||||
            if (!data[i][j].equals("-1") && !data[i][j].equals("NaN")) count++;
 | 
			
		||||
          values = new double[2][count];
 | 
			
		||||
//          /*
 | 
			
		||||
//           * The times are supposed to be the first column. However, this
 | 
			
		||||
//           * enables the times to be any column.
 | 
			
		||||
//           */
 | 
			
		||||
//          try {
 | 
			
		||||
//            tcol = ((Integer) this.names.get("Time")).intValue();
 | 
			
		||||
//          } catch (Exception exc) {
 | 
			
		||||
//          };
 | 
			
		||||
          for (i = 0, count = 0; i < data.length; i++)
 | 
			
		||||
            if (!data[i][j].equals("-1") && !data[i][j].equals("NaN")) {
 | 
			
		||||
              values[0][count] = Double.parseDouble(data[i][tcol]);
 | 
			
		||||
              values[1][count++] = Double.parseDouble(data[i][j]);
 | 
			
		||||
            }
 | 
			
		||||
          names.put(name, values);
 | 
			
		||||
        } catch (Exception exc) {
 | 
			
		||||
          exc.printStackTrace();
 | 
			
		||||
        }
 | 
			
		||||
      data = null;
 | 
			
		||||
    } catch (Exception exc) {
 | 
			
		||||
      exc.printStackTrace();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * With this method one retrives the time data of the given metabolite or
 | 
			
		||||
   * throws an <java>exception</java> if the given metabolite does not exist.
 | 
			
		||||
   *
 | 
			
		||||
   * @param metabolite
 | 
			
		||||
   *                The name of the metabolite, whose time data are desired.
 | 
			
		||||
   * @return The time data.
 | 
			
		||||
   * @throws Exception
 | 
			
		||||
   * @throws If
 | 
			
		||||
   *                 there is no entry for the desired metabolite, an exeption
 | 
			
		||||
   *                 is thrown.
 | 
			
		||||
   */
 | 
			
		||||
  public double[] getTimes(String metabolite) throws Exception {
 | 
			
		||||
    if (names == null) System.err.println("getTimes: names is null");
 | 
			
		||||
    if (!names.containsKey(metabolite))
 | 
			
		||||
      throw new Exception("No data measured for this metabolite");
 | 
			
		||||
    if (names.get(metabolite) == null) System.err.println("get(metabolite) is null");
 | 
			
		||||
    return ((double[][]) names.get(metabolite))[0];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * This method returns all measured times.
 | 
			
		||||
   *
 | 
			
		||||
   * @return An array containing all measurement times.
 | 
			
		||||
   * @throws Exception
 | 
			
		||||
   *                 If there is no column called "Time" in the data matrix.
 | 
			
		||||
   */
 | 
			
		||||
  public double[] getTimes() throws Exception {
 | 
			
		||||
    return getTimes("Time");
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * This method returns the concentration values of the given metabolite or
 | 
			
		||||
   * throws an exception if there is no measurement for the desired metabolite.
 | 
			
		||||
   *
 | 
			
		||||
   * @param metabolite
 | 
			
		||||
   *                The name of the desired metabolite.
 | 
			
		||||
   * @return an array of concentration values.
 | 
			
		||||
   * @throws Exception
 | 
			
		||||
   * @throws If
 | 
			
		||||
   *                 there is no entry for the desired metabolite, an exception
 | 
			
		||||
   *                 is thrown.
 | 
			
		||||
   */
 | 
			
		||||
  public double[] getValues(String metabolite) throws Exception {
 | 
			
		||||
    if (!names.containsKey(metabolite))
 | 
			
		||||
      throw new Exception("No data measured for this metabolite");
 | 
			
		||||
    return ((double[][]) names.get(metabolite))[1];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * With this method it can be checked wheather measurements have been
 | 
			
		||||
   * perforemd for the given metabolite.
 | 
			
		||||
   *
 | 
			
		||||
   * @param name
 | 
			
		||||
   *                The name of the metabolite
 | 
			
		||||
   * @return <code>true</code> if an entry for this metabolite exists or
 | 
			
		||||
   *         <code>false</code> otherwise.
 | 
			
		||||
   */
 | 
			
		||||
  public boolean containsMetabolite(String name) {
 | 
			
		||||
    return names.keySet().contains(name);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Returns the number of measurements taken for this specific metabolite or
 | 
			
		||||
   * zero if there are no measurements.
 | 
			
		||||
   *
 | 
			
		||||
   * @param name
 | 
			
		||||
   *                The name of the metabolite
 | 
			
		||||
   * @return The number of available measurement data for this metabolite
 | 
			
		||||
   */
 | 
			
		||||
  public int numberOfMeasurements(String name) {
 | 
			
		||||
    try {
 | 
			
		||||
      return getTimes(name).length;
 | 
			
		||||
    } catch (Exception exc) {
 | 
			
		||||
      return 0;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,156 +0,0 @@
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic.odes;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Created at 2007-02-03
 | 
			
		||||
 *
 | 
			
		||||
 * This class describes the valine/leucine biosynthesis in <it>Corynebacterium
 | 
			
		||||
 * glutamicum</it> acording to the convenience kinetics as proposed by
 | 
			
		||||
 * Liebermeister and Klipp. Three reaction velocities follow the traditional
 | 
			
		||||
 * Michaelis Menten scheme the others are given in the convenience kinetics. All
 | 
			
		||||
 * reactions are considered to be ehter reversible or irreversible according to
 | 
			
		||||
 * what is written in the KEGG database.
 | 
			
		||||
 *
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
public class CKMMiSystem extends AbstractValineSystem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = 8595111459805099502L;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 *
 | 
			
		||||
	 */
 | 
			
		||||
	public CKMMiSystem() {
 | 
			
		||||
		this.p = null;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @param params
 | 
			
		||||
	 *            The parameters of this system.
 | 
			
		||||
	 */
 | 
			
		||||
	public CKMMiSystem(double[] params) {
 | 
			
		||||
		this.p = params;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see javaeva.server.oa.go.OptimizationProblems.InferenceRegulatoryNetworks.Des.DESystem#getValue(double,
 | 
			
		||||
	 *      double[])
 | 
			
		||||
	 */
 | 
			
		||||
	public double[] getValue(double t, double[] Y) {
 | 
			
		||||
		// double[] kcat = new double[9]; // -> p[0..9]
 | 
			
		||||
		// double[] ki = new double[3]; // -> p[9..11]
 | 
			
		||||
		// double[] km = new double[16]; // -> p[12..27]
 | 
			
		||||
		// double[] vm = new double[3]; // -> p[28..30]
 | 
			
		||||
		// double[] kmm = new double[3]; // -> p[31..33]
 | 
			
		||||
		// double[] kia = new double[3]; // -> p[34..36]
 | 
			
		||||
		// double[] kib = new double[3]; // -> p[37..39]
 | 
			
		||||
		// double acCoA = 0; // -> p[40]
 | 
			
		||||
 | 
			
		||||
		double pyr = getPyr_2(t), nadp = getNADP_2(t), nadph = 0.04 - nadp, glut = getGlut_2(t), ala = getAla_2(t);
 | 
			
		||||
		/*
 | 
			
		||||
		 * Y[0] DHIV Y[1] IPM Y[2] AcLac Y[3] Val Y[4] Leu Y[5] KIV Y[6] KIC
 | 
			
		||||
		 */
 | 
			
		||||
 | 
			
		||||
		return linearCombinationOfVelocities(new double[] {
 | 
			
		||||
		/* Korrigiert: */
 | 
			
		||||
		// v_1: AHAS: convenience (ge<67>ndert)
 | 
			
		||||
				(p[0] * p[9] * Math.pow(pyr / p[12], 2))
 | 
			
		||||
						/ ((1 + pyr / p[12] + Math.pow(pyr / p[12], 2)) * (p[9] + Y[3])),
 | 
			
		||||
 | 
			
		||||
				// v_2: AHAIR: convenience (ge<67>ndert)
 | 
			
		||||
				(p[1] * Y[2] / p[13] * nadph / p[14] * p[10] - p[2] * Y[0]
 | 
			
		||||
						/ p[15] * nadp / p[16] * p[10])
 | 
			
		||||
						/ ((1 + Y[2] / p[13] + nadph / p[14] + (Y[2] * nadph)
 | 
			
		||||
								/ (p[13] * p[14]) + Y[0] / p[15] + nadp / p[16] + (Y[0] * nadp)
 | 
			
		||||
								/ (p[15] * p[16])) * (p[10] + Y[3])),
 | 
			
		||||
 | 
			
		||||
				// v_3: DHAD: reversible Michaelis Menten with two inhibitions
 | 
			
		||||
				// (ge<67>ndert)
 | 
			
		||||
				(p[28] * Y[0])
 | 
			
		||||
						/ (p[31] + Y[0] + Y[3] * (p[31] * p[34] + p[37] * Y[0])),
 | 
			
		||||
 | 
			
		||||
				// v_4: BCAAT_ValB: convenience (ge<67>ndert)
 | 
			
		||||
				(p[3] * Y[5] / p[17] * glut / p[18])
 | 
			
		||||
						/ (1 + Y[5] / p[17] + glut / p[18] + (Y[5] * glut)
 | 
			
		||||
								/ (p[17] * p[18])),
 | 
			
		||||
 | 
			
		||||
				// v_5: BCAAT_ValC: convenience (ge<67>ndert)
 | 
			
		||||
				(p[4] * Y[5] / p[19] * ala / p[20])
 | 
			
		||||
						/ (1 + Y[5] / p[19] + ala / p[20] + (Y[5] * ala)
 | 
			
		||||
								/ (p[19] * p[20])),
 | 
			
		||||
 | 
			
		||||
				// v_6: Trans_Val: irreversible Michaelis Menten with two
 | 
			
		||||
				// inhibitions
 | 
			
		||||
				(p[29] * Y[3])
 | 
			
		||||
						/ (p[32] + Y[3] + p[32] * p[35] * Y[4] + p[38] * Y[3]
 | 
			
		||||
								* Y[4]),
 | 
			
		||||
 | 
			
		||||
				// v_7: IPMS: convenience (AcCoA/K_m = p40) (ge<67>ndert)
 | 
			
		||||
				(p[5] * Y[5] / p[21] * p[40] * p[11])
 | 
			
		||||
						/ ((1 + Y[5] / p[21] + p[40] + p[40] * Y[5] / p[21]) * (p[11] + Y[4])),
 | 
			
		||||
 | 
			
		||||
				// v_8: IPMDH: convenience (ge<67>ndert)
 | 
			
		||||
				(p[6] * Y[1] / p[22] * nad / p[23])
 | 
			
		||||
						/ (1 + Y[1] / p[22] + nad / p[23] + (Y[1] * nad)
 | 
			
		||||
								/ (p[22] * p[23])),
 | 
			
		||||
 | 
			
		||||
				// v_9: BCAAT_LeuB: convenience (ge<67>ndert)
 | 
			
		||||
				(p[7] * Y[6] / p[24] * glut / p[25] - p[8] * Y[4] / p[26] * akg
 | 
			
		||||
						/ p[27])
 | 
			
		||||
						/ (1 + Y[6] / p[24] + glut / p[25] + (Y[6] * glut)
 | 
			
		||||
								/ (p[24] * p[25]) + Y[4] / p[26] + akg / p[27] + (Y[4] * akg)
 | 
			
		||||
								/ (p[26] * p[27])),
 | 
			
		||||
 | 
			
		||||
				// v_10: Trans_Leu: irreversible Michaelis Menten with two
 | 
			
		||||
				// inhibitions
 | 
			
		||||
				(p[30] * Y[4])
 | 
			
		||||
						/ (p[33] + Y[4] + p[33] * p[36] * Y[3] + p[39] * Y[3]
 | 
			
		||||
								* Y[4])
 | 
			
		||||
 | 
			
		||||
		/*
 | 
			
		||||
		 * zuvor: // AHAS: convenience (p[0] * pyr)/(p[9] * (1 + pyr/p[12] +
 | 
			
		||||
		 * Math.pow(pyr/p[12], 2)) + Y[3] * (1 + pyr/p[12] + Math.pow(pyr/p[12],
 | 
			
		||||
		 * 2))), // AHAIR: convenience (p[1] * Y[2] * nadph - p[2] * Y[0] *
 | 
			
		||||
		 * nadp)/((1 + Y[2]/p[13] + nadph/p[14] + (Y[2]*nadph)/(p[13]*p[14]) +
 | 
			
		||||
		 * Y[0]/p[15] + nadp/p[16] + (Y[0] * nadp)/(p[15] * p[16])) * p[10] *
 | 
			
		||||
		 * Y[3]), // DHAD: reversible Michaelis Menten with two inhibitions
 | 
			
		||||
		 * (p[28]* Y[0])/(p[31] + Y[0] + Y[3] * (p[28] * p[34] + p[37] * Y[0])), //
 | 
			
		||||
		 * BCAAT_ValB: convenience (p[3] * Y[5] * glut)/(1 + Y[5]/p[17] +
 | 
			
		||||
		 * glut/p[18] + (Y[5] * glut)/(p[17] * p[18])), // BCAAT_ValC:
 | 
			
		||||
		 * convenience (p[4] * Y[5] * ala)/(1 + Y[5]/p[19] + ala/p[20] + (Y[5] *
 | 
			
		||||
		 * ala)/(p[19] * p[20])), // Trans_Val: irreversible Michaelis Menten
 | 
			
		||||
		 * with two inhibitions (p[29] * Y[3])/(p[32] + Y[3] + p[32] * p[35] *
 | 
			
		||||
		 * Y[4] + p[38] * Y[3] * Y[4]), // IPMS: convenience (p[5] * Y[5])/((1 +
 | 
			
		||||
		 * Y[5]/p[21] + p[40] + (p[40] * Y[5])/p[21]) * (p[11] + Y[4])), //
 | 
			
		||||
		 * IPMDH: convenience (p[6] * Y[1] * nad)/(1 + Y[1]/p[22] + nad/p[23] +
 | 
			
		||||
		 * (Y[1] * nad)/(p[22] * p[23])), // BCAAT_LeuB: convenience (p[7] *
 | 
			
		||||
		 * Y[6] * glut - p[8] * Y[4] * akg)/(1 + Y[6]/p[24] + glut/p[25] + (Y[6] *
 | 
			
		||||
		 * glut)/(p[24] * p[25]) + Y[4]/p[26] + akg/p[27] + (Y[4] * akg)/(p[26] *
 | 
			
		||||
		 * p[27])), // Trans_Leu: irreversible Michaelis Menten with two
 | 
			
		||||
		 * inhibitions (p[30] * Y[4])/(p[33] + Y[4] + p[33] * p[36] * Y[3] +
 | 
			
		||||
		 * p[39] * Y[3] * Y[4])
 | 
			
		||||
		 */
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	public void getValue(double t, double[] Y, double[] resultVector) {
 | 
			
		||||
		double tmp[] = getValue(t, Y);
 | 
			
		||||
		System.arraycopy(tmp, 0, resultVector, 0, tmp.length);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public int getNumberOfParameters() {
 | 
			
		||||
		return 41;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,117 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic.odes;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This class describes the valine/leucine biosynthesis in <it>Corynebacterium
 | 
			
		||||
 * glutamicum</it> acording to the convenience kinetics as proposed by
 | 
			
		||||
 * Liebermeister and Klipp. Three reaction velocities follow the traditional
 | 
			
		||||
 * Michaelis Menten scheme the others are given in the convenience kinetics.
 | 
			
		||||
 * However, in this class all reactions are assumed to be reversible.
 | 
			
		||||
 *
 | 
			
		||||
 * @since 2.0
 | 
			
		||||
 * @version
 | 
			
		||||
 * @author Andreas Dräger (draeger) <andreas.draeger@uni-tuebingen.de>
 | 
			
		||||
 *         Copyright (c) ZBiT, University of Tübingen, Germany Compiler:
 | 
			
		||||
 *         JDK 1.6.0
 | 
			
		||||
 * @date 2007-02-05
 | 
			
		||||
 */
 | 
			
		||||
public class CKMMrSystem extends AbstractValineSystem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = 726678613269764327L;
 | 
			
		||||
	transient protected double velocities[] = null;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @param x
 | 
			
		||||
	 */
 | 
			
		||||
	public CKMMrSystem(double[] x) {
 | 
			
		||||
		this.p = x;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public CKMMrSystem() {
 | 
			
		||||
		super();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see eva2.server.go.OptimizationProblems.InferenceRegulatoryNetworks.Des.DESystem#getValue(double,
 | 
			
		||||
	 *      double[])
 | 
			
		||||
	 */
 | 
			
		||||
	public double[] getValue(double t, double[] Y) {
 | 
			
		||||
 | 
			
		||||
		double[] res = new double[7];
 | 
			
		||||
		getValue(t, Y, res);
 | 
			
		||||
		return res;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void getValue(double t, double[] Y, double[] res) {
 | 
			
		||||
		double pyr = getPyr_2(t), nadp = getNADP_2(t), nadph = 0.04 - nadp, glut = getGlut_2(t), akg = getAKG_2(t), ala = getAla_2(t), nad = getNAD_2(t), nadh = 0.8 - nad;
 | 
			
		||||
 | 
			
		||||
		if (velocities == null)
 | 
			
		||||
			velocities = new double[10];
 | 
			
		||||
 | 
			
		||||
		// v_1
 | 
			
		||||
		velocities[0] = ((p[0] * p[44] * Math.pow(pyr, 2)) / Math.pow(p[14], 2) - (p[7]
 | 
			
		||||
				* p[44] * Y[2])
 | 
			
		||||
				/ p[15])
 | 
			
		||||
				/ ((1 + pyr / p[14] + Math.pow(pyr / p[14], 2) + Y[2] / p[15]) * (p[44] + Y[3]));
 | 
			
		||||
		// v_2
 | 
			
		||||
		velocities[1] = ((p[1] * p[45] * Y[2] * nadph) / (p[16] * p[17]) - (p[8]
 | 
			
		||||
				* p[45] * Y[0] * nadp)
 | 
			
		||||
				/ (p[18] * p[19]))
 | 
			
		||||
				/ ((1 + Y[2] / p[16] + nadph / p[17] + (Y[2] * nadph)
 | 
			
		||||
						/ (p[16] * p[17]) + Y[0] / p[18] + nadp / p[19] + (Y[0] * nadp)
 | 
			
		||||
						/ (p[18] * p[19])) * (p[45] + Y[3]));
 | 
			
		||||
		// v_3
 | 
			
		||||
		velocities[2] = ((p[47] * Y[0]) / p[20] - (p[48] * Y[5]) / p[21])
 | 
			
		||||
				/ (1 + p[51] * Y[3] + (Y[0] / p[20] + Y[5] / p[21])
 | 
			
		||||
						* (1 + p[54] * Y[3]));
 | 
			
		||||
		// v_4
 | 
			
		||||
		velocities[3] = ((p[2] * Y[5] * glut) / (p[22] * p[23]) - (p[9] * Y[3] * akg)
 | 
			
		||||
				/ (p[24] * p[25]))
 | 
			
		||||
				/ (1 + Y[5] / p[22] + glut / p[23] + (Y[5] * glut)
 | 
			
		||||
						/ (p[22] * p[23]) + Y[3] / p[24] + akg / p[25] + (Y[3] * akg)
 | 
			
		||||
						/ (p[24] * p[25]));
 | 
			
		||||
		// v_5
 | 
			
		||||
		velocities[4] = ((p[3] * Y[5] * ala) / (p[26] * p[27]) - (p[10] * Y[3] * pyr)
 | 
			
		||||
				/ (p[28] * p[29]))
 | 
			
		||||
				/ (1 + Y[5] / p[26] + ala / p[27] + (Y[5] * ala)
 | 
			
		||||
						/ (p[26] * p[27]) + Y[3] / p[28] + pyr / p[29] + (Y[3] * pyr)
 | 
			
		||||
						/ (p[28] * p[29]));
 | 
			
		||||
		// v_6
 | 
			
		||||
		velocities[5] = (p[49] * Y[3])
 | 
			
		||||
				/ (p[30] + p[30] * p[52] * Y[4] + Y[3] + p[55] * Y[3] * Y[4]);
 | 
			
		||||
		// v_7
 | 
			
		||||
		velocities[6] = ((p[4] * p[46] * Y[5] * p[57]) / (p[31] * p[32]) - (p[11]
 | 
			
		||||
				* p[46] * Y[1] * p[58])
 | 
			
		||||
				/ (p[33] * p[34]))
 | 
			
		||||
				/ ((1 + Y[5] / p[31] + p[57] / p[32] + (Y[5] * p[57])
 | 
			
		||||
						/ (p[31] * p[32]) + Y[1] / p[33] + p[58] / p[34] + (Y[1] * p[58])
 | 
			
		||||
						/ (p[33] * p[34])) * (p[46] + Y[4]));
 | 
			
		||||
		// v_8
 | 
			
		||||
		velocities[7] = ((p[5] * Y[1] * nad) / (p[35] * p[36]) - (p[12] * Y[6] * nadh)
 | 
			
		||||
				/ (p[37] * p[38]))
 | 
			
		||||
				/ (1 + Y[1] / p[35] + nad / p[36] + (Y[1] * nad)
 | 
			
		||||
						/ (p[35] * p[36]) + Y[6] / p[37] + nadh / p[38] + (Y[6] * nadh)
 | 
			
		||||
						/ (p[37] * p[38]));
 | 
			
		||||
		// v_9
 | 
			
		||||
		velocities[8] = ((p[6] * Y[6] * glut) / (p[39] * p[40]) - (p[13] * Y[4] * akg)
 | 
			
		||||
				/ (p[41] * p[42]))
 | 
			
		||||
				/ (1 + Y[6] / p[39] + glut / p[40] + (Y[6] * glut)
 | 
			
		||||
						/ (p[39] * p[40]) + Y[4] / p[41] + akg / p[42] + (Y[4] * akg)
 | 
			
		||||
						/ (p[41] * p[42]));
 | 
			
		||||
		// v_10
 | 
			
		||||
		velocities[9] = (p[50] * Y[4])
 | 
			
		||||
				/ (p[43] + p[43] * p[53] * Y[3] + Y[4] + p[56] * Y[3] * Y[4]);
 | 
			
		||||
 | 
			
		||||
		linearCombinationOfVelocities(velocities, res);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public int getNumberOfParameters() {
 | 
			
		||||
		return 59;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -1,69 +0,0 @@
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic.odes;
 | 
			
		||||
 | 
			
		||||
// Created ad 2007-01-13
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * In this class the valine/leucine biosynthesis in Corynebacterium glutamicum
 | 
			
		||||
 * is modeled to be in many reactions irreversible according to what is written
 | 
			
		||||
 * in the KEGG database. Inhibition is modeled as negative exponential function.
 | 
			
		||||
 *
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
public class GMAKiSystem extends AbstractValineSystem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = -5893476466596099997L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param params
 | 
			
		||||
	 */
 | 
			
		||||
	public GMAKiSystem(double params[]) {
 | 
			
		||||
		this.p = params;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public GMAKiSystem() {
 | 
			
		||||
		this.p = null;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see javaeva.server.oa.go.OptimizationProblems.InferenceRegulatoryNetworks.Des.DESystem#getValue(double,
 | 
			
		||||
	 *      double[])
 | 
			
		||||
	 */
 | 
			
		||||
	public double[] getValue(double t, double[] Y) {
 | 
			
		||||
		return linearCombinationOfVelocities(new double[] {
 | 
			
		||||
				p[0] * Math.pow(getPyr_2(t), 2)
 | 
			
		||||
						* Math.exp((-p[12]) * Y[3]),
 | 
			
		||||
				(p[1] * Y[2] * (0.04 - getNADP_2(t)) - p[10] * Y[0]
 | 
			
		||||
						* getNADP_2(t))
 | 
			
		||||
						* Math.exp((-p[13]) * Y[3]),
 | 
			
		||||
				p[2] * Y[0] * Math.exp((-p[14]) * Y[3]),
 | 
			
		||||
				p[3] * getGlut_2(t) * Y[5],
 | 
			
		||||
				p[4] * getAla_2(t) * Y[5],
 | 
			
		||||
				p[5] * Y[3] * Math.exp((-p[15]) * Y[4]),
 | 
			
		||||
				p[6] * Y[5] * Math.exp((-p[16]) * Y[4]),
 | 
			
		||||
				p[7] * getNAD_2(t) * Y[1],
 | 
			
		||||
				p[8] * getGlut_2(t) * Y[6] - p[11] * getAKG_2(t)
 | 
			
		||||
						* Y[4],
 | 
			
		||||
				p[9] * Y[4] * Math.exp((-p[17]) * Y[3]) });
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void getValue(double t, double[] Y, double[] resultVector) {
 | 
			
		||||
		double tmp[] = getValue(t, Y);
 | 
			
		||||
		System.arraycopy(tmp, 0, resultVector, 0, tmp.length);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public int getNumberOfParameters() {
 | 
			
		||||
		return 18;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,116 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic.odes;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This class describes the valine/leucine biosynthesis in Corynebacterium
 | 
			
		||||
 * glutamicum. All 10 reactions are assumed to be reversible and modeled
 | 
			
		||||
 * following the generalized mass action kinetic, where inhibition is modeled
 | 
			
		||||
 * using the function 1/(1 + ki*[Inhibitor]).
 | 
			
		||||
 *
 | 
			
		||||
 * @date 2007-02-04
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public class GMAKrSystem extends AbstractValineSystem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = -5668558229555497614L;
 | 
			
		||||
	transient double[] veloc = null;
 | 
			
		||||
 | 
			
		||||
	public GMAKrSystem() {
 | 
			
		||||
		super();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @param params
 | 
			
		||||
	 */
 | 
			
		||||
	public GMAKrSystem(double params[]) {
 | 
			
		||||
		super();
 | 
			
		||||
		this.p = params;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see eva2.server.go.OptimizationProblems.InferenceRegulatoryNetworks.Des.DESystem#getValue(double,
 | 
			
		||||
	 *      double[])
 | 
			
		||||
	 */
 | 
			
		||||
	public double[] getValue(double t, double[] Y) {
 | 
			
		||||
		// a <- params[0..9]
 | 
			
		||||
		// b <- params[10..17]
 | 
			
		||||
		// g <- params[18..23]
 | 
			
		||||
		double[] res = new double[7];
 | 
			
		||||
		getValue(t, Y, res);
 | 
			
		||||
		return res;
 | 
			
		||||
		// return linearCombinationOfVelocities(new double[] {
 | 
			
		||||
		// (params[0] * Math.pow(getPyr_2(t), 2) - params[10] * Y[2])/ (1 +
 | 
			
		||||
		// params[18] * Y[3]), // Math.exp((-params[18]) * Y[3]),
 | 
			
		||||
		// (params[1] * Y[2] * (.04 - getNADP_2(t)) - params[11] * Y[0] *
 | 
			
		||||
		// getNADP_2(t)) / (1 + params[19] * Y[3]), // * Math.exp((-params[19])
 | 
			
		||||
		// *
 | 
			
		||||
		// Y[3]),
 | 
			
		||||
		// (params[2] * Y[0] - params[12] * Y[5]) / (1 + params[20] * Y[3]), //
 | 
			
		||||
		// *
 | 
			
		||||
		// // Math.exp((-params[20])
 | 
			
		||||
		// // *
 | 
			
		||||
		// // Y[3]),
 | 
			
		||||
		// params[3] * getGlut_2(t) * Y[5] - params[13] * getAKG_2(t) * Y[3],
 | 
			
		||||
		// params[4] * getAla_2(t) * Y[5] - params[14] * getPyr_2(t) * Y[3],
 | 
			
		||||
		// (params[5] * Y[3]) / (1 + params[21] * Y[4]), // *
 | 
			
		||||
		// // Math.exp((-params[21])
 | 
			
		||||
		// // * Y[4]),
 | 
			
		||||
		// (params[6] * Y[5] - params[15] * Y[1]) / (1 + params[22] * Y[4]), //
 | 
			
		||||
		// *
 | 
			
		||||
		// // Math.exp((-params[22])
 | 
			
		||||
		// // *
 | 
			
		||||
		// // Y[4]),
 | 
			
		||||
		// params[7] * getNAD_2(t) * Y[1] - params[16] * Y[6] * (.8 -
 | 
			
		||||
		// getNAD_2(t)),
 | 
			
		||||
		// params[8] * getGlut_2(t) * Y[6] - params[17] * getAKG_2(t) * Y[4],
 | 
			
		||||
		// (params[9] * Y[4]) / (1 + params[23] * Y[3]) // *
 | 
			
		||||
		// // Math.exp((-params[23])
 | 
			
		||||
		// // * Y[3])
 | 
			
		||||
		// });
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void getValue(double t, double[] Y, double[] res) {
 | 
			
		||||
		if (veloc == null)
 | 
			
		||||
			veloc = new double[10];
 | 
			
		||||
 | 
			
		||||
		veloc[0] = (p[0] * Math.pow(getPyr_2(t), 2) - p[10] * Y[2])
 | 
			
		||||
				/ (1 + p[18] * Y[3]); // Math.exp((-params[18]) * Y[3]),
 | 
			
		||||
		veloc[1] = (p[1] * Y[2] * (.04 - getNADP_2(t)) - p[11] * Y[0]
 | 
			
		||||
				* getNADP_2(t))
 | 
			
		||||
				/ (1 + p[19] * Y[3]); // * Math.exp((-params[19]) * Y[3]),
 | 
			
		||||
		veloc[2] = (p[2] * Y[0] - p[12] * Y[5])
 | 
			
		||||
				/ (1 + p[20] * Y[3]); // *
 | 
			
		||||
		// Math.exp((-params[20])
 | 
			
		||||
		// *
 | 
			
		||||
		// Y[3]),
 | 
			
		||||
		veloc[3] = p[3] * getGlut_2(t) * Y[5] - p[13] * getAKG_2(t)
 | 
			
		||||
				* Y[3];
 | 
			
		||||
		veloc[4] = p[4] * getAla_2(t) * Y[5] - p[14] * getPyr_2(t)
 | 
			
		||||
				* Y[3];
 | 
			
		||||
		veloc[5] = (p[5] * Y[3]) / (1 + p[21] * Y[4]); // *
 | 
			
		||||
		// Math.exp((-params[21])
 | 
			
		||||
		// * Y[4]),
 | 
			
		||||
		veloc[6] = (p[6] * Y[5] - p[15] * Y[1])
 | 
			
		||||
				/ (1 + p[22] * Y[4]); // *
 | 
			
		||||
		// Math.exp((-params[22])
 | 
			
		||||
		// *
 | 
			
		||||
		// Y[4]),
 | 
			
		||||
		veloc[7] = p[7] * getNAD_2(t) * Y[1] - p[16] * Y[6]
 | 
			
		||||
				* (.8 - getNAD_2(t));
 | 
			
		||||
		veloc[8] = p[8] * getGlut_2(t) * Y[6] - p[17] * getAKG_2(t)
 | 
			
		||||
				* Y[4];
 | 
			
		||||
		veloc[9] = (p[9] * Y[4]) / (1 + p[23] * Y[3]); // *
 | 
			
		||||
		linearCombinationOfVelocities(veloc, res);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public int getNumberOfParameters() {
 | 
			
		||||
		return 24;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,120 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic.odes;
 | 
			
		||||
 | 
			
		||||
// Created at 2007-01-18
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This class implements a system of ordinary differential equations describing
 | 
			
		||||
 * the valine and leucin biosynthesis in <it>Corynebacterium gluthamicum</i>.
 | 
			
		||||
 *
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public class GMMiSystem extends AbstractValineSystem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated version id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = 6119930633376953563L;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * <p>
 | 
			
		||||
	 * A vector of parameters it needed to initialize this class. The parameters
 | 
			
		||||
	 * are given as:
 | 
			
		||||
	 * </p>
 | 
			
		||||
	 * <ul>
 | 
			
		||||
	 * <li>params[0-6] = k, Rate constant for the forward reaction</li>
 | 
			
		||||
	 * <li>params[7-8] = l, Rate constant for the backward reaction</li>
 | 
			
		||||
	 * <li>params[9-11] = ki, Rate constant for inhibition of uncertain
 | 
			
		||||
	 * mechanism</li>
 | 
			
		||||
	 * <li>params[12-14] = vm, Maximal reaction velocity</li>
 | 
			
		||||
	 * <li>params[15-17] = kia, Rate constant for inhibition of the enzyme</li>
 | 
			
		||||
	 * <li>params[18-20] = kib, Rate constant for inhibition of the enzyme
 | 
			
		||||
	 * substrate complex</li>
 | 
			
		||||
	 * <li>params[21-23] = km, the Michaelis-Menten constant</li>
 | 
			
		||||
	 * </ul>
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param params
 | 
			
		||||
	 */
 | 
			
		||||
	public GMMiSystem(double[] params) {
 | 
			
		||||
		if (params != null)
 | 
			
		||||
			if (params.length != 24)
 | 
			
		||||
				throw new Error(
 | 
			
		||||
						"This ODE system needs exactly 24 parameters. Given are "
 | 
			
		||||
								+ params.length);
 | 
			
		||||
		this.p = params;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 *
 | 
			
		||||
	 *
 | 
			
		||||
	 */
 | 
			
		||||
	public GMMiSystem() {
 | 
			
		||||
		this.p = null;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see javaeva.server.oa.go.OptimizationProblems.InferenceRegulatoryNetworks.Des.DESystem#getValue(double,
 | 
			
		||||
	 *      double[])
 | 
			
		||||
	 */
 | 
			
		||||
	public double[] getValue(double t, double[] Y) {
 | 
			
		||||
		double[] v = new double[] {
 | 
			
		||||
		// v_1
 | 
			
		||||
				(p[0] * Math.pow(getPyr_2(t), 2)) / (1 + p[9] * Y[3]),
 | 
			
		||||
				// v_2
 | 
			
		||||
				(p[1] * Y[2] * (0.04 - getNADP_2(t)) - p[7] * Y[0]
 | 
			
		||||
						* getNADP_2(t))
 | 
			
		||||
						/ (1 + p[10] * Y[3]),
 | 
			
		||||
				// v_3
 | 
			
		||||
				// ((p[12] * Y[0])/p[21])/(1 + p[15] * Y[3] + (Y[0] + p[18] *
 | 
			
		||||
				// Y[3] *
 | 
			
		||||
				// Y[0])/p[21]),
 | 
			
		||||
				(p[12] * Y[0])
 | 
			
		||||
						/ (p[21] + Y[0] + p[21] * p[15] * Y[3] + p[18] * Y[0]
 | 
			
		||||
								* Y[3]),
 | 
			
		||||
				// v_4
 | 
			
		||||
				p[2] * Y[5] * getGlut_2(t),
 | 
			
		||||
				// v_5
 | 
			
		||||
				p[3] * Y[5] * getAla_2(t),
 | 
			
		||||
				// v_6
 | 
			
		||||
				// (p[13]/p[22] * Y[3])/(1 + p[16] * Y[4] + (Y[3] + p[19] * Y[4]
 | 
			
		||||
				// *
 | 
			
		||||
				// Y[3])/p[22]),
 | 
			
		||||
				(p[13] * Y[3])
 | 
			
		||||
						/ (p[22] + Y[3] + p[22] * p[16] * Y[4] + p[19] * Y[3]
 | 
			
		||||
								* Y[4]),
 | 
			
		||||
				// v_7
 | 
			
		||||
				(p[4] * Y[5]) / (1 + p[11] * Y[4]),
 | 
			
		||||
				// v_8
 | 
			
		||||
				p[5] * Y[1] * getNAD_2(t),
 | 
			
		||||
				// v_9
 | 
			
		||||
				p[6] * Y[6] * getGlut_2(t) - p[8] * Y[4] * getAKG_2(t),
 | 
			
		||||
				// v_10
 | 
			
		||||
				// ((p[14] * Y[4])/p[23])/(1 + p[17] * Y[3] + (Y[4] + p[20] *
 | 
			
		||||
				// Y[3] *
 | 
			
		||||
				// Y[4])/p[23])
 | 
			
		||||
				(p[14] * Y[4])
 | 
			
		||||
						/ (p[23] + Y[4] + p[17] * p[23] * Y[3] + p[20] * Y[3]
 | 
			
		||||
								* Y[4]) };
 | 
			
		||||
 | 
			
		||||
		/*
 | 
			
		||||
		 * if ((Double.isNaN(v[0]) || Double.isInfinite(v[0])) && (t < -1.784)) {
 | 
			
		||||
		 * System.out.println(t+". Nenner: "+(1 + p[9] * Y[3])+"\tY[3] =
 | 
			
		||||
		 * "+Y[3]+"\tparam9 = "+p[9]); }//
 | 
			
		||||
		 */
 | 
			
		||||
		return linearCombinationOfVelocities(v);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void getValue(double t, double[] Y, double[] resultVector) {
 | 
			
		||||
		double tmp[] = getValue(t, Y);
 | 
			
		||||
		System.arraycopy(tmp, 0, resultVector, 0, tmp.length);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public int getNumberOfParameters() {
 | 
			
		||||
		return 24;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,87 +0,0 @@
 | 
			
		||||
package eva2.server.go.problems.inference.metabolic.odes;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This class describes the valine/leucine biosynthesis in Corynebacterium
 | 
			
		||||
 * gluthamicum where three reactions are modeled using traditional reversible
 | 
			
		||||
 * Michaelis Menten kinetics and the remaining reactions are modeled using
 | 
			
		||||
 * reversible generalized mass action kinetics, where inhibition is modeled
 | 
			
		||||
 * using 1/(1 + ki*[Inhibitor]). Created at 2007-02-04.
 | 
			
		||||
 *
 | 
			
		||||
 * @author Andreas Dräger
 | 
			
		||||
 */
 | 
			
		||||
public class GMMrSystem extends AbstractValineSystem {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Generated serial id.
 | 
			
		||||
	 */
 | 
			
		||||
	private static final long serialVersionUID = 7461506193192163451L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 *
 | 
			
		||||
	 */
 | 
			
		||||
	public GMMrSystem() {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @param params
 | 
			
		||||
	 */
 | 
			
		||||
	public GMMrSystem(double[] params) {
 | 
			
		||||
		this.p = params;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * (non-Javadoc)
 | 
			
		||||
	 *
 | 
			
		||||
	 * @see eva2.server.go.OptimizationProblems.InferenceRegulatoryNetworks.Des.DESystem#getValue(double,
 | 
			
		||||
	 *      double[])
 | 
			
		||||
	 */
 | 
			
		||||
	public double[] getValue(double t, double[] Y) {
 | 
			
		||||
		/*
 | 
			
		||||
		 * double[] a = null, // <- params[0..6] 7 b = null, // <- params[7..13]
 | 
			
		||||
		 * 7 vm = null, // <- params[14..17] 4 km = null, // <- params[18..21] 4
 | 
			
		||||
		 * kia = null, // <- params[22..24] 3 kib = null, // <- params[25..27] 3
 | 
			
		||||
		 * ki = null; // <- params[28..30] 3 //
 | 
			
		||||
		 */
 | 
			
		||||
 | 
			
		||||
		return linearCombinationOfVelocities(new double[] {
 | 
			
		||||
		// v_1
 | 
			
		||||
				(p[0] * Math.pow(getPyr_2(t), 2) - p[7] * Y[2])
 | 
			
		||||
						/ (1 + p[28] * Y[3]),
 | 
			
		||||
				// v_2
 | 
			
		||||
				(p[1] * Y[2] * (.04 - getNADP_2(t)) - p[8] * Y[0]
 | 
			
		||||
						* getNADP_2(t))
 | 
			
		||||
						/ (1 + p[29] * Y[3]),
 | 
			
		||||
				// v_3
 | 
			
		||||
				((p[14] * Y[0]) / p[18] - (p[15] * Y[5]) / p[19])
 | 
			
		||||
						/ (1 + p[22] * Y[3] + (Y[0] / p[18] + Y[5] / p[19])
 | 
			
		||||
								* (1 + p[25] * Y[3])),
 | 
			
		||||
				// v_4
 | 
			
		||||
				p[2] * Y[5] * getGlut_2(t) - p[9] * Y[3] * getAKG_2(t),
 | 
			
		||||
				// v_5
 | 
			
		||||
				p[3] * Y[5] * getAla_2(t) - p[10] * Y[3] * getPyr_2(t),
 | 
			
		||||
				// v_6
 | 
			
		||||
				(p[16] * Y[3])
 | 
			
		||||
						/ (p[20] + p[20] * p[23] * Y[4] + Y[3] + p[26] * Y[4]
 | 
			
		||||
								* Y[3]),
 | 
			
		||||
				// v_7
 | 
			
		||||
				(p[4] * Y[5] - p[11] * Y[1]) / (1 + p[30] * Y[4]),
 | 
			
		||||
				// v_8
 | 
			
		||||
				p[5] * Y[1] * getNAD_2(t) - p[12] * Y[6] * (.8 - getNAD_2(t)),
 | 
			
		||||
				// v_9
 | 
			
		||||
				p[6] * Y[6] * getGlut_2(t) - p[13] * Y[4] * getAKG_2(t),
 | 
			
		||||
				// v_10
 | 
			
		||||
				(p[17] * Y[4])
 | 
			
		||||
						/ (p[21] + p[21] * p[24] * Y[3] + Y[4] + p[27] * Y[3]
 | 
			
		||||
								* Y[4]) });
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void getValue(double t, double[] Y, double[] resultVector) {
 | 
			
		||||
		resultVector = getValue(t, Y);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public int getNumberOfParameters() {
 | 
			
		||||
		return 31;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user