Committed thermostats.c
git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPrimers/trunk@226 60f365c0-8329-0410-b2a4-ec073aeeaa1d
This commit is contained in:
64
src/libthermo/thermostats.c
Normal file
64
src/libthermo/thermostats.c
Normal file
@ -0,0 +1,64 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include "thermostats.h"
|
||||
|
||||
void getThermoProperties (ppair_t* pairs, size_t count, poptions_t options)
|
||||
{
|
||||
size_t i, j;
|
||||
uint32_t begin;
|
||||
uint32_t end;
|
||||
word_t w1;
|
||||
word_t w2;
|
||||
|
||||
char *sq;
|
||||
char prmr[50];
|
||||
float mtemp;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
w1 = pairs[i]->p1->word;
|
||||
w2 = pairs[i]->p2->word;
|
||||
|
||||
if (!pairs[i]->asdirect1)
|
||||
w1=ecoComplementWord(w1,options->primer_length);
|
||||
|
||||
if (!pairs[i]->asdirect2)
|
||||
w2=ecoComplementWord(w2,options->primer_length);
|
||||
|
||||
pairs[i]->p1temp = nparam_CalcSelfTM (options->pnparm, ecoUnhashWord(w1, options->primer_length), 0) - 273.0;
|
||||
pairs[i]->p2temp = nparam_CalcSelfTM (options->pnparm, ecoUnhashWord(w2, options->primer_length), 0) - 273.0;
|
||||
pairs[i]->p1mintemp = 100;
|
||||
pairs[i]->p2mintemp = 100;
|
||||
|
||||
for (j = 0; j < pairs[i]->pcr.ampcount; j++)
|
||||
{
|
||||
sq = pairs[i]->pcr.amplifias[j].sequence->SQ;
|
||||
begin = pairs[i]->pcr.amplifias[j].begin - options->primer_length;
|
||||
end = pairs[i]->pcr.amplifias[j].end + 1;
|
||||
|
||||
memcpy (prmr, sq + begin, options->primer_length);
|
||||
mtemp = nparam_CalcSelfTM (options->pnparm, prmr, options->primer_length) - 273.0;
|
||||
if (mtemp < pairs[i]->p1mintemp)
|
||||
pairs[i]->p1mintemp = mtemp;
|
||||
//fprintf (stderr, "prmr1: %s\n", seqdb[seqid]->SQ);
|
||||
memcpy (prmr, sq + end, options->primer_length);
|
||||
mtemp = nparam_CalcSelfTM (options->pnparm, prmr, options->primer_length) - 273.0;
|
||||
if (mtemp < pairs[i]->p2mintemp)
|
||||
pairs[i]->p2mintemp = mtemp;
|
||||
}
|
||||
|
||||
if (w2 < w1)
|
||||
{
|
||||
mtemp = pairs[i]->p1temp;
|
||||
pairs[i]->p1temp = pairs[i]->p2temp;
|
||||
pairs[i]->p2temp = mtemp;
|
||||
|
||||
mtemp = pairs[i]->p1mintemp;
|
||||
pairs[i]->p1mintemp = pairs[i]->p2mintemp;
|
||||
pairs[i]->p2mintemp = mtemp;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user