Keywords: DeveloppersGuide

## New DMSO and formamide corrections

1) Create a new class which implements the CorrectionMethod interface or, if it is adapted for a new DMSO correction, which extends the DNADMSOCorrections class in the melting.correctionMethods package. You must create your class int the adapted package : melting.otherCorrections.dmsoCorrections package if it is a DMSO correction or melting.otherCorrections.formamideCorrections package if it is a formamide correction.
If you just implement the CorrectionMethod interface, you have to implement the public methods boolean isApplicable(Environment environment) and ThermoResult correctMeltingResults(Environment environment) The first method is important to define the conditions of application of the correction and the second is important to correct the computed melting temperature.
The DNADMSOCorrections is a base implementation for DMSO corrections and is focused on DNA sequences. If you extend DNADMSOCorrections, you have to override the public method boolean isApplicable(Environment environment) to define the conditions of application of the DMSO correction. The public method ThermoResult correctMeltingResults(Environment environment) has to be implemented to compute the DMSO correction.

2) Register the correction name and the class which represents it in the RegisterMethods class (melting.configuration package). You have to add into one of these functions of RegisterMethods : private void initialiseDMSOCorrectionMethod() or private void initialiseFormamideCorrectionMethod(). this following line :

    /**
    * initialises the DMSOCorrectionMethod HashMap of the
    * RegisterMethods object.
    */
    	private void initialiseDMSOCorrectionMethod(){
    		[...]

    		DMSOCorrection.put("DMSOCorrection-Name",
    		                           Class-Name.class);
    	}

    /**
    * initialises the formamideCorrectionMethod HashMap of the
    * RegisterMethods object.
    */
    	private void initialiseFormamideCorrectionMethod(){
    		[...]
    		formamideCorrection.put("formamideCorrection-Name",
    		                               Class-Name.class);
    	}

3) Don't forget to add a private static String instance variable in your class. This String represents the correction formula must be printed if the verbose mode is required by the user.

    // Create a private static String which represents the
    // correction formula.
    private static String correctionFormula = "formula";

    [...]

    // To print the article reference of the correction
    // formula if the verbose mode is required.
    OptionManagement.meltingLogger.log(Level.FINE, "article
                                  reference of the formula");

    // To print the correction formula (the private static String)
    OptionManagement.meltingLogger.log(Level.FINE,
                                          correctionFormula);

    [...]
    }