Skip to content

Commit

Permalink
fixed fs_matrix, added fs_go, fs_gep, added fs_lalign_id_pair
Browse files Browse the repository at this point in the history
  • Loading branch information
cnotred committed Mar 26, 2023
1 parent e7b039f commit 78b0d56
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 27 deletions.
67 changes: 52 additions & 15 deletions lib/dp_lib/util_dp_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,35 +198,30 @@ Constraint_list *seq2list ( Job_TC *job)
|| strm ( mode, "blast_pair") || strm (mode, "lalign_blast_pair") \
|| strm ( mode, "viterbi_pair") || strm (mode, "slow_pair") || strm(mode, "glocal_pair") || strm (mode, "biphasic_pair") \
|| strm ( mode, "islow_pair") || strm (mode, "tm_slow_pair") || strm (mode, "r_slow_pair") \
|| strm ( mode, "lalign_id_pair")|| strm (mode, "tm_lalign_id_pair") || strm (mode , "lalign_len_pair") \
|| strm ( mode, "lalign_id_pair")|| strm (mode, "tm_lalign_id_pair") || strm (mode , "lalign_len_pair") || strm(mode, "fs_lalign_id_pair") \
|| strm (mode, "prrp_aln") || strm ( mode, "test_pair") \
|| strm (mode, "cdna_fast_pair") || strm (mode, "diaa_slow_pair") || strm (mode, "monoaa_slow_pair")\
|| strncmp (mode,"cdna_fast_pair",14)==0 \
)
{

A=fast_pair (job);
RCL=aln2constraint_list ((A->A)?A->A:A, CL,weight);
}

else if ( strm ( mode, "subop1_pair") || strm ( mode, "subop2_pair") )
{
A=fast_pair (job);
RCL=A->CL;
}
else if ( strm ( mode, "3di_pair"))
else if ( strm ( mode, "subop1_pair") || strm ( mode, "subop_pair") )
{
A=fast_pair (job);
RCL=A->CL;

}

else if ( strm ( mode, "proba_pair") )
else if ( strm ( mode, "proba_pair") || strm (mode, "fs_pair"))
{

A=fast_pair (job);
RCL=A->CL;
}

else if ( strm ( mode, "best_pair4prot"))
{
RCL=best_pair4prot (job);
Expand Down Expand Up @@ -544,9 +539,9 @@ Constraint_list *method2pw_cl (TC_method *M, Constraint_list *CL)
PW_CL->evaluate_residue_pair=evaluate_matrix_score;
PW_CL->extend_jit=0;
}
else if ( strm (mode, "3di_pair"))
else if ( strm (mode, "fs_pair"))
{

PW_CL->maximise=1;
PW_CL->TG_MODE=1;
PW_CL->use_fragments=0;
Expand All @@ -556,10 +551,22 @@ Constraint_list *method2pw_cl (TC_method *M, Constraint_list *CL)
PW_CL->get_dp_cost=slow_get_dp_cost;
PW_CL->evaluate_residue_pair=evaluate_matrix_score;
PW_CL->extend_jit=0;
if (get_string_variable ("3dimatrix"))
PW_CL->M=read_matrice (get_string_variable ("3dimatrix"));

if (get_string_variable ("fs_matrix"))
PW_CL->M=read_matrice (get_string_variable ("fs_matrix"));
else
PW_CL->M=read_matrice ("idmat");

if (int_variable_isset ("fs_gop") && get_int_variable("fs_gop")<0)
PW_CL->gop=get_int_variable("fs_gop");
else
PW_CL->gop= get_avg_matrix_mm (PW_CL->M, AA_ALPHABET)*10;

if (int_variable_isset ("fs_gep") && get_int_variable("fs_gep")<0)
PW_CL->gep=get_int_variable("fs_gep");
else
PW_CL->M=read_matrice (get_string_variable ("idmat"));
PW_CL->gep= -1;

}
else if ( strm (mode, "proba_pair"))
{
Expand Down Expand Up @@ -716,6 +723,7 @@ Constraint_list *method2pw_cl (TC_method *M, Constraint_list *CL)
sprintf (PW_CL->matrix_for_aa_group,"%s", group_mat);
PW_CL->extend_jit=0;
}

else if ( strm ( mode , "lalign_id_pair"))
{
PW_CL->residue_index=NULL;
Expand All @@ -729,6 +737,35 @@ Constraint_list *method2pw_cl (TC_method *M, Constraint_list *CL)
sprintf (PW_CL->matrix_for_aa_group,"%s", group_mat);
PW_CL->extend_jit=0;
}
else if ( strm ( mode , "fs_lalign_id_pair"))
{
PW_CL->residue_index=NULL;
PW_CL->maximise=1;
PW_CL->TG_MODE=1;
PW_CL->use_fragments=0;
PW_CL->pair_wise=sim_pair_wise_lalign;
PW_CL->evaluate_residue_pair=evaluate_matrix_score;
PW_CL->get_dp_cost=slow_get_dp_cost;
PW_CL->lalign_n_top=CL->lalign_n_top;
sprintf (PW_CL->matrix_for_aa_group,"%s", group_mat);
PW_CL->extend_jit=0;

if (get_string_variable ("fs_matrix"))
PW_CL->M=read_matrice (get_string_variable ("fs_matrix"));
else
PW_CL->M=read_matrice ("idmat");

if (int_variable_isset ("fs_gop") && get_int_variable("fs_gop")<0)
PW_CL->gop=get_int_variable("fs_gop");
else
PW_CL->gop= get_avg_matrix_mm (PW_CL->M, AA_ALPHABET)*10;

if (int_variable_isset ("fs_gep") && get_int_variable("fs_gep")<0)
PW_CL->gep=get_int_variable("fs_gep");
else
PW_CL->gep= -1;
}

else if ( strm ( mode , "tm_lalign_id_pair"))
{
PW_CL->residue_index=NULL;
Expand Down
51 changes: 45 additions & 6 deletions lib/t_coffee_lib/t_coffee.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ int batch_main ( int argc, char **argv)
int len;
char *infile;
char *matrix;
char *threedimatrix;
char *fs_matrix;
int fs_gop;
int fs_gep;

char *dp_mode;
char *profile_mode;
char *profile_comparison;
Expand Down Expand Up @@ -2222,25 +2225,61 @@ if ( !do_evaluate)
/*Max Value*/ "any" \
);

declare_name (threedimatrix);
declare_name (fs_matrix);
get_cl_param( \
/*argc*/ argc ,\
/*argv*/ argv ,\
/*output*/ &le ,\
/*Name*/ "-threedimatrix" ,\
/*Name*/ "-fs_matrix" ,\
/*Flag*/ &garbage ,\
/*TYPE*/ "S" ,\
/*OPTIONAL?*/ OPTIONAL ,\
/*MAX Nval*/ 1 ,\
/*DOC*/ "Specifies the substitution matrix used on 3di.",\
/*Parameter*/ &threedimatrix ,\
/*Parameter*/ &fs_matrix ,\
/*Def 1*/ "idmat" ,\
/*Def 2*/ "default" ,\
/*Min_value*/ "any" ,\
/*Max Value*/ "any" \
);
set_string_variable ("3dimatrix",threedimatrix);

set_string_variable ("fs_matrix",fs_matrix);

get_cl_param( \
/*argc*/ argc ,\
/*argv*/ argv ,\
/*output*/ &le ,\
/*Name*/ "-fs_gop" ,\
/*Flag*/ &garbage ,\
/*TYPE*/ "D" ,\
/*OPTIONAL?*/ OPTIONAL ,\
/*MAX Nval*/ 1 ,\
/*DOC*/ "Must Be Negative",\
/*Parameter*/ &fs_gop ,\
/*Def 1*/ "1" ,\
/*Def 2*/ "" ,\
/*Min_value*/ "any" ,\
/*Max Value*/ "any" \
);
set_int_variable ("fs_gop",fs_gop);

get_cl_param( \
/*argc*/ argc ,\
/*argv*/ argv ,\
/*output*/ &le ,\
/*Name*/ "-fs_gep" ,\
/*Flag*/ &garbage ,\
/*TYPE*/ "D" ,\
/*OPTIONAL?*/ OPTIONAL ,\
/*MAX Nval*/ 1 ,\
/*DOC*/ "Must Be Negative",\
/*Parameter*/ &fs_gep ,\
/*Def 1*/ "1" ,\
/*Def 2*/ "" ,\
/*Min_value*/ "any" ,\
/*Max Value*/ "any" \
);
set_int_variable ("fs_gep",fs_gep);


/*PARAMETER PROTOTYPE: TG_MODE */

Expand Down
16 changes: 14 additions & 2 deletions lib/util_lib/aln_convertion_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5575,16 +5575,28 @@ int **fix_seq_seq (Sequence *S0, Sequence *Sx)
//residues 1-N+1
int s0, r0,i;
int **index;
char *seq;
char *use_template;

//Trigger fixing with a template rather than the sequence itself
use_template=get_string_variable ("fix_seq_seq_with_template");

index=(int**)vcalloc ( S0->nseq, sizeof (int*));
for (s0=0; s0<S0->nseq; s0++)
{
int l=S0->len[s0];
index[s0]=(int*)vcalloc (l+1, sizeof (int));
i=index[s0][0]=name_is_in_list (S0->name[s0], Sx->name, Sx->nseq, 100);

if (i!=-1)
{
seq=Sx->seq[i];
if (use_template)seq=seq2E_template_string (Sx,i);
if (!seq) seq=Sx->seq[i];
}

if (i==-1);
else if (strim(S0->seq[s0], Sx->seq[i]))
else if (strim(S0->seq[s0], seq))
{
for (r0=1; r0<=l; r0++)
{
Expand All @@ -5598,7 +5610,7 @@ int **fix_seq_seq (Sequence *S0, Sequence *Sx)
int nr1=0;
Alignment *B;

B=align_two_sequences (S0->seq[s0], Sx->seq[i], const_cast<char*>( (strm(S0->type, "PROTEIN"))?"blosum62mt":"idmat"), -4,-1, "myers_miller_pair_wise");
B=align_two_sequences (S0->seq[s0], seq, const_cast<char*>( (strm(S0->type, "PROTEIN"))?"blosum62mt":"idmat"), -4,-1, "myers_miller_pair_wise");
for (c=0; c<B->len_aln; c++)
{

Expand Down
28 changes: 24 additions & 4 deletions lib/util_lib/util_constraints_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ Constraint_list *fork_subset_produce_list ( Constraint_list *CL, Sequence *S,
int job2first_seq(Job_TC *job);

Constraint_list *produce_list ( Constraint_list *CL, Sequence *S, char * method,char *weight,char *mem_mode)
{
Job_TC *job=NULL;
{ Job_TC *job=NULL;
FILE *local_stderr;
int njob;
int nproc;
Expand Down Expand Up @@ -5372,7 +5371,7 @@ char *** produce_method_file ( char *method)
sprintf (list[n][1], "%s", vtmpnam(NULL));
n++;if (method==NULL || strm (method, list[n-1][0])){fp=vfopen (list[n-1][1], "w");
fprintf ( fp, "DOC Probabilistic pairwise alignment\n");
fprintf ( fp, "EXECUTABLE proba_pair\n");
fprintf ( fp, "EXECUTABLE fs_pair\n");
fprintf ( fp, "ALN_MODE pairwise\n");
fprintf ( fp, "OUT_MODE fL\n");
fprintf ( fp, "IN_FLAG no_name\n");
Expand Down Expand Up @@ -5451,7 +5450,7 @@ char *** produce_method_file ( char *method)
vfclose (fp);}


//Llaign ID PAIR
//lalign ID PAIR
sprintf (list[n][0], "lalign_id_pair");
sprintf (list[n][1], "%s", vtmpnam(NULL));
n++;if (method==NULL || strm (method, list[n-1][0])){fp=vfopen (list[n-1][1], "w");
Expand Down Expand Up @@ -5480,6 +5479,27 @@ char *** produce_method_file ( char *method)
vfclose (fp);}


//fs_lalign_id_pair
sprintf (list[n][0], "fs_lalign_id_pair");
sprintf (list[n][1], "%s", vtmpnam(NULL));
n++;if (method==NULL || strm (method, list[n-1][0])){fp=vfopen (list[n-1][1], "w");
fprintf ( fp, "DOC local alignment reporting the N best pairwise local alignments\n");
fprintf ( fp, "EXECUTABLE fs_lalign_id_pair\n");
fprintf ( fp, "ALN_MODE pairwise\n");
fprintf ( fp, "OUT_MODE fL\n");
fprintf ( fp, "IN_FLAG no_name\n");
fprintf ( fp, "OUT_FLAG no_name\n");

fprintf ( fp, "MATRIX blosum50mt\n");
fprintf ( fp, "GOP -10\n");
fprintf ( fp, "GEP -4\n");
fprintf ( fp, "MAXID 100\n");
fprintf ( fp, "SEQ_TYPE E\n");
fprintf ( fp, "ADDRESS %s\n", ADDRESS_BUILT_IN);
fprintf ( fp, "PROGRAM %s\n", PROGRAM_BUILT_IN);
vfclose (fp);}



//Llaign RS_S PAIR for Mocca
sprintf (list[n][0], "lalign_rs_s_pair");
Expand Down

0 comments on commit 78b0d56

Please sign in to comment.