Problem with import.meas, x not found
Quote from jmprok on October 3, 2019, 11:27 amHi,
I'm finally taking the time to get familiar with the R package, and it looks very good! I have data recorded with AutoResp, but the format is so messy I am trying to make them into FishResp format. I managed to convert the % atm. to mg/L oxygen, but now I can't seem to measure the slopes.
Is the 'file' in import.meas supposed to be imported in R or read from directory? The manual says it is read but it doesn't work with or wihout the path.
This is what I have done:
info <- input.info(DO.unit = "mg/L", ID = c("47","NA", "90", "88"),
Mass = c(13.10,0,22.10,15.10), Volume = c(386.6,0,375.4,368))# Convert % atm. pressure to mg/L oxygen using daily air pressure readings
convert.respirometry("Batch1_raw.txt", "Batch1_raw_converted.txt",
n.chamber = 4,
logger = c("FishResp"),
from = "percent_a.s.", to = "mg_per_l", sal = 0, atm_pres = 1002)# Import raw data in mg/L
SMR.raw <- import.meas(file = "Batch1_raw_converted.txt", info.data=info,
logger="FishResp", n.chamber=4, date.format = "DMY",
meas.to.wait= 150)
And this is the error: Error in eval(expr, envir, enclos) : object 'x' not found
The beginning of the data (this starts from F21):
Date &Time [DD-MM-YYYY/HH:MM:SS] Phase CH1.temp Ox.1 [mg_per_l] CH2.temp Ox.2 [mg_per_l] CH3.temp Ox.3 [mg_per_l] CH4.temp Ox.4 [mg_per_l] 13/04/2017/17:01:49 F21 4.15 12.3223941 4.15 11.1877591 4.15 10.4425102 13/04/2017/17:01:50 F21 4.07 12.3366172 4.07 11.2151065 4.07 10.4980116 13/04/2017/17:01:51 F21 4.14 12.2817709 4.14 11.1906885 4.14 10.4542723 13/04/2017/17:01:52 F21 4.15 12.2991856 4.15 11.1851803 4.15 10.4321953
I'd appreciate any suggestion on what I should do... Also, it would be great if the date could be read in format dd.mm.yyyy/hh:mm
Thanks!
Hi,
I'm finally taking the time to get familiar with the R package, and it looks very good! I have data recorded with AutoResp, but the format is so messy I am trying to make them into FishResp format. I managed to convert the % atm. to mg/L oxygen, but now I can't seem to measure the slopes.
Is the 'file' in import.meas supposed to be imported in R or read from directory? The manual says it is read but it doesn't work with or wihout the path.
This is what I have done:
info <- input.info(DO.unit = "mg/L", ID = c("47","NA", "90", "88"),
Mass = c(13.10,0,22.10,15.10), Volume = c(386.6,0,375.4,368))
# Convert % atm. pressure to mg/L oxygen using daily air pressure readings
convert.respirometry("Batch1_raw.txt", "Batch1_raw_converted.txt",
n.chamber = 4,
logger = c("FishResp"),
from = "percent_a.s.", to = "mg_per_l", sal = 0, atm_pres = 1002)
# Import raw data in mg/L
SMR.raw <- import.meas(file = "Batch1_raw_converted.txt", info.data=info,
logger="FishResp", n.chamber=4, date.format = "DMY",
meas.to.wait= 150)
And this is the error: Error in eval(expr, envir, enclos) : object 'x' not found
The beginning of the data (this starts from F21):
Date &Time [DD-MM-YYYY/HH:MM:SS] | Phase | CH1.temp | Ox.1 [mg_per_l] | CH2.temp | Ox.2 [mg_per_l] | CH3.temp | Ox.3 [mg_per_l] | CH4.temp | Ox.4 [mg_per_l] |
13/04/2017/17:01:49 | F21 | 4.15 | 12.3223941 | 4.15 | 11.1877591 | 4.15 | 10.4425102 | ||
13/04/2017/17:01:50 | F21 | 4.07 | 12.3366172 | 4.07 | 11.2151065 | 4.07 | 10.4980116 | ||
13/04/2017/17:01:51 | F21 | 4.14 | 12.2817709 | 4.14 | 11.1906885 | 4.14 | 10.4542723 | ||
13/04/2017/17:01:52 | F21 | 4.15 | 12.2991856 | 4.15 | 11.1851803 | 4.15 | 10.4321953 |
I'd appreciate any suggestion on what I should do... Also, it would be great if the date could be read in format dd.mm.yyyy/hh:mm
Thanks!
Quote from Sergey Morozov on October 11, 2019, 8:48 amHi Jenni,
I see two small problems with your data. Both of them are related to the fact that the raw "AutoResp" data file has been modified. What I mean is that:
1) the first measurement loop is “M21”, while FishResp expects to see “M1”. So, someone removed the first 20 loops manually.
2) the other columns (i.e. three columns for CH2 and the rest for CH5, CH6, CH7, CH8), originally presented in AutoResp file, have been deleted for some reasons, while FishResp expects to see them too.
As a result, these modified raw ‘AutoResp’ file is not raw ‘AutoResp’ file anymore to the R package, because these small changes make the 'AutoResp' file not readable for FishResp. This issue is related to back-end development of the source code/functions in the R package. Let me show one example explaining it. The phase “M1" is essential to be presented in the raw file, otherwise R will not understand when experiment has been started and, as a result, none of dynamic background correction will work properly.
Anyway, there are two potential solutions:
1) to find the original raw AutoResp files where all the data are presented.
2) to convert manually modified raw AutoResp files into FishResp ones, as you did. Note 1: fill empty values with zeros (in your file the columns are "CH2.temp” and "CH2.Ox"). Note 2: M21 should be M1, M22 should be M2, and so on. So, I have modified your file according to those notes (see the attached file).*
Please, let me know about your progress and do not hesitate to ask further questions and report about potential problems.
Best wishes,
Sergey
(*) Now, you can copy the phase column from the attached file and paste it to your other modified raw AutoResp files to replace ‘incorrect’ indexes of phases there. So, you do not need manually replace let’s say M32 to M1 and so on (I have already done it)... Of course, this will work only if the open/wait/measurement phases are the same length for all respirometry runs in your experiment.
Hi Jenni,
I see two small problems with your data. Both of them are related to the fact that the raw "AutoResp" data file has been modified. What I mean is that:
1) the first measurement loop is “M21”, while FishResp expects to see “M1”. So, someone removed the first 20 loops manually.
2) the other columns (i.e. three columns for CH2 and the rest for CH5, CH6, CH7, CH8), originally presented in AutoResp file, have been deleted for some reasons, while FishResp expects to see them too.
As a result, these modified raw ‘AutoResp’ file is not raw ‘AutoResp’ file anymore to the R package, because these small changes make the 'AutoResp' file not readable for FishResp. This issue is related to back-end development of the source code/functions in the R package. Let me show one example explaining it. The phase “M1" is essential to be presented in the raw file, otherwise R will not understand when experiment has been started and, as a result, none of dynamic background correction will work properly.
Anyway, there are two potential solutions:
1) to find the original raw AutoResp files where all the data are presented.
2) to convert manually modified raw AutoResp files into FishResp ones, as you did. Note 1: fill empty values with zeros (in your file the columns are "CH2.temp” and "CH2.Ox"). Note 2: M21 should be M1, M22 should be M2, and so on. So, I have modified your file according to those notes (see the attached file).*
Please, let me know about your progress and do not hesitate to ask further questions and report about potential problems.
Best wishes,
Sergey
(*) Now, you can copy the phase column from the attached file and paste it to your other modified raw AutoResp files to replace ‘incorrect’ indexes of phases there. So, you do not need manually replace let’s say M32 to M1 and so on (I have already done it)... Of course, this will work only if the open/wait/measurement phases are the same length for all respirometry runs in your experiment.