20 #define ih_assert(bed) arb_assert(bed)
22 IslandHoppingParameter *IslandHopping::para =
NULp;
24 IslandHoppingParameter::IslandHoppingParameter(
bool use_user_freqs_,
25 double fT_,
double fC_,
double fA_,
double fG_,
26 double rTC_,
double rTA_,
double rTG_,
double rCA_,
double rCG_,
double rAG_,
27 double dist_,
double supp_,
double gapA_,
double gapB_,
double gapC_,
double thres_)
29 use_user_freqs = use_user_freqs_;
52 IslandHoppingParameter::~IslandHoppingParameter() {
60 para =
new IslandHoppingParameter(0, 0.25, 0.25, 0.25, 0.25, 0, 4.0, 1.0, 1.0, 1.0, 1.0, 4.0, 0.3, 0.5, 8.0, 4.0, 0.001);
79 for(i=0;i<alignment_length;i++) {
80 if(ref_sequence[i]!=
'-' && ref_sequence[i] !=
'.') nX++;
81 if(toAlign_sequence[i]!=
'-' && toAlign_sequence[i] !=
'.') nY++;
84 X=(
char *)malloc((nX+1)*
sizeof(
char));
85 secX=(
int *)malloc((nX)*
sizeof(
int));
87 Y = (
char *)malloc((nY+1)*
sizeof(
char));
88 secY = (
int *)malloc((nY)*
sizeof(
int));
96 printf(
"ref_helix = '%s'\n", ref_helix);
97 printf(
"toAlign_helix = '%s'\n", toAlign_helix);
100 for(i=0;i<alignment_length;i++) {
102 if(ref_sequence[i]!=
'-' && ref_sequence[i]!=
'.') {
103 X[j] = ref_sequence[i];
105 switch(ref_helix[i]) {
110 case '[':
case '<':
case '(':
case '{':
114 case ']':
case '>':
case ')':
case '}':
119 printf(
"Unknown '%c'\n", ref_helix[i]);
128 if(toAlign_sequence[i]!=
'-' && toAlign_sequence[i]!=
'.') {
129 Y[k] = toAlign_sequence[i];
131 switch(toAlign_helix[i]) {
136 case '[':
case '<':
case '(':
case '{':
140 case ']':
case '>':
case ')':
case '}':
145 printf(
"Unknown '%c'\n", toAlign_helix[i]);
154 X[j]=
'\0'; Y[k]=
'\0';
156 if(output_sequence) {
delete output_sequence; output_sequence=
NULp;}
157 if(aligned_ref_sequence) {
delete aligned_ref_sequence; aligned_ref_sequence=
NULp;}
160 nX,X,secX,&XX,nY,Y,secY,&YY,
161 para->use_user_freqs,para->fT,para->fC,para->fA,para->fG,
162 para->rTC,para->rTA,para->rTG,para->rCA,para->rCG,para->rAG,
163 para->dist,para->supp,para->gapA,para->gapB,para->gapC,para->thres
167 int nXY = strlen(XX);
169 output_alignment_length = nXY;
173 fp = fopen(
"alignment.txt",
"w");
174 for(o=0;o<nXY;o++) fprintf(fp,
"%c",XX[o]);
176 for(o=0;o<nXY;o++) fprintf(fp,
"%c",YY[o]);
181 aligned_ref_sequence =
new char[nXY+1];
182 output_sequence =
new char[nXY+1];
184 for (o = 0;o<nXY;++o) {
185 aligned_ref_sequence[o] = XX[o] ==
'-' ?
'-' :
'*';
186 output_sequence[o] = YY[o] ==
'-' ?
'-' :
'*';
188 aligned_ref_sequence[o] = 0;
189 output_sequence[o] = 0;
static void do_align(int &score, long act_seq_length)
void Align(int nX, char X[], int secX[], char **XX, int nY, char Y[], int secY[], char **YY, int freqs, double fT, double fC, double fA, double fG, double rTC, double rTA, double rTG, double rCA, double rCG, double rAG, double dist, double supp, double gapA, double gapB, double gapC, double thres)