Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct calculation of enrich score #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stkmrc
Copy link

@stkmrc stkmrc commented Aug 19, 2023

Hi Zuguang,

I made two commits. Please have a look at the explanations below. If I missed something why this is not the case please let me know!

The first one:
Correct me when I got it wrong, but as far as I understand currently the formula will calculate a weight of zero for the last window of the target (and also slightly too low for the upper half of the target. The error is small for a large number of target windows, but increases with a smaller number of target windows.

The second one (on top):
In the current version, the if-statements don't seem to fit for me.
First, I think instead of checking the target section n2, it looks like n3 should be checked when I look at what is calculated in each case.
Second, checking the length of n, which is calculated above as the length of x doesn't make sense since this will always give an integer > 0 and therefore will always be true.
In fact, since x1, x2 and x3 are set to an empty matrix anyway in the normalizeToMatrix function you can also instead of correcting the points above just always calculate the whole formula and if up/downstream or target vector is empty it will be zero in the sum and thus not change the result.

stkmrc added 2 commits August 19, 2023 21:36
Currently the formula will calculate a weight of zero for the last window of the target (and also slightly too low for the upper half of the target. The error is small for a large number of target windows, but increases with a smaller number of target windows.
In the current version, the if-statements don't seem to fit for me.
First, I think instead of checking the target section n2, it looks like n3 should be checked when I look at what is calculated in each case.
Second, checking the length of n, which is calculated above as the length of x doesn't make sense since this will always give an integer > 0 and therefore will always be true.
In fact, since x1, x2 and x3 are set to an empty matrix anyway in the normalizeToMatrix function you can also instead of correcting the points above just always calculate the whole formula and if up/downstream or target vector is empty it will be zero in the sum and thus not change the result.
@stkmrc stkmrc changed the title Correct weighting in enrich score of target Correct calculation of enrich score Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant