Keywords: DeveloppersGuide

## New ion species

MELTING is currently using the algorithm from Owczarzy et al, 2008 (see the MELTING documentation for the complete reference.)to correct the computed melting temperature depending on the ion concentrations. This algorithm can take into account the effect of monovalent cations and one divalent cation : the magnesium.
1) If the new ion species can be integrated into the algorithm of Owczarzy et al, 2008, you have to change the method public CorrectionMethod getIonCorrectionMethod (Environment environment) of the RegisterMethods class in the melting.configuration package. Otherwise, you must report to the following section for new denaturing agents even thought the new species is not a denaturing agent.

    public CorrectionMethod getIonCorrectionMethod
                                      (Environment environment){

    		// A specific ion correction is required by the user.
    		if (environment.getOptions().containsKey
    		                    (OptionManagement.ionCorrection)){
    		[...]
    		}

    		// No specific ion correction is required, the
    		// algorithm from Owczarzy et al, 2008 will now be
    		// used. You have to include your new ion species
    		// here.
    		else{

    		// If it is a new monovalent cation, you must change
    		// the monovalent concentration.
    		double monovalent = environment.getNa() + environment.getK()
    		                  + environment.getTris() / 2
    		                  + environment.getNewSpecies();

    		[...]

    		// Here are the important variable you may have to
    		// change to integrate your new ion species (if it
    		// is a divalent cation or other ion and you know a
    		// relationship between magnesium concentration and
    		// this new ion species.)
    		double Mg = environment.getMg() - environment.getDNTP();
    		double ratio = Math.sqrt(Mg) / monovalent;

    		[...]
    		}
    }

2) If you know a relationship between your new ion species and Na, Mg, Tris or K, don't forget to add your new ion species in the different classes computing a sodium equivalence in the melting.ionCorrection.SodiumEquivalent package. You will have to change the following methods :

In the different classes from the melting.ionCorrection.SodiumEquivalent package.

    public double computeSodiumEquivalent(double Na, double Mg,
          double K,double Tris, double dNTP, double newSpecies) {

    		// Change the base implementation in the SodiumEquivalent
    		// class too.
    		double NaEq = super.getSodiumEquivalent(Na, Mg, K, Tris,
    		                     dNTP, double newSpecies, parameter);

    		[...]

    		return NaEq;
    	}

In the SodiumEquivalentMethod interface from the melting.methodInterfaces package.

    public double computeSodiumEquivalent(double Na, double Mg,
                K, double Tris, double dNTP, double newSpecies);

In the ApproximativeMode class from the melting.approximativeMethods

    public void setUpVariables(HashMap<String, String> options) {
    		this.environment = new Environment(options);

    		if (isNaEqPossible()){
    			if (environment.getMg() > 0 || environment.getK() > 0
    			    || environment.getTris() > 0
    			    || environment.getNewSpecies() > 0){
    			[...]
    			}
    		[...]
    		}
    		[...]
    	}

In the Helper class from the melting package

    public static double computesNaEquivalent(Environment
                                              environment){
    		double NaEq = environment.getNa() + environment.getK()
    		              + environment.getTris() / 2
    		              + environment.getNewSpecies();
    		[...]
    	}