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

Output directory issue/ absence of results #20

Closed jllavin77 closed 2 years ago

jllavin77 commented 2 years ago

Dear Matthias,

I've been trying to use your package to perform a PARAFAC analysis. After following the instructions given in this vignette using your automated/knit script and replacing the path to the output folder in both places you state (in the vignette) using the correct folder separator "/". I only get a .xls table as output, which I can't use to import it via this command eem_list <- eem_import_dir(dir) since I only get an error related to the inability to import any data. Should I expect a different output from the first script, apart from the excel file? Am I missing some kind of output (a Rdata file or something like that) we should find in the working directory? Or can there be another issue? Please ask for any extra info you may need to figure out what may be happening.

Thanks in advance for your kind attention.

JL

brycook commented 2 years ago

I have been having a similar issue to this I believe.

Or at least, I am having issues importing EEMs using the eem_read function.

I have had no problems in the past using

folder <- choose.dir() eem_list <- eem_read(folder, import_function = "aqualog")

to import an eem_list. But now, after updating R, I get the error "Error in file.info(file) : invalid filename argument". I reverted back to a previous version of R but the error persists.

I have noticed that eem_read allows me to import individual EEMs if I specify file = "file path" , however, I seemingly can no longer import entire folders with multiple eem files.

Please let me know if you have any questions or suggestions.

Thanks in advance! -Bryce

MatthiasPucher commented 2 years ago

@brycook Sorry for my late answer. I could see, you managed to solve the issue with Philippe. @jllavin77 The scirpt returns two kinds of output. One is a list of corrected EEMs, absorbance and metadate (filename can be adjusted in line 200, default is eem_list_DATE.RData), which can be imported by the eem_import_dir() function. The other thing is the xls file you mentioned. This contains the results. If I understand your question correctly, you were looking for the results from the peak picking in another file format than xls. Is this true? So far, no one ever asked for that and I have not thought about it myself. If you are looking for a way to save the results from the peak picking in an RData file, you can add one line in the script to do so. Please give me some days to think about a good solution, I could add to the package.

jllavin77 commented 2 years ago

@MatthiasPucher My problem is directly related with the total output expected that you described:"The scirpt returns two kinds of output. One is a list of corrected EEMs, absorbance and metadate (filename can be adjusted in line 200, default is eem_list_DATE.RData), which can be imported by the eem_import_dir() function." I only get the xls. bot no clue about the list of corrected EEMs, absorbance and metadata. That is why I can't advence in the analysis. Any idea of why those files are not generated? Thanks in advance

MatthiasPucher commented 2 years ago

Right now, I have no idea. Do you get any message from the knitting process, that could explain the problem?

jllavin77 commented 2 years ago

@MatthiasPucher, I didn't receive any special error after the knitting process... Please find attached the output files yielded from the knitting run, in case you can use them for debugging.

Thanks in advance. EEM_simple_analysis.zip

MatthiasPucher commented 2 years ago

I had a look at your output. You need to remove

setwd(“C:/R_data/PARAFAC/”)

and any other R code from the markdown part of the file. R code needs to be placed in R chunks. Also, something happened to the line if(data_file != FALSE){ save(list=c(eem_name,"abs_data"),file = paste0(output_dir,datafile,"",format(Sys.time(), "%Y%m%d_%H%M%S"),".RData")) } This should not be where it is. I suppose, it is placed outside and R chunk. I suppose, this solves your problems. If you have doubts at any point in the script, you can start over with a fresh template and check the differences.