Skip to content

Commit

Permalink
add new features for new predictor
Browse files Browse the repository at this point in the history
  • Loading branch information
tschuelia committed May 18, 2023
1 parent 474ecc2 commit 71bfc46
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/difficulty.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,14 @@ CORAX_EXPORT corax_msa_features *corax_msa_compute_features(
features->proportion_gaps = msa_stats->gap_prop;
features->proportion_invariant = msa_stats->inv_prop;
features->entropy = msa_stats->entropy;
features->pattern_entropy = msa_stats->pattern_entropy;

// The Bollback multinomial computation changes the MSA object
// The Bollback multinomial and pattern_entropy computations changes the MSA object
// the msa->length afterwards corresponds to the number of patterns instead of
// the number of sites
unsigned int *site_pattern_map =
(unsigned int *)calloc(msa->length, sizeof(unsigned int));
unsigned int *site_weights =
corax_compress_site_patterns_msa(msa, tipmap, site_pattern_map);
features->bollback_multinomial =
corax_msa_bollback_multinomial(msa, site_weights, tipmap);
unsigned int *site_pattern_map = (unsigned int *)calloc(msa->length, sizeof(unsigned int));
unsigned int *site_weights = corax_compress_site_patterns_msa(msa, tipmap, site_pattern_map);
features->bollback_multinomial = corax_msa_bollback_multinomial(msa, site_weights, tipmap);
features->pattern_entropy = corax_msa_pattern_entropy(msa, site_weights, tipmap);

const double msa_patterns = (double)msa->length;
features->patterns = msa_patterns;
Expand Down

0 comments on commit 71bfc46

Please sign in to comment.