MatthiasPucher / staRdom

staRdom is a package for R to analyse fluorescence and absorbance data of dissolved organic matter (DOM).
21 stars 2 forks source link

Aqualog Emission Correction Range Check #2

Closed jakehosen closed 4 years ago

jakehosen commented 5 years ago

Thanks for a great package! A small issue with the function "eem_spectral_cor". The function checks to see that the intervals match up for the emission and excitation correction files. For Aqualogs the emission wavelengths that are measured aren't even integers because of the array detector. This means that line 591 in "correction_functions.R" will turn up a problem even if the emission correction range is the greater than that of the sample because of this mismatch in intervals. I cloned the repo and removed this line and the problem was solved. I recommend changing line 591 to check that the correction range exceeds the sample emission range.

if(!all(x$ex %in% seq(xEx[1],xEx[2]))) stop("Excitation correction does not cover EEM excitation spectrum!")
if(!all(x$em %in% seq(xEm[1],xEm[2]))) stop("Emission correction does not cover EEM emission spectrum!")
MatthiasPucher commented 5 years ago

Problem with Aqualog fluorometers should be fixed in version 1.0.13. I would appreciate, if you could test it. And staRdom 1.0.13 requires eemR 1.0.1 (from GitHub).

jakehosen commented 5 years ago

It works with eem_read_csv but the eem_read function still produces that error when run with aqualog data. If you can bring back the eem_read_csv function it would be helpful!

MatthiasPucher commented 5 years ago

Could you please be a bit more specific so I can solve the particular problem? Did you use the aqualog or the csv importer function when using eem_read? What was the error?

jakehosen commented 5 years ago

With the eem_read_csv I was able to successfully run PARAFAC analysis without errors. With the eem_read function everything works fine until the function "eem_extend2largest". At this point the error "object ‘z’ not found" is returned.

MatthiasPucher commented 5 years ago

Could you maybe provide me with a file, that causes the problem? I am still not sure at what point the problem arises.