Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
smarco committed Aug 9, 2022
2 parents d810ad3 + b9a93d8 commit c676d8f
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 8 deletions.
36 changes: 30 additions & 6 deletions wavefront/wavefront_aligner.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void wavefront_aligner_set_heuristic_none(
wavefront_aligner_t* const wf_aligner) {
wavefront_heuristic_set_none(&wf_aligner->heuristic);
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_heuristic_inherit(wf_aligner->bialigner,&wf_aligner->heuristic);
wavefront_bialigner_set_heuristic(wf_aligner->bialigner,&wf_aligner->heuristic);
}
}
void wavefront_aligner_set_heuristic_banded_static(
Expand All @@ -299,7 +299,7 @@ void wavefront_aligner_set_heuristic_banded_static(
const int band_max_k) {
wavefront_heuristic_set_banded_static(&wf_aligner->heuristic,band_min_k,band_max_k);
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_heuristic_inherit(wf_aligner->bialigner,&wf_aligner->heuristic);
wavefront_bialigner_set_heuristic(wf_aligner->bialigner,&wf_aligner->heuristic);
}
}
void wavefront_aligner_set_heuristic_banded_adaptive(
Expand All @@ -310,7 +310,7 @@ void wavefront_aligner_set_heuristic_banded_adaptive(
wavefront_heuristic_set_banded_adaptive(
&wf_aligner->heuristic,band_min_k,band_max_k,score_steps);
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_heuristic_inherit(wf_aligner->bialigner,&wf_aligner->heuristic);
wavefront_bialigner_set_heuristic(wf_aligner->bialigner,&wf_aligner->heuristic);
}
}
void wavefront_aligner_set_heuristic_wfadaptive(
Expand All @@ -322,7 +322,19 @@ void wavefront_aligner_set_heuristic_wfadaptive(
&wf_aligner->heuristic,
min_wavefront_length,max_distance_threshold,score_steps);
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_heuristic_inherit(wf_aligner->bialigner,&wf_aligner->heuristic);
wavefront_bialigner_set_heuristic(wf_aligner->bialigner,&wf_aligner->heuristic);
}
}
void wavefront_aligner_set_heuristic_wfmash(
wavefront_aligner_t* const wf_aligner,
const int min_wavefront_length,
const int max_distance_threshold,
const int score_steps) {
wavefront_heuristic_set_wfmash(
&wf_aligner->heuristic,
min_wavefront_length,max_distance_threshold,score_steps);
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_set_heuristic(wf_aligner->bialigner,&wf_aligner->heuristic);
}
}
void wavefront_aligner_set_heuristic_wfmash(
Expand All @@ -343,7 +355,7 @@ void wavefront_aligner_set_heuristic_xdrop(
const int score_steps) {
wavefront_heuristic_set_xdrop(&wf_aligner->heuristic,xdrop,score_steps);
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_heuristic_inherit(wf_aligner->bialigner,&wf_aligner->heuristic);
wavefront_bialigner_set_heuristic(wf_aligner->bialigner,&wf_aligner->heuristic);
}
}
void wavefront_aligner_set_heuristic_zdrop(
Expand All @@ -352,7 +364,7 @@ void wavefront_aligner_set_heuristic_zdrop(
const int score_steps) {
wavefront_heuristic_set_zdrop(&wf_aligner->heuristic,ydrop,score_steps);
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_heuristic_inherit(wf_aligner->bialigner,&wf_aligner->heuristic);
wavefront_bialigner_set_heuristic(wf_aligner->bialigner,&wf_aligner->heuristic);
}
}
/*
Expand All @@ -364,6 +376,10 @@ void wavefront_aligner_set_match_funct(
void* const match_funct_arguments) {
wf_aligner->match_funct = match_funct;
wf_aligner->match_funct_arguments = match_funct_arguments;
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_set_match_funct(
wf_aligner->bialigner,match_funct,match_funct_arguments);
}
}
/*
* System configuration
Expand All @@ -372,13 +388,21 @@ void wavefront_aligner_set_max_alignment_score(
wavefront_aligner_t* const wf_aligner,
const int max_alignment_score) {
wf_aligner->system.max_alignment_score = max_alignment_score;
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_set_max_alignment_score(
wf_aligner->bialigner,max_alignment_score);
}
}
void wavefront_aligner_set_max_memory(
wavefront_aligner_t* const wf_aligner,
const uint64_t max_memory_resident,
const uint64_t max_memory_abort) {
wf_aligner->system.max_memory_resident = max_memory_resident;
wf_aligner->system.max_memory_abort = max_memory_abort;
if (wf_aligner->bialigner != NULL) {
wavefront_bialigner_set_max_memory(
wf_aligner->bialigner,max_memory_resident,max_memory_abort);
}
}
/*
* Utils
Expand Down
31 changes: 30 additions & 1 deletion wavefront/wavefront_bialigner.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,39 @@ uint64_t wavefront_bialigner_get_size(
wavefront_aligner_get_size(wf_bialigner->alg_reverse) +
wavefront_aligner_get_size(wf_bialigner->alg_subsidiary);
}
void wavefront_bialigner_heuristic_inherit(
void wavefront_bialigner_set_heuristic(
wavefront_bialigner_t* const wf_bialigner,
wavefront_heuristic_t* const heuristic) {
wf_bialigner->alg_forward->heuristic = *heuristic;
wf_bialigner->alg_reverse->heuristic = *heuristic;
wf_bialigner->alg_subsidiary->heuristic = *heuristic;
}
void wavefront_bialigner_set_match_funct(
wavefront_bialigner_t* const wf_bialigner,
int (*match_funct)(int,int,void*),
void* const match_funct_arguments) {
wf_bialigner->alg_forward->match_funct = match_funct;
wf_bialigner->alg_forward->match_funct_arguments = match_funct_arguments;
wf_bialigner->alg_reverse->match_funct = match_funct;
wf_bialigner->alg_reverse->match_funct_arguments = match_funct_arguments;
wf_bialigner->alg_subsidiary->match_funct = match_funct;
wf_bialigner->alg_subsidiary->match_funct_arguments = match_funct_arguments;
}
void wavefront_bialigner_set_max_alignment_score(
wavefront_bialigner_t* const wf_bialigner,
const int max_alignment_score) {
wf_bialigner->alg_forward->system.max_alignment_score = max_alignment_score;
wf_bialigner->alg_reverse->system.max_alignment_score = max_alignment_score;
wf_bialigner->alg_subsidiary->system.max_alignment_score = max_alignment_score;
}
void wavefront_bialigner_set_max_memory(
wavefront_bialigner_t* const wf_bialigner,
const uint64_t max_memory_resident,
const uint64_t max_memory_abort) {
wf_bialigner->alg_forward->system.max_memory_resident = max_memory_resident;
wf_bialigner->alg_forward->system.max_memory_abort = max_memory_abort;
wf_bialigner->alg_reverse->system.max_memory_resident = max_memory_resident;
wf_bialigner->alg_reverse->system.max_memory_abort = max_memory_abort;
wf_bialigner->alg_subsidiary->system.max_memory_resident = max_memory_resident;
wf_bialigner->alg_subsidiary->system.max_memory_abort = max_memory_abort;
}
13 changes: 12 additions & 1 deletion wavefront/wavefront_bialigner.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,19 @@ void wavefront_bialigner_delete(
*/
uint64_t wavefront_bialigner_get_size(
wavefront_bialigner_t* const wf_bialigner);
void wavefront_bialigner_heuristic_inherit(
void wavefront_bialigner_set_heuristic(
wavefront_bialigner_t* const wf_bialigner,
wavefront_heuristic_t* const heuristic);
void wavefront_bialigner_set_match_funct(
wavefront_bialigner_t* const wf_bialigner,
int (*match_funct)(int,int,void*),
void* const match_funct_arguments);
void wavefront_bialigner_set_max_alignment_score(
wavefront_bialigner_t* const wf_bialigner,
const int max_alignment_score);
void wavefront_bialigner_set_max_memory(
wavefront_bialigner_t* const wf_bialigner,
const uint64_t max_memory_resident,
const uint64_t max_memory_abort);

#endif /* WAVEFRONT_BIALIGNER_H_ */

0 comments on commit c676d8f

Please sign in to comment.