Skip to content

Commit

Permalink
added the -et_mode=et|sp|sankoff|id and -msa_mode=etcoffee
Browse files Browse the repository at this point in the history
  • Loading branch information
cnotred committed Dec 9, 2015
1 parent 031e5a2 commit 3628a4c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 16 deletions.
44 changes: 29 additions & 15 deletions lib/dp_lib/evaluate.c
Original file line number Diff line number Diff line change
Expand Up @@ -5070,6 +5070,8 @@ int col2, Constraint_list *CL)
int score;
int *sa;

static char *mode;

int sp=0;
int et=0;
int sankoff=1;
Expand All @@ -5078,6 +5080,18 @@ int col2, Constraint_list *CL)
int debug=0;
int cons=-1;



if (!mode)
{
mode=get_string_variable ("et_mode");
if (!mode)
{
mode=(char*)vcalloc (100, sizeof (char));
sprintf (mode, "et");
}
}

if (T==NULL)
{
T=main_read_tree (A->tname);
Expand Down Expand Up @@ -5137,35 +5151,35 @@ int col2, Constraint_list *CL)

if (!N)return 0;

if (sp)
if (strm (mode, "sp"))
{

//sp score: debug
score=column2sp_score(CL->S, key, N, nseq, matrix, gep);
}
else if (id)
else if (strm (mode, "id"))
{
//id score based on tree topology
sa=column2sankoff_score_id (key, N, nseq,matrix,gep);

score=sa[27];
score=score*-1+100;
vfree(sa);
}

else if (et)
else if (strm (mode,"et"))
{
//ET Score based on the sub tree
score=column2et_score(CL->S, key, N, nseq, matrix, gep);

}
else if (sankoff)
else if (strm (mode, "sankoff"))
{
//Sankoff tree score, cf Felsenstein
int *sa=column2sankoff_score (key, N, nseq,matrix,gep);
score=sa[0];
for (a=1; a<27; a++)score=MAX(score, sa[a]);
//score-=30;
//fprintf ( stderr, "Pos: %3d %3d -> %4d\n", col1, col2, score);
vfree (sa);
}
for (a=0; a<nseq; a++)key[a]='\0';
return score*SCORE_K;
}
Expand Down Expand Up @@ -5204,14 +5218,14 @@ int column2et_score (Sequence *S,int *lu, NT_node T, int nseq, int **c, int gep)
if (!A)
{
A=declare_Alignment(S);
//treeF=vtmpnam (NULL);
//alnF=vtmpnam (NULL);
alnF=(char*)vcalloc (100, sizeof(char));
treeF=(char*)vcalloc (100, sizeof(char));
treeF=vtmpnam (NULL);
alnF=vtmpnam (NULL);
//alnF=(char*)vcalloc (100, sizeof(char));
//treeF=(char*)vcalloc (100, sizeof(char));
}

sprintf (treeF, "cedricT");
sprintf (alnF, "cedricA");
//sprintf (treeF, "cedricT");
//sprintf (alnF, "cedricA");

vfclose (print_ordered_tree (T,S, "newick", vfopen (treeF, "w")));

Expand Down
21 changes: 20 additions & 1 deletion lib/t_coffee_lib/t_coffee.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ int batch_main ( int argc, char **argv)
char *master_mode;
Sequence *MASTER_SEQ=NULL;
Sequence *TEMP_SEQ=NULL;
char *et_mode;

int blast_maxnseq;

Expand Down Expand Up @@ -3155,7 +3156,24 @@ declare_name (msa_mode);
/*Min_value*/ "any" ,\
/*Max Value*/ "any" \
);

declare_name (et_mode);
get_cl_param(\
/*argc*/ argc ,\
/*argv*/ argv ,\
/*output*/ &le ,\
/*Name*/ "-et_mode" ,\
/*Flag*/ &garbage ,\
/*TYPE*/ "S" ,\
/*OPTIONAL?*/ OPTIONAL ,\
/*MAX Nval*/ 1 ,\
/*DOC*/ "Algorithm used to the et score: id, et, sankoff, sp" ,\
/*Parameter*/ &et_mode ,\
/*Def 1*/ "et" ,\
/*Def 2*/ "et" , \
/*Min_value*/ "any" , \
/*Max Value*/ "any" \
);

declare_name (master_mode);
get_cl_param(\
/*argc*/ argc ,\
Expand Down Expand Up @@ -5069,6 +5087,7 @@ get_cl_param(\
if ( A->nseq==1);
else if ( strm ( msa_mode, "etcoffee"))
{
set_string_variable ("et_mode", et_mode);
//CL->get_dp_cost=slow_get_dp_cost;
if (!CL->M)
{
Expand Down

0 comments on commit 3628a4c

Please sign in to comment.