-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix issue 499 #513
fix issue 499 #513
Conversation
Requires testing. |
Tested various use-cases on dummy data. Please review. |
Tested user's data for SF analysis. With or without missing data, both works ok. |
Hi @dominikbach, here are some comments/questions for the updates of SF and some other related functions.
|
This is an new and additional input check. If onsets are larger than offsets, then this is nonsensical - and it might lead to problems or unexpected results down the line.
In the old version, lines 72-74 did not work. In line 72-73, you create an index (rather than a logical index). In line 74, you try to create something like "a complement of a logical index", but applied to the integer index this leads to nonsensical results (and in fact, to negative index values which causes an error in line 76).
I did not change anything here. If your recollection of the discussion is that there should not be a warning then why did you add a warning? In any case, this is a general issue that should be consistent across PsPM and should not be included here. Please revert.
I tested it already. If there are fewer than 3 data points that pspm_sf_dcm cannot compute the initial value priors.
This is just moved outside the loop (lines 237-240 of the new version). Because missing data are specified per file (not per epoch), the index is computed per file and this does not have to repeated for every epoch.
Missing index is specified per file. When we select part of the data as epoch for processing, we also need to select the respective missing index. To illustrate, when the user says "seconds 10-15 of my data file is missing" and selects seconds 20-60 for epoch 1, then in your previous version seconds 10-15 of the epoch would have been classified as missing, corresponding seconds 30-45 of the original data, which is clearly wrong.
We need to specify some output even if the inversion is not done. |
I understand now. May I confirm if this is caused by the bug from test data, e.g. from https://zenodo.org/record/3900169? I am trying to confirm I am using the correct data to test.
My brain was not working at that time, sorry for adding this unnecessary code. I just came up with that I added the code because the script return without showing anything when I set it to be "not to overwrite". I have inverted it now.
I see. May I just confirm with you that the data you used to test is from here: https://zenodo.org/record/3900169?
I have now understood the logic of missing index. Previously, I received Carlos' data where the initial several values are missing, and I tested SF with his data where I did not consider file specification for missing. Thanks for pointing out this.
I understand and agree with the newly implemented code. I think the indention is a little strange but should not affect the performance. I think the develop branch is in line with the original version of SF at https://github.com/bachlab/PsPM/blob/21f4eedb270ed59293cd43d38fbe76e83ce53c9c/src/pspm_sf.m, and it has not been changed for a while, so this update is necessary for it.. |
There is no faulty missing index in the test data; I have created this edge case manually.
Again, such missing indices are not contained in any test data but you can easily create them. |
@dominikbach I added minor changes to your latest version
If you are happy with these changes, I can merge this pull request to the develop branch. Thanks |
Fixes # 499.
Changes proposed in this pull request: