RNA-FRETools / MASH-FRET

MATLAB package to analyze single-molecule FRET data
https://rna-fretools.github.io/MASH-FRET/
GNU General Public License v3.0
8 stars 2 forks source link

Movies not loaded in trace processing #72

Closed fdsteffen closed 3 years ago

fdsteffen commented 3 years ago

The movie files are no longer loaded in the trace processing module (on master it worked up to commit 4822172). I tracked the issue down to the following lines in checkField.m

if ~isempty(s.movie_file)
    s.movie_file = which(s.movie_file); % get absolute path
end

The which() function returns an empty string if the file is neither in the current path nor on the Matlab path. In my case the s.movie_file was already a full path and the issue is resolved by commenting out the if..else statement. Is there any scenario where the s.movie_file returns a relative path that would need to be solved by which()?

mca-sh commented 3 years ago

Oops.. Yes indeed, s.movie_file returns a relative path when importing test projects (stored in the source\routines directory). I used this trick to allow testing on different machines, but did not think it completely through apparently. I've just introduced a istestfile function in MASH-FRET-1.3.2 to control the origin of the project, such as:

if ~isempty(s.movie_file) && istestfile(s.movie_file)
    s.movie_file = which(s.movie_file); % get machine-dependent path for test files
end

It works for me.

Thank you very much for nailing the bug!

fdsteffen commented 3 years ago

Yes, it works, thanks! I will close this then.