How to add new thermodynamic model

1) Creates a new class which implements the PatternComputationMethod interface or which extends the PatternComputation class in the melting.patternModels package.

If the structure computed by the new class is already registered by the program, you can create your class in the appropriate package (cngPatterns, cricksPair, InternalLoops, longBulge, longDanglingEnds, secondDanglingEnds, singleBulge, singleDanglingEnds, singleMismatch, specificAcids, tandemMismatches or wobble).

The PatternComputation class contains all the base implementations of each PatternComputationMethod method except for this function : boolean isApplicable(Environment environment, int pos1, int pos2).

You have to implement this method to compute the enthalpy and entropy of a motif in the duplex. You also have to override the function boolean isApplicable(Environment environment, int pos1,int pos2) to define the conditions of application of the new thermodynamic model.

2) Always register the new model in the RegisterMethod class in the melting.configuration package. Depending on which structure in the duplex your new model computes, you will have to add one of these following lines :

3) Create a public static String defaultFileName as instance variable of the class. It represents the name of the XML file containing the thermodynamic parameters for this model. You must print it if the user requires the verbose mode. You can create another public static String which contains the thermodynamic formula of the model and print it during the verbose mode.

For each message you want to print during the verbose mode, you must write this line : OptionManagement.meltingLogger.log(Level.FINE, "message to print");

4) You always must override or implement this function : void initialiseFileName(String methodName). It is necessary to write that the new class can use the thermodynamic parameters of its default File or use the thermodynamic parameters of another file required by the user.

@Override
	public void initialiseFileName(String methodName){
		super.initialiseFileName(methodName);
		
		if (this.fileName == null){
			this.fileName = defaultFileName; // The public static String
			                                 // of this class.
		}
	}

Some base implementations have been written for some non specific thermodynamic models, maybe your new class can extend one of the following base implementations. (but you always have to do the steps 1 to 4)



Subsections
Computational Neurobiology 2009-08-24