Skip to content

Commit

Permalink
updated scoring function
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgWa committed Oct 25, 2023
1 parent 83a29b1 commit bbafb20
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions alphadia/hybridselection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,13 +1398,17 @@ def build_features(
#precursor_binary_sum = np.sum(precursor_binary, axis=0)
#precursor_binary_weighted = np.sum(precursor_binary * precursor_kernel, axis=0)

precursor_dot = np.sum(smooth_precursor[0] * precursor_kernel, axis=0)
precursor_dot_mean = np.mean(precursor_dot)
precursor_norm = precursor_dot/(precursor_dot_mean+0.001)
#precursor_dot = np.sum(smooth_precursor[0] * precursor_kernel, axis=0)
#precursor_dot_mean = np.mean(precursor_dot)
#precursor_norm = precursor_dot/(precursor_dot_mean+0.001)

#fragment_dot = np.sum(smooth_fragment[0] * fragment_kernel, axis=0)
#fragment_dot_mean = np.mean(fragment_dot)
#fragment_norm = fragment_dot/(fragment_dot_mean+0.001)

log_fragment = np.sum(np.log(smooth_fragment[0] + 1), axis=0)
log_precursor = np.sum(np.log(smooth_precursor[0] + 1), axis=0)

fragment_dot = np.sum(smooth_fragment[0] * fragment_kernel, axis=0)
fragment_dot_mean = np.mean(fragment_dot)
fragment_norm = fragment_dot/(fragment_dot_mean+0.001)

#fragment_mass_error = np.sum(np.abs(smooth_fragment[1]), axis=0)
#fragment_mass_error_max = np.max(fragment_mass_error)
Expand All @@ -1427,13 +1431,13 @@ def build_features(


#profile correlation
top3_profiles = np.sum(smooth_fragment[0,:3], axis=1)
top3_correlation = utils.profile_correlation(top3_profiles)
#top3_profiles = np.sum(smooth_fragment[0,:3], axis=1)
#top3_correlation = utils.profile_correlation(top3_profiles)

#features[0] = fragment_binary_weighted
#features[1] = np.log(fragment_norm +1)
#features[2] = np.log(precursor_norm +1)
features[0] = np.log(fragment_norm +1) + np.log(precursor_norm +1)
features[0] = log_fragment + log_precursor #np.log(fragment_norm +1) + np.log(precursor_norm +1)
#features[4] = fragment_mass_error_norm
#features[5] = precursor_mass_error_norm
#features[6] = fragment_mass_error_norm * precursor_mass_error_norm
Expand Down

0 comments on commit bbafb20

Please sign in to comment.