Files
ecoprimers/src/libthermo/nnparams.h

105 lines
3.5 KiB
C
Raw Normal View History

/*
* nnparams.h
* PHunterLib
*
* Created by Tiayyba Riaz on 7/2/09.
* Copyright 2009 __MyCompanyName__. All rights reserved.
*
*/
//=============================================================================
// Module: nnparams.h
// Project: Diploma Thesis - Probe Selection for DNA Microarrays
// Type: header file - Nearest Neighbor Parameters / Model.
// Language: c++
// Compiler: microsoft visual c++ 6.0, unix/linux gcc
// System/OS: Windows 32, Sun solaris, Linux, other unix systems (untested)
// Database: none
// Description: class CNNParams - Nearest Neighbor Model Parameters
// Author: kaderali
// Date: 9-12/2000
// Copyright: (c) L. Kaderali, 9/2000 - 12/2000
//
// Revision History
// $ 00sep07 LK : created
// 00dec29 LK : changed to include dangling end data
// 01jan09 LK : included CalcSelfTM function
// 01feb07 LK : optimized
// #$
//=============================================================================
#if !defined(AFX_NNPARAMS_H__05604705_84E8_11D4_A001_000000000000__INCLUDED_)
#define AFX_NNPARAMS_H__05604705_84E8_11D4_A001_000000000000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <math.h>
#include <string.h>
#ifdef _pack
#pragma pack(1)
#endif
// following defines to simplify coding...
#define ndH(a,b,c,d) nparm->dH[a][b][c][d]
#define ndS(a,b,c,d) nparm->dS[a][b][c][d]
#define forbidden_enthalpy 1000000000000000000.0f
//#define forbidden_enthalpy_div1000 1000000000000000.0f
// forbidden entropy=-rlogc
// #define forbidden_entropy 30.205986374220235304486574573422f
// Boltzmann factor (cal/degrees C*mol)
#define R 1.987f
#define SALT_METHOD_SANTALUCIA 1
#define SALT_METHOD_OWCZARZY 2
// Strand concentration (assumption!) (M)
// #define Ct 0.000001f
// r*ln(ct/4) as required by many formulas
//#define rlogc -30.205986374220235304486574573422f
extern float forbidden_entropy;
//-----------------------------------------------------------------------------
// class CNNParams
//typedef class CNNParams* PNNParams;
//#pragma GCC visibility push(hidden)
typedef struct CNNParams_st
{
//public:
float Ct1;
float Ct2;
float rlogc;
float kplus;
float kfac;
int saltMethod;
float gcContent;
float new_TM; // ge‰ndert von ML!!!
//CNNParams();
//virtual ~CNNParams();
//private:
float dH[6][6][6][6]; // A-C-G-T + gap + initiation (dangling end, $ sign)
float dS[6][6][6][6];
}CNNParams, * PNNParams;
//void nparam_InitParams(PNNParams nparm, float c1=0.000001f, float c2=0.000001f, float kp=1, int sm = SALT_METHOD_SANTALUCIA );
void nparam_InitParams(PNNParams nparm, float c1, float c2, float kp, int sm);
void nparam_UpdateParams(PNNParams nparm, char * s1, char * s2);
float nparam_CountGCContent(char * seq );
char nparam_convertNum(char c);
float nparam_GetEntropy(PNNParams nparm, char x0, char x1, char y0, char y1);
float nparam_GetEnthalpy(PNNParams nparm, char x0, char x1, char y0, char y1);
float nparam_CalcTM(float entropy,float enthalpy);
void nparam_AlterTM(PNNParams nparm, float tm_new);
float nparam_CalcG(PNNParams nparm, float entropy, float enthalpy);
float nparam_CalcSelfTM(PNNParams nparm, char* seq);
float nparam_GetInitialEntropy(PNNParams nparm) ;
char nparam_getComplement(char mychar, int asnum);
int nparam_isMismatch(char,char);
//#pragma GCC visibility pop
#endif // !defined(AFX_NNPARAMS_H__05604705_84E8_11D4_A001_000000000000__INCLUDED_)