diff --git a/articles/continuous_flow.html b/articles/continuous_flow.html index ddffeaa..ddef509 100644 --- a/articles/continuous_flow.html +++ b/articles/continuous_flow.html @@ -107,7 +107,7 @@ +iso_get_reader_examples() |> knitr::kable() @@ -243,7 +243,7 @@

Reading files#> processing sample '6617_IAEA600' (IRMS data '80.hdf5', '82.hdf5') #> processing sample '6630_GlutamicAcid04' (IRMS data '124.hdf5', '126.h... #> Info: reading file 'continuous_flow_example.dxf' with '.dxf' reader... -#> Info: finished reading 3 files in 13.96 secs +#> Info: finished reading 3 files in 6.78 secs

File summary @@ -253,73 +253,73 @@

File summaryiso_get_data_summary() function.

-cf_files %>% iso_get_data_summary() %>% knitr::kable()
+cf_files |> iso_get_data_summary() |> knitr::kable()
 #> Info: aggregating data summary from 6 data file(s)

------++++++ + + - - + + - - + + - - + + - - + + - - + + - - + + - -
file_idfile_path_file_subpath raw_data file_info method_infovendor_data_tablefile_path
continuous_flow_example.cfcontinuous_flow_example.cfNA 8605 time points, 2 ions (2,3) 21 entries standards, resistors19 rows, 25 columnscontinuous_flow_example.cf
6632_WSL-2 woodcontinuous_flow_example.iarcTask_0b7e6b49-7756-4cca-b387-4d6617cb28e6 1952 time points, 3 ions (45,46,44) 17 entries no method infono vendor data tablecontinuous_flow_example.iarc|Task_0b7e6b49-7756-4cca-b387-4d6617cb28e6
6605_USGS41continuous_flow_example.iarcTask_0e08e8b4-c625-4fd7-bf5b-9f4823f660cd 2387 time points, 2 ions (29,28) 17 entries no method infono vendor data tablecontinuous_flow_example.iarc|Task_0e08e8b4-c625-4fd7-bf5b-9f4823f660cd
6617_IAEA600continuous_flow_example.iarcTask_1de1fdc3-0797-4e44-8357-52acbd0d4a6d 1796 time points, 3 ions (45,46,44) 17 entries no method infono vendor data tablecontinuous_flow_example.iarc|Task_1de1fdc3-0797-4e44-8357-52acbd0d4a6d
6630_GlutamicAcid04continuous_flow_example.iarcTask_261a3286-0bc6-4aca-bba2-183c02597d8b 2386 time points, 2 ions (29,28) 17 entries no method infono vendor data tablecontinuous_flow_example.iarc|Task_261a3286-0bc6-4aca-bba2-183c02597d8b
continuous_flow_example.dxfcontinuous_flow_example.dxfNA 2435 time points, 6 ions (28,29,30,44,45,46) 21 entries standards, resistors6 rows, 60 columnscontinuous_flow_example.dxf
@@ -333,7 +333,7 @@

Problemsisoreader issue tracker.

-cf_files %>% iso_get_problems_summary() %>% knitr::kable()
+cf_files |> iso_get_problems_summary() |> knitr::kable() @@ -343,7 +343,7 @@

Problems

file_id
+cf_files |> iso_get_problems() |> knitr::kable() @@ -369,7 +369,7 @@

File Information
 # all file information
-cf_files %>% iso_get_file_info(select = c(-file_root)) %>% knitr::kable()
+cf_files |> iso_get_file_info(select = c(-file_root)) |> knitr::kable()
 #> Info: aggregating file info from 6 data file(s), selecting info columns 'c(-file_root)'

file_id
@@ -686,7 +686,7 @@

File Information
 # select file information
-cf_files %>%
+cf_files |>
   iso_get_file_info(
     select = c(
        # rename sample id columns from the different file types to a new ID column
@@ -698,7 +698,7 @@ 

File Information ), # explicitly allow for file specific rename (for the new ID column) file_specific = TRUE - ) %>% knitr::kable() + ) |> knitr::kable() #> Info: aggregating file info from 6 data file(s), selecting info columns 'c(ID = `Identifier 1`, ID = Name, Analysis, `Peak Center`, `H3 Factor`, `Date & Time` = file_datetime)'

@@ -780,7 +780,7 @@

Select/Renameiso_select_file_info():

 # select + rename specific file info columns
-cf_files2 <- cf_files %>%
+cf_files2 <- cf_files |>
   iso_select_file_info(
     ID = `Identifier 1`, ID = `Name`, Analysis, `Peak Center`, `H3 Factor`,
     `Date & Time` = file_datetime,
@@ -793,7 +793,7 @@ 

Select/Rename#> - for 2 file(s): 'file_id', 'Identifier 1'->'ID', 'Analysis', 'Peak Center', 'H3 Factor', 'file_datetime'->'Date & Time', 'Identifier 2'->'Sample Weight' # fetch all file info -cf_files2 %>% iso_get_file_info() %>% knitr::kable() +cf_files2 |> iso_get_file_info() |> knitr::kable() #> Info: aggregating file info from 6 data file(s)

@@ -882,8 +882,8 @@

Filter syntax.

 # find files that have 'acetanilide' in the new ID field
-cf_files2 %>% iso_filter_files(grepl("acetanilide", ID)) %>%
-  iso_get_file_info() %>%
+cf_files2 |> iso_filter_files(grepl("acetanilide", ID)) |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: applying file filter, keeping 1 of 6 files
 #> Info: aggregating file info from 1 data file(s)
@@ -919,9 +919,9 @@

Filter
 
 # find files that were run since 2015
-cf_files2 %>%
-  iso_filter_files(`Date & Time` > "2015-01-01") %>%
-  iso_get_file_info() %>%
+cf_files2 |>
+  iso_filter_files(`Date & Time` > "2015-01-01") |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: applying file filter, keeping 1 of 6 files
 #> Info: aggregating file info from 1 data file(s)
@@ -967,20 +967,20 @@

Mutate iso_with_unit to generate values with implicit units.

 cf_files3 <-
-  cf_files2 %>%
+  cf_files2 |>
   iso_mutate_file_info(
     # update existing column
     ID = paste("ID:", ID),
     # introduce new column
     `Run since 2015?` = `Date & Time` > "2015-01-01",
     # parse weight as a number and turn into a column with units
-    `Sample Weight` = `Sample Weight` %>% parse_number() %>% iso_with_units("mg")
+    `Sample Weight` = `Sample Weight` |> parse_number() |> iso_with_units("mg")
   )
 #> Info: mutating file info for 6 data file(s)
 
-cf_files3 %>%
-  iso_get_file_info() %>%
-  iso_make_units_explicit() %>%
+cf_files3 |>
+  iso_get_file_info() |>
+  iso_make_units_explicit() |>
   knitr::kable()
 #> Info: aggregating file info from 6 data file(s)

@@ -1082,7 +1082,7 @@

Add
 # this kind of information data frame is frequently read in from a csv or xlsx file
 new_info <-
-  dplyr::bind_rows(
+  dplyr::bind_rows(
     # new information based on new vs. old samples
     dplyr::tribble(
       ~file_id, ~`Run since 2015?`,  ~process,  ~info,
@@ -1095,7 +1095,7 @@ 

Add "6617_IAEA600", "no", "did not inject properly" ) ) -new_info %>% knitr::kable()

+new_info |> knitr::kable()

@@ -1138,9 +1138,9 @@

Add
 
 # adding it to the isofiles
-cf_files3 %>%
-  iso_add_file_info(new_info, by1 = "Run since 2015?", by2 = "file_id") %>%
-  iso_get_file_info(select = !!names(new_info)) %>%
+cf_files3 |>
+  iso_add_file_info(new_info, by1 = "Run since 2015?", by2 = "file_id") |>
+  iso_get_file_info(select = !!names(new_info)) |>
   knitr::kable()
 #> Info: adding new file information ('process', 'info', 'note') to 6 data file(s), joining by 'Run since 2015?' then 'file_id'...
 #>  - 'Run since 2015?' join: 2/2 new info rows matched 6/6 data files - 1 of these was/were also matched by subsequent joins which took precedence
@@ -1221,7 +1221,7 @@ 

Parse documentation.

 # use parsing and extraction in iso_mutate_file_info
-cf_files2 %>%
+cf_files2 |>
   iso_mutate_file_info(
     # change type of Peak Center to logical
     `Peak Center` = parse_logical(`Peak Center`),
@@ -1231,8 +1231,8 @@ 

Parse file_id_2nd = extract_word(file_id, 2), # retrieve file extension from the file_id using regular expression name = extract_substring(ID, "(\\w+)-?(.*)?", capture_bracket = 1) - ) %>% - iso_get_file_info(select = c(matches("file_id"), ID, name, `Peak Center`)) %>% + ) |> + iso_get_file_info(select = c(matches("file_id"), ID, name, `Peak Center`)) |> knitr::kable() #> Info: mutating file info for 6 data file(s) #> Info: aggregating file info from 6 data file(s), selecting info columns 'c(matches("file_id"), ID, name, `Peak Center`)'

@@ -1307,9 +1307,9 @@

Parse
 
 # use parsing in iso_filter_file_info
-cf_files2 %>%
-  iso_filter_files(parse_number(`H3 Factor`) > 2) %>%
-  iso_get_file_info() %>%
+cf_files2 |>
+  iso_filter_files(parse_number(`H3 Factor`) > 2) |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: applying file filter, keeping 1 of 6 files
 #> Info: aggregating file info from 1 data file(s)
@@ -1345,13 +1345,13 @@

Parse
 
 # use iso_parse_file_info for simplified parsing of column data types
-cf_files2 %>%
+cf_files2 |>
   iso_parse_file_info(
     integer = Analysis,
     number = `H3 Factor`,
     logical = `Peak Center`
-  ) %>%
-  iso_get_file_info() %>%
+  ) |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: parsing 3 file info columns for 6 data file(s):
 #>  - to integer: 'Analysis'
@@ -1443,7 +1443,7 @@ 

Resistors
-cf_files %>% iso_get_resistors() %>% knitr::kable()
+cf_files |> iso_get_resistors() |> knitr::kable()
 #> Info: aggregating resistors info from 6 data file(s)

@@ -1510,7 +1510,7 @@

Reference valuesAs well as isotopic reference values for the different gases:

 # reference delta values without ratio values
-cf_files %>% iso_get_standards(file_id:reference) %>% knitr::kable()
+cf_files |> iso_get_standards(file_id:reference) |> knitr::kable()
 #> Info: aggregating standards info from 6 data file(s)

@@ -1566,7 +1566,7 @@

Reference values
 # reference values with ratios
-cf_files %>% iso_get_standards() %>% knitr::kable()
+cf_files |> iso_get_standards() |> knitr::kable()
 #> Info: aggregating standards info from 6 data file(s)

@@ -1716,7 +1716,7 @@

Raw Dataiso_get_file_info function discussed earlier.

 # get raw data with default selections (all raw data, no additional file info)
-cf_files %>% iso_get_raw_data() %>% head(n=10) %>% knitr::kable()
+cf_files |> iso_get_raw_data() |> head(n=10) |> knitr::kable()
 #> Info: aggregating raw data from 6 data file(s)

@@ -1940,15 +1940,15 @@

Raw Data
 # get specific raw data and add some file information
-cf_files %>%
+cf_files |>
   iso_get_raw_data(
     # select just time and the m/z 2 and 3 ions
     select = c(time.s, v2.mV, v3.mV),
     # include the Analysis number fron the file info and rename it to 'run'
     include_file_info = c(run = Analysis)
-  ) %>%
+  ) |>
   # look at first few records only
-  head(n=10) %>% knitr::kable()
+  head(n=10) |> knitr::kable()
 #> Info: aggregating raw data from 6 data file(s), selecting data columns 'c(time.s, v2.mV, v3.mV)', including file info 'c(run = Analysis)'

@@ -2058,7 +2058,7 @@

Vendor Data Table
 # entire vendor data table
-cf_files %>% iso_get_vendor_data_table() %>% knitr::kable()
+cf_files |> iso_get_vendor_data_table() |> knitr::kable()
 #> Info: aggregating vendor data table from 6 data file(s)

@@ -4199,13 +4199,13 @@

Vendor Data Table
 # get specific parts and add some file information
-cf_files %>%
+cf_files |>
   iso_get_vendor_data_table(
     # select peak number, ret. time, overall intensity and all H delta columns
     select = c(Nr., Rt, area = `rIntensity All`, matches("^d \\d+H")),
     # include the Analysis number fron the file info and rename it to 'run'
     include_file_info = c(run = Analysis)
-  ) %>%
+  ) |>
   knitr::kable()
 #> Info: aggregating vendor data table from 6 data file(s), including file info 'c(run = Analysis)'

@@ -4459,15 +4459,15 @@

Vendor Data Table # the data table also provides units if included in the original data file # which can be made explicit using the function iso_make_units_explicit() -cf_files %>% +cf_files |> iso_get_vendor_data_table( # select peak number, ret. time, overall intensity and all H delta columns select = c(Nr., Rt, area = `rIntensity All`, matches("^d \\d+H")), # include the Analysis number fron the file info and rename it to 'run' include_file_info = c(run = Analysis) - ) %>% + ) |> # make column units explicit - iso_make_units_explicit() %>% + iso_make_units_explicit() |> knitr::kable() #> Info: aggregating vendor data table from 6 data file(s), including file info 'c(run = Analysis)'

@@ -4726,7 +4726,7 @@

For expert users: retrieving all d unnest), there is an easy way to retrieve all data from the iso file objects in a single nested data frame:

-all_data <- cf_files %>% iso_get_all_data()
+all_data <- cf_files |> iso_get_all_data()
 #> Info: aggregating all data from 6 data file(s)
 # not printed out because this data frame is very big
@@ -4743,7 +4743,7 @@

Saving collections
 # export to R data archive
-cf_files %>% iso_save("cf_files_export.cf.rds")
+cf_files |> iso_save("cf_files_export.cf.rds")
 #> Info: exporting data from 6 iso_files into R Data Storage 'cf_files_export.cf.rds'
 
 # read back the exported R data archive
@@ -4751,74 +4751,74 @@ 

Saving collections#> Info: preparing to read 1 data files (all will be cached)... #> Info: reading file 'cf_files_export.cf.rds' with '.cf.rds' reader... #> Info: loaded 6 data files from R Data Storage -#> Info: finished reading 1 files in 0.17 secs -cf_files %>% iso_get_data_summary() %>% knitr::kable() +#> Info: finished reading 1 files in 0.10 secs +cf_files |> iso_get_data_summary() |> knitr::kable() #> Info: aggregating data summary from 6 data file(s)

------++++++ + + - - + + - - + + - - + + - - + + - - + + - - + + - -
file_idfile_path_file_subpath raw_data file_info method_infovendor_data_tablefile_path
continuous_flow_example.cfcontinuous_flow_example.cfNA 8605 time points, 2 ions (2,3) 21 entries standards, resistors19 rows, 25 columnscontinuous_flow_example.cf
6632_WSL-2 woodcontinuous_flow_example.iarcTask_0b7e6b49-7756-4cca-b387-4d6617cb28e6 1952 time points, 3 ions (45,46,44) 17 entries no method infono vendor data tablecontinuous_flow_example.iarc|Task_0b7e6b49-7756-4cca-b387-4d6617cb28e6
6605_USGS41continuous_flow_example.iarcTask_0e08e8b4-c625-4fd7-bf5b-9f4823f660cd 2387 time points, 2 ions (29,28) 17 entries no method infono vendor data tablecontinuous_flow_example.iarc|Task_0e08e8b4-c625-4fd7-bf5b-9f4823f660cd
6617_IAEA600continuous_flow_example.iarcTask_1de1fdc3-0797-4e44-8357-52acbd0d4a6d 1796 time points, 3 ions (45,46,44) 17 entries no method infono vendor data tablecontinuous_flow_example.iarc|Task_1de1fdc3-0797-4e44-8357-52acbd0d4a6d
6630_GlutamicAcid04continuous_flow_example.iarcTask_261a3286-0bc6-4aca-bba2-183c02597d8b 2386 time points, 2 ions (29,28) 17 entries no method infono vendor data tablecontinuous_flow_example.iarc|Task_261a3286-0bc6-4aca-bba2-183c02597d8b
continuous_flow_example.dxfcontinuous_flow_example.dxfNA 2435 time points, 6 ions (28,29,30,44,45,46) 21 entries standards, resistors6 rows, 60 columnscontinuous_flow_example.dxf
@@ -4834,13 +4834,13 @@

Data Export
 # export to excel
-cf_files %>% iso_export_to_excel("cf_files_export")
+cf_files |> iso_export_files_to_excel("cf_files_export")
 
 # data sheets available in the exported data file:
 readxl::excel_sheets("cf_files_export.cf.xlsx")
 # export to feather
-cf_files %>% iso_export_to_feather("cf_files_export")
+cf_files |> iso_export_files_to_feather("cf_files_export")
 
 # exported feather files
 list.files(pattern = ".cf.feather")
diff --git a/articles/development.html b/articles/development.html index 2082548..1e3ff83 100644 --- a/articles/development.html +++ b/articles/development.html @@ -107,7 +107,7 @@ @@ -387,7 +387,7 @@

Processing hooksc( iso_get_reader_example("dual_inlet_example.did"), iso_get_reader_example("dual_inlet_example.caf") -) %>% iso_read_dual_inlet(read_cache = FALSE) +) |> iso_read_dual_inlet(read_cache = FALSE) #> Info: preparing to read 2 data files (all will be cached)... #> Info: reading file 'dual_inlet_example.did' with '.did' reader... #> Info: starting file #1, named 'dual_inlet_example.did' @@ -395,15 +395,13 @@

Processing hooks#> Info: reading file 'dual_inlet_example.caf' with '.caf' reader... #> Info: starting file #2, named 'dual_inlet_example.caf' #> Info: finished file #2 -#> Info: finished reading 2 files in 10.73 secs +#> Info: finished reading 2 files in 8.90 secs #> Data from 2 dual inlet iso files: #> # A tibble: 2 × 6 -#> file_id raw_data file_…¹ metho…² vendo…³ file_…⁴ -#> <chr> <glue> <chr> <chr> <chr> <chr> -#> 1 dual_inlet_example.did 7 cycles, 6 ions (44,4… 16 ent… standa… 7 rows… dual_i… -#> 2 dual_inlet_example.caf 8 cycles, 6 ions (44,4… 22 ent… standa… 8 rows… dual_i… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, -#> # ³​vendor_data_table, ⁴​file_path +#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 dual_inlet_example.did dual_inlet… NA 7 cycle… 16 entri… standards,… +#> 2 dual_inlet_example.caf dual_inlet… NA 8 cycle… 22 entri… standards,… isoreader:::initialize_options() # reset all isoreader options @@ -419,104 +417,131 @@

Debugging isoreader -

Debugging binary file reads (Isodat) -

+ +
+

Debugging binary file reads (Isodat) +

Errors during the binary file reads usually indicate the approximate position in the file where the error was encountered. The easiest way to get started on figuring out what the file looks like at that position is to use a binary file editor and jump to the position. For a sense of the -interpreted structure around that position, one can use the internal -function map_binary_structure which tries to apply all -frequently occurring binary patterns recognized by isoreader. The binary -representation of the source file is only available if in debug mode but -if debug mode is ON, it can be accessed as follows:

+interpreted structure around that position, one can use +iso_print_source_file_structure() which shows what binary +patterns isoreader recognized. This binary representation of the source +file is only available if the file is read while in debug mode, +otherwise file objects would get unnecessarily large:

 # turn on debug mode
 isoreader:::iso_turn_debug_on()
 #> Info: debug mode turned on, error catching turned on, caching turned off
 # read example file
-ex <- iso_get_reader_example("dual_inlet_example.did") %>%  
+ex <- iso_get_reader_example("dual_inlet_example.did") |>  
   iso_read_dual_inlet(quiet = TRUE)
-# access binary
-bin <- ex$binary
-# use structure mapping
-bin %>%
-  isoreader:::move_to_pos(1340) %>%
-  isoreader:::map_binary_structure(length = 200)
-#> # Binary data structure:  
-#> 0001340: {4d 65 73 73 61 67 65 44 61 74 61}
-#> 0001351:   <etx>
-#> 0001355:   {/}<fef-0><fef-12>{Peak Center foun..}<4x00><1-000><fef-1c>{Peak Center found at [61032]}<fef-09>{CUserInfo}<ffff>{00 00 00 00 1b 80}
-#> 0001501: <etx>
-#> 0001505: {/}<fef-0><fef-12>
+# retrieve source structure and print a part of it +bin <- ex |> iso_get_source_file_structure() +bin |> iso_print_source_file_structure(length = 500) +#> # Textual representation of the partial structure (bytes 1 - 504) of the isodat file. +#> # Print more/less by specifying the 'start', 'length' or 'end' parameters. +#> 0000001: <CFileHeader>{unknown-4: 'fe f7 31 01'} +#> 0000022: <06-000>{text-10: 'CBlockData'}{text-18: 'CDualInletDocument'}<4x00> +#> 0000094: <03-000>{unknown-2: '2f 00'}{text-20: 'Acquisition-1568.did'}{text-11: 'File Header'}<4x00> +#> 0000174: <02-000> +#> 0000178: <02-000> +#> 0000182: <CTimeObject> +#> 0000199: <03-000>{unknown-2: '2f 00'}{text-4: 'Date'}{text-4: 'Date'}<4x00> +#> 0000233: <01-000>{unknown-4: '4a 2b 4e 54'} +#> 0000241: <CStr> +#> 0000251: <02-000>{text-18: 'RW2000TemplateName'} +#> 0000295: <02-000>{text-84: 'C:\Thermo\Isodat NT\Global\User\Dual Inlet System\Result Workshop\Default Result.IRW'} +#> 0000471: <CDataIndex> +#> 0000487: <03-000>{unknown-2: '2f 00'}{text-0: 'NA'}{text-0: 'NA'}<4x00>

This structure representation shows recognized control elements in <...> and data elements in {...} which are converted to text or numeric representation if the interpretation is unambiguous, or plain hexadecimal characters if the nature of the data -cannot be determined with certainty. Because this function tries all -possible control elements and data interpretations, it is quite slow and -may take a while if run for large stretches of binary code (i.e. if the -length parameter is very long).

-

For an overview of all the control elements that are currently -consider, use the internal get_ctrl_blocks_config_df() -function.

+cannot be determined with certainty. You can adjust start +and length to look at different parts of the binary file or +save the the structure to a text file with +save_to_file.

+

For an overview of all the elements (blocks) identified +in the binary file as a tibble, use:

-isoreader:::get_ctrl_blocks_config_df()
-#> # A tibble: 26 × 3
-#>    block    regexp                              hexadecimal                     
-#>    <chr>    <chr>                               <chr>                           
-#>  1 del-nl   "\x7f\x85"                          7f 85                           
-#>  2 eop-nl   "܅"                                 dc 85                           
-#>  3 0b-80    "\v\x80"                            0b 80                           
-#>  4 e0-81    "\xe0\x81"                          e0 81                           
-#>  5 ce-80    "\u0380"                            ce 80                           
-#>  6 ce-8a    "Ί"                                 ce 8a                           
-#>  7 ee-85    "\xee\x85"                          ee 85                           
-#>  8 75-84    "u\x84"                             75 84                           
-#>  9 ff-80    "\\x00\xff\x80\\x00"                5c 78 30 30 ff 80 5c 78 30 30   
-#> 10 07-80-id "\x05\x80.\xff(\\x00|\x80|\xff){2}" 05 80 2e ff 28 5c 78 30 30 7c 8…
-#> # … with 16 more rows
-

Additional information can be gleaned from the so-called control -blocks, which are larger structural elements of Isodat binary files and -are kept in a data frame within the binary object (again only available -in debug mode).

+bin$blocks |> head(20) +#> # A tibble: 20 × 8 +#> block_idx start end len data_len type priority block +#> <int> <int> <int> <int> <dbl> <chr> <int> <chr> +#> 1 1 1 17 17 11 C block 1 CFileHeader +#> 2 2 18 21 4 4 unknown 5 fe f7 31 01 +#> 3 3 22 25 4 0 x-000 3 06-000 +#> 4 4 26 49 24 10 text 2 CBlockData +#> 5 5 50 89 40 18 text 2 CDualInletDocument +#> 6 6 90 93 4 0 0000+ 4 4x00 +#> 7 7 94 97 4 0 x-000 3 03-000 +#> 8 8 98 99 2 2 unknown 5 2f 00 +#> 9 9 100 143 44 20 text 2 Acquisition-1568.did +#> 10 10 144 169 26 11 text 2 File Header +#> 11 11 170 173 4 0 0000+ 4 4x00 +#> 12 12 174 177 4 0 x-000 3 02-000 +#> 13 13 178 181 4 0 x-000 3 02-000 +#> 14 14 182 198 17 11 C block 1 CTimeObject +#> 15 15 199 202 4 0 x-000 3 03-000 +#> 16 16 203 204 2 2 unknown 5 2f 00 +#> 17 17 205 216 12 4 text 2 Date +#> 18 18 217 228 12 4 text 2 Date +#> 19 19 229 232 4 0 0000+ 4 4x00 +#> 20 20 233 236 4 0 x-000 3 01-000 +

While this provides all elements, the top level structure is provided +by the so-called control blocks:

-bin$C_blocks
-#> # A tibble: 107 × 5
-#>    id1   id2   block                 start   end
-#>    <chr> <chr> <chr>                 <int> <dbl>
-#>  1 06    0b    CFileHeader               1    17
-#>  2 01    0b    CTimeObject             182   198
-#>  3 02    04    CStr                    241   250
-#>  4 01    0a    CDataIndex              471   486
-#>  5 01    11    CSeqLineIndexData       513   535
-#>  6 03    05    CData                   588   598
-#>  7 01    13    CDualInletBlockData    1133  1157
-#>  8 01    10    CMeasurmentInfos       1240  1261
-#>  9 01    15    CISLScriptMessageData  1324  1350
-#> 10 01    11    CMeasurmentErrors      1945  1967
-#> # … with 97 more rows
-

Same as for specific byte positions, one can use the control blocks -to navigate the file and map_binary_structure.

+bin$blocks |> dplyr::filter(type == "C block") |> head(20) +#> # A tibble: 20 × 8 +#> block_idx start end len data_len type priority block +#> <int> <int> <int> <int> <dbl> <chr> <int> <chr> +#> 1 1 1 17 17 11 C block 1 CFileHeader +#> 2 14 182 198 17 11 C block 1 CTimeObject +#> 3 22 241 250 10 4 C block 1 CStr +#> 4 27 471 486 16 10 C block 1 CDataIndex +#> 5 35 513 535 23 17 C block 1 CSeqLineIndexData +#> 6 43 588 598 11 5 C block 1 CData +#> 7 113 1133 1157 25 19 C block 1 CDualInletBlockData +#> 8 121 1240 1261 22 16 C block 1 CMeasurmentInfos +#> 9 129 1324 1350 27 21 C block 1 CISLScriptMessageData +#> 10 163 1945 1967 23 17 C block 1 CMeasurmentErrors +#> 11 172 2038 2060 23 17 C block 1 CDualInletRawData +#> 12 180 2099 2114 16 10 C block 1 CBlockData +#> 13 188 2269 2302 34 28 C block 1 CIntegrationUnitTransf… +#> 14 199 2361 2380 20 14 C block 1 CIntensityData +#> 15 639 5299 5319 21 15 C block 1 CDualInletShout +#> 16 655 5460 5485 26 20 C block 1 CTwoDoublesArrayData +#> 17 827 6412 6433 22 16 C block 1 CStatusArrayData +#> 18 885 6747 6764 18 12 C block 1 COutlierData +#> 19 6461 40876 40902 27 21 C block 1 CResultDataSimpleList +#> 20 6469 40951 40973 23 17 C block 1 CResultDataSimple +

To look at specific control-blocks, simply provide the relevant start +position to iso_print_source_file_structure():

-bin %>%
-  isoreader:::move_to_C_block("CMethod") %>%
-  isoreader:::map_binary_structure(length = 200)
-#> # Binary data structure:  
-#> 0080269: <etx>
-#> 0080273:   {-}<fef-0><fef-06>{Method}<4x00>
-#> 0080299:   <stx>
-#> 0080303:     <7-000>
-#> 0080307:     <C-01-09 CMolecule>
-#> 0080322:   <etx>
-#> 0080326:   {-}<fef-0d>{Eval@Molecule}<fef-0d>{Eval@Molecule}<4x00><1-000><fef-03>{CO2}
-#> 0080406:   <C-00-0b CPartMirror>
-#> 0080423:   <C-02-13 CMethodPrintoutDesc>
-#> 0080448: <etx>
-#> 0080452: {-}<fef-0><fef-0><4x00>
-#> 0080466: <stx>
- +cdata <- bin$blocks |> dplyr::filter(block == "CData") +cdata +#> # A tibble: 1 × 8 +#> block_idx start end len data_len type priority block +#> <int> <int> <int> <int> <dbl> <chr> <int> <chr> +#> 1 43 588 598 11 5 C block 1 CData + +bin |> iso_print_source_file_structure(start = cdata$start, length = 500) +#> # Textual representation of the partial structure (bytes 588 - 1098) of the isodat file. +#> # Print more/less by specifying the 'start', 'length' or 'end' parameters. +#> 0000588: <CData> +#> 0000599: <03-000>{unknown-2: '2f 00'}{text-3: '158'}{text-4: 'Line'}<4x00>{unknown-2: '0b 80'} +#> 0000633: <03-000>{unknown-2: '2f 00'}{text-1: '1'}{text-11: 'Peak Center'}<4x00>{unknown-2: '0b 80'} +#> 0000677: <03-000>{unknown-2: '2f 00'}{text-1: '1'}{text-11: 'Pressadjust'}<4x00>{unknown-2: '0b 80'} +#> 0000721: <03-000>{unknown-2: '2f 00'}{text-1: '1'}{text-10: 'Background'}<4x00>{unknown-2: '0b 80'} +#> 0000763: <03-000>{unknown-2: '2f 00'}{text-11: 'CIT Carrara'}{text-12: 'Identifier 1'}<4x00>{unknown-2: '0b 80'} +#> 0000829: <03-000>{unknown-2: '2f 00'}{text-2: '13'}{text-12: 'Identifier 2'}<4x00>{unknown-2: '0b 80'} +#> 0000877: <03-000>{unknown-2: '2f 00'}{text-5: '49077'}{text-8: 'Analysis'}<4x00>{unknown-2: '0b 80'} +#> 0000923: <03-000>{unknown-2: '2f 00'}{text-0: 'NA'}{text-7: 'Comment'}<4x00>{unknown-2: '0b 80'} +#> 0000957: <03-000>{unknown-2: '2f 00'}{text-0: 'NA'}{text-11: 'Preparation'}<4x00>{unknown-2: '0b 80'} +#> 0000999: <03-000>{unknown-2: '2f 00'}{text-0: 'NA'}{text-11: 'Post Script'}<4x00>{unknown-2: '0b 80'} +#> 0001041: <03-000>{unknown-2: '2f 00'}{text-16: 'CO2_multiply_16V'}{text-6: 'Method'} diff --git a/articles/dual_inlet.html b/articles/dual_inlet.html index 0754a8e..7c36e7e 100644 --- a/articles/dual_inlet.html +++ b/articles/dual_inlet.html @@ -107,7 +107,7 @@ @@ -231,7 +231,7 @@

Reading files#> Info: reading file 'dual_inlet_example.did' from cache... #> Info: reading file 'dual_inlet_example.caf' from cache... #> Info: reading file 'dual_inlet_nu_example.txt' with '.txt' reader... -#> Info: finished reading 3 files in 1.34 secs +#> Info: finished reading 3 files in 0.92 secs

File summary @@ -241,49 +241,49 @@

File summaryiso_get_data_summary() function.

-di_files %>% iso_get_data_summary() %>% knitr::kable()
+di_files |> iso_get_data_summary() |> knitr::kable()
 #> Info: aggregating data summary from 3 data file(s)

------++++++ + + - - + + - - + + - - + + - -
file_idfile_path_file_subpath raw_data file_info method_infovendor_data_tablefile_path
dual_inlet_example.diddual_inlet_example.didNA 7 cycles, 6 ions (44,45,46,47,48,49) 16 entries standards, resistors7 rows, 8 columnsdual_inlet_example.did
dual_inlet_example.cafdual_inlet_example.cafNA 8 cycles, 6 ions (44,45,46,47,48,49) 22 entries standards, resistors8 rows, 9 columnsdual_inlet_example.caf
dual_inlet_nu_example.txtdual_inlet_nu_example.txtNA 82 cycles, 6 ions (44,45,46,47,48,49) 9 entries no method infono vendor data tabledual_inlet_nu_example.txt
@@ -297,7 +297,7 @@

Problemsisoreader issue tracker.

-di_files %>% iso_get_problems_summary() %>% knitr::kable()
+di_files |> iso_get_problems_summary() |> knitr::kable() @@ -307,7 +307,7 @@

Problems

file_id
+di_files |> iso_get_problems() |> knitr::kable() @@ -333,7 +333,7 @@

File Information
 # all file information
-di_files %>% iso_get_file_info(select = c(-file_root)) %>% knitr::kable()
+di_files |> iso_get_file_info(select = c(-file_root)) |> knitr::kable()
 #> Info: aggregating file info from 3 data file(s), selecting info columns 'c(-file_root)'

file_id
@@ -478,7 +478,7 @@

File Information
 # select file information
-di_files %>%
+di_files |>
   iso_get_file_info(
     select = c(
       # rename sample id columns from the different file types to a new ID column
@@ -492,7 +492,7 @@ 

File Information ), # explicitly allow for file specific rename (for the new ID column) file_specific = TRUE - ) %>% knitr::kable() + ) |> knitr::kable() #> Info: aggregating file info from 3 data file(s), selecting info columns 'c(ID = `Identifier 1`, ID = `Sample Name`, Analysis, Method, `Peak Center`, `Date & Time` = file_datetime, `Sample Weight`, `Sample Weight` = `Weight [mg]`)'

@@ -555,7 +555,7 @@

Select/Renameiso_select_file_info():

 # select + rename specific file info columns
-di_files2 <- di_files %>%
+di_files2 <- di_files |>
   iso_select_file_info(
     ID = `Identifier 1`, ID = `Sample Name`, Analysis, Method,
     `Peak Center`, `Date & Time` = file_datetime,
@@ -568,7 +568,7 @@ 

Select/Rename#> - for 1 file(s): 'file_id', 'Sample Name'->'ID', 'file_datetime'->'Date & Time', 'Sample Weight' # fetch all file info -di_files2 %>% iso_get_file_info() %>% knitr::kable() +di_files2 |> iso_get_file_info() |> knitr::kable() #> Info: aggregating file info from 3 data file(s)

@@ -630,8 +630,8 @@

Filter syntax.

 # find files that have 'CIT' in the new ID field
-di_files2 %>% iso_filter_files(grepl("CIT", ID)) %>%
-  iso_get_file_info() %>%
+di_files2 |> iso_filter_files(grepl("CIT", ID)) |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: applying file filter, keeping 1 of 3 files
 #> Info: aggregating file info from 1 data file(s)
@@ -664,9 +664,9 @@

Filter
 
 # find files that were run in 2017
-di_files2 %>%
-  iso_filter_files(`Date & Time` > "2017-01-01" & `Date & Time` < "2018-01-01") %>%
-  iso_get_file_info() %>%
+di_files2 |>
+  iso_filter_files(`Date & Time` > "2017-01-01" & `Date & Time` < "2018-01-01") |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: applying file filter, keeping 2 of 3 files
 #> Info: aggregating file info from 2 data file(s)
@@ -722,20 +722,20 @@

Mutate syntax. It can also be used in conjunction with iso_with_unit to generate values with implicit units.

-di_files3 <- di_files2 %>%
+di_files3 <- di_files2 |>
   iso_mutate_file_info(
     # update existing column
     ID = paste("ID:", ID),
     # introduce new column
     `Run in 2017?` = `Date & Time` > "2017-01-01" & `Date & Time` < "2018-01-01",
     # parse weight as a number and turn into a column with units
-    `Sample Weight` = `Sample Weight` %>% parse_number() %>% iso_with_units("mg")
+    `Sample Weight` = `Sample Weight` |> parse_number() |> iso_with_units("mg")
   )
 #> Info: mutating file info for 3 data file(s)
 
-di_files3 %>%
-  iso_get_file_info() %>%
-  iso_make_units_explicit() %>%
+di_files3 |>
+  iso_get_file_info() |>
+  iso_make_units_explicit() |>
   knitr::kable()
 #> Info: aggregating file info from 3 data file(s)

@@ -807,7 +807,7 @@

Add
 # this kind of information data frame is frequently read in from a csv or xlsx file
 new_info <-
-  dplyr::bind_rows(
+  dplyr::bind_rows(
     # new information based on new vs. old samples
     dplyr::tribble(
       ~Analysis, ~`Run in 2017?`,  ~process,  ~info,
@@ -820,7 +820,7 @@ 

Add "16068", "no", "did not inject properly" ) ) -new_info %>% knitr::kable()

+new_info |> knitr::kable()

@@ -856,9 +856,9 @@

Add
 
 # adding it to the isofiles
-di_files3 %>%
-  iso_add_file_info(new_info, by1 = "Run in 2017?", by2 = "Analysis") %>%
-  iso_get_file_info(select = !!names(new_info)) %>%
+di_files3 |>
+  iso_add_file_info(new_info, by1 = "Run in 2017?", by2 = "Analysis") |>
+  iso_get_file_info(select = !!names(new_info)) |>
   knitr::kable()
 #> Info: adding new file information ('process', 'info', 'note') to 3 data file(s), joining by 'Run in 2017?' then 'Analysis'...
 #>  - 'Run in 2017?' join: 2/2 new info rows matched 3/3 data files - 1 of these was/were also matched by subsequent joins which took precedence
@@ -923,7 +923,7 @@ 

Parse documentation.

 # use parsing and extraction in iso_mutate_file_info
-di_files2 %>%
+di_files2 |>
   iso_mutate_file_info(
     # change type of Peak Center to logical
     `Peak Center` = parse_logical(`Peak Center`),
@@ -933,8 +933,8 @@ 

Parse Method_2nd = extract_word(Method, 2), # retrieve file extension from the file_id using regular expression extension = extract_substring(file_id, "\\.(\\w+)$", capture_bracket = 1) - ) %>% - iso_get_file_info(select = c(extension, `Peak Center`, matches("Method"))) %>% + ) |> + iso_get_file_info(select = c(extension, `Peak Center`, matches("Method"))) |> knitr::kable() #> Info: mutating file info for 3 data file(s) #> Info: aggregating file info from 3 data file(s), selecting info columns 'c(extension, `Peak Center`, matches("Method"))'

@@ -985,9 +985,9 @@

Parse
 
 # use parsing in iso_filter_file_info
-di_files2 %>%
-  iso_filter_files(parse_integer(Analysis) > 1500) %>%
-  iso_get_file_info() %>%
+di_files2 |>
+  iso_filter_files(parse_integer(Analysis) > 1500) |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: applying file filter, keeping 2 of 3 files
 #> Info: aggregating file info from 2 data file(s)
@@ -1034,13 +1034,13 @@

Parse
 
 # use iso_parse_file_info for simplified parsing of column data types
-di_files2 %>%
+di_files2 |>
   iso_parse_file_info(
     integer = Analysis,
     number = `Sample Weight`,
     logical = `Peak Center`
-  ) %>%
-  iso_get_file_info() %>%
+  ) |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: parsing 3 file info columns for 3 data file(s):
 #>  - to integer: 'Analysis'
@@ -1105,7 +1105,7 @@ 

Resistors
-di_files %>% iso_get_resistors() %>% knitr::kable()
+di_files |> iso_get_resistors() |> knitr::kable()
 #> Info: aggregating resistors info from 3 data file(s)

Analysis
@@ -1196,7 +1196,7 @@

Reference valuesAs well as isotopic reference values for the different gases:

 # reference delta values without ratio values
-di_files %>% iso_get_standards(file_id:reference) %>% knitr::kable()
+di_files |> iso_get_standards(file_id:reference) |> knitr::kable()
 #> Info: aggregating standards info from 3 data file(s)

@@ -1276,7 +1276,7 @@

Reference values
 # reference values with ratios
-di_files %>% iso_get_standards() %>% knitr::kable()
+di_files |> iso_get_standards() |> knitr::kable()
 #> Info: aggregating standards info from 3 data file(s)

@@ -1481,7 +1481,7 @@

Raw Dataiso_get_file_info function discussed earlier.

 # get raw data with default selections (all raw data, no additional file info)
-di_files %>% iso_get_raw_data() %>% head(n=10) %>% knitr::kable()
+di_files |> iso_get_raw_data() |> head(n=10) |> knitr::kable()
 #> Info: aggregating raw data from 3 data file(s)

@@ -1705,15 +1705,15 @@

Raw Data
 # get specific raw data and add some file information
-di_files %>%
+di_files |>
   iso_get_raw_data(
     # select just time and the two ions
     select = c(type, cycle, v44.mV, v45.mV),
     # include the Analysis number fron the file info and rename it to 'run'
     include_file_info = c(run = Analysis)
-  ) %>%
+  ) |>
   # look at first few records only
-  head(n=10) %>% knitr::kable()
+  head(n=10) |> knitr::kable()
 #> Info: aggregating raw data from 3 data file(s), selecting data columns 'c(type, cycle, v44.mV, v45.mV)', including file info 'c(run = Analysis)'

@@ -1833,7 +1833,7 @@

Vendor Data Table
 # entire vendor data table
-di_files %>% iso_get_vendor_data_table() %>% knitr::kable()
+di_files |> iso_get_vendor_data_table() |> knitr::kable()
 #> Info: aggregating vendor data table from 3 data file(s)

@@ -2079,13 +2079,13 @@

Vendor Data Table
 # get specific parts and add some file information
-di_files %>%
+di_files |>
   iso_get_vendor_data_table(
     # select cycle and all carbon columns
     select = c(cycle, matches("C")),
     # include the Identifier 1 fron the file info and rename it to 'id'
     include_file_info = c(id = `Identifier 1`)
-  ) %>% knitr::kable()
+  ) |> knitr::kable()
 #> Info: aggregating vendor data table from 3 data file(s), including file info 'c(id = `Identifier 1`)'

@@ -2304,7 +2304,7 @@

For expert users: retrieving all d unnest), there is an easy way to retrieve all data from the iso file objects in a single nested data frame:

-all_data <- di_files %>% iso_get_all_data()
+all_data <- di_files |> iso_get_all_data()
 #> Info: aggregating all data from 3 data file(s)
 # not printed out because this data frame is very big
@@ -2320,7 +2320,7 @@

Saving collections
 # export to R data archive
-di_files %>% iso_save("di_files_export.di.rds")
+di_files |> iso_save("di_files_export.di.rds")
 #> Info: exporting data from 3 iso_files into R Data Storage 'di_files_export.di.rds'
 
 # read back the exported R data storage
@@ -2328,16 +2328,14 @@ 

Saving collections#> Info: preparing to read 1 data files (all will be cached)... #> Info: reading file 'di_files_export.di.rds' with '.di.rds' reader... #> Info: loaded 3 data files from R Data Storage -#> Info: finished reading 1 files in 0.18 secs +#> Info: finished reading 1 files in 0.09 secs #> Data from 3 dual inlet iso files: #> # A tibble: 3 × 6 -#> file_id raw_data file_…¹ metho…² vendo…³ file_…⁴ -#> <chr> <glue> <chr> <chr> <chr> <chr> -#> 1 dual_inlet_example.did 7 cycles, 6 ions (4… 16 ent… standa… 7 rows… dual_i… -#> 2 dual_inlet_example.caf 8 cycles, 6 ions (4… 22 ent… standa… 8 rows… dual_i… -#> 3 dual_inlet_nu_example.txt 82 cycles, 6 ions (… 9 entr… no met… no ven… dual_i… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, -#> # ³​vendor_data_table, ⁴​file_path

+#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 dual_inlet_example.did dual_inle… NA 7 cycle… 16 entri… standards,… +#> 2 dual_inlet_example.caf dual_inle… NA 8 cycle… 22 entri… standards,… +#> 3 dual_inlet_nu_example.… dual_inle… NA 82 cycl… 9 entries no method …

Data Export @@ -2350,13 +2348,13 @@

Data Export
 # export to excel
-di_files %>% iso_export_to_excel("di_files_export")
+di_files |> iso_export_files_to_excel("di_files_export")
 
 # data sheets available in the exported data file:
 readxl::excel_sheets("di_files_export.di.xlsx")

 # export to feather
-di_files %>% iso_export_to_feather("di_files_export")
+di_files |> iso_export_files_to_feather("di_files_export")
 
 # exported feather files
 list.files(pattern = ".di.feather")
diff --git a/articles/operations.html b/articles/operations.html index aaffa63..9bb8718 100644 --- a/articles/operations.html +++ b/articles/operations.html @@ -107,7 +107,7 @@

@@ -221,14 +221,14 @@

Messagesiso_turn_info_messages_off()

 # read a file in the default verbose mode
-iso_get_reader_example("dual_inlet_example.did") %>%
-  iso_read_dual_inlet() %>%
-  iso_select_file_info(file_datetime, `Identifier 1`) %>%
-  iso_get_file_info() %>%
+iso_get_reader_example("dual_inlet_example.did") |>
+  iso_read_dual_inlet() |>
+  iso_select_file_info(file_datetime, `Identifier 1`) |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: preparing to read 1 data files (all will be cached)...
 #> Info: reading file 'dual_inlet_example.did' from cache...
-#> Info: finished reading 1 files in 0.59 secs
+#> Info: finished reading 1 files in 0.31 secs
 #> Info: selecting/renaming the following file info across 1 data file(s): 'file_datetime', 'Identifier 1'
 #> Info: aggregating file info from 1 data file(s)

@@ -246,10 +246,10 @@

Messages
 
 # read the same file but make the read process quiet
-iso_get_reader_example("dual_inlet_example.did") %>%
-  iso_read_dual_inlet(quiet = TRUE) %>%
-  iso_select_file_info(file_datetime, `Identifier 1`) %>%
-  iso_get_file_info() %>%
+iso_get_reader_example("dual_inlet_example.did") |>
+  iso_read_dual_inlet(quiet = TRUE) |>
+  iso_select_file_info(file_datetime, `Identifier 1`) |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: selecting/renaming the following file info across 1 data file(s): 'file_datetime', 'Identifier 1'
 #> Info: aggregating file info from 1 data file(s)
@@ -269,10 +269,10 @@

Messages # read the same file but turn all isoreader messages off iso_turn_info_messages_off() -iso_get_reader_example("dual_inlet_example.did") %>% - iso_read_dual_inlet(quiet = TRUE) %>% - iso_select_file_info(file_datetime, `Identifier 1`) %>% - iso_get_file_info() %>% +iso_get_reader_example("dual_inlet_example.did") |> + iso_read_dual_inlet(quiet = TRUE) |> + iso_select_file_info(file_datetime, `Identifier 1`) |> + iso_get_file_info() |> knitr::kable()

@@ -306,29 +306,29 @@

Caching#> Info: removed all (0) cached isoreader files. # read a new file (notice the time elapsed) -cf_file <- iso_get_reader_example("continuous_flow_example.dxf") %>% +cf_file <- iso_get_reader_example("continuous_flow_example.dxf") |> iso_read_continuous_flow() #> Info: preparing to read 1 data files (all will be cached)... #> Info: reading file 'continuous_flow_example.dxf' from cache... -#> Info: finished reading 1 files in 0.28 secs +#> Info: finished reading 1 files in 0.16 secs # re-read the same file much faster (it will be read from cache) -cf_file <- iso_get_reader_example("continuous_flow_example.dxf") %>% +cf_file <- iso_get_reader_example("continuous_flow_example.dxf") |> iso_read_continuous_flow() #> Info: preparing to read 1 data files (all will be cached)... #> Info: reading file 'continuous_flow_example.dxf' from cache... -#> Info: finished reading 1 files in 0.27 secs +#> Info: finished reading 1 files in 0.15 secs # turn reader caching off iso_turn_reader_caching_off() #> Info: caching turned off # re-read the same file (it will NOT be read from cache) -cf_file <- iso_get_reader_example("continuous_flow_example.dxf") %>% +cf_file <- iso_get_reader_example("continuous_flow_example.dxf") |> iso_read_continuous_flow() #> Info: preparing to read 1 data files... #> Info: reading file 'continuous_flow_example.dxf' with '.dxf' reader... -#> Info: finished reading 1 files in 5.00 secs +#> Info: finished reading 1 files in 2.17 secs # turn reader caching back on iso_turn_reader_caching_on() @@ -368,7 +368,7 @@

Parallel processing#> Info (process 1): reading file 'dual_inlet_example.did' from cache... #> Info (process 1): reading file 'dual_inlet_nu_example.txt' from cache... #> Info (process 2): reading file 'dual_inlet_example.caf' from cache... -#> Info: finished reading 3 files in 3.30 secs +#> Info: finished reading 3 files in 2.61 secs

Combining / subsetting isofiles @@ -380,13 +380,11 @@

Combining / subsetting isofilesdi_files #> Data from 3 dual inlet iso files: #> # A tibble: 3 × 6 -#> file_id raw_data file_…¹ metho…² vendo…³ file_…⁴ -#> <chr> <glue> <chr> <chr> <chr> <chr> -#> 1 dual_inlet_example.did 7 cycles, 6 ions (4… 16 ent… standa… 7 rows… dual_i… -#> 2 dual_inlet_example.caf 8 cycles, 6 ions (4… 22 ent… standa… 8 rows… dual_i… -#> 3 dual_inlet_nu_example.txt 82 cycles, 6 ions (… 9 entr… no met… no ven… dual_i… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, -#> # ³​vendor_data_table, ⁴​file_path +#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 dual_inlet_example.did dual_inle… NA 7 cycle… 16 entri… standards,… +#> 2 dual_inlet_example.caf dual_inle… NA 8 cycle… 22 entri… standards,… +#> 3 dual_inlet_nu_example.… dual_inle… NA 82 cycl… 9 entries no method … # only one of the files (by index) di_files[[2]] @@ -400,37 +398,31 @@

Combining / subsetting isofilesdi_files[c(1,3)] #> Data from 2 dual inlet iso files: #> # A tibble: 2 × 6 -#> file_id raw_data file_…¹ metho…² vendo…³ file_…⁴ -#> <chr> <glue> <chr> <chr> <chr> <chr> -#> 1 dual_inlet_example.did 7 cycles, 6 ions (4… 16 ent… standa… 7 rows… dual_i… -#> 2 dual_inlet_nu_example.txt 82 cycles, 6 ions (… 9 entr… no met… no ven… dual_i… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, -#> # ³​vendor_data_table, ⁴​file_path +#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 dual_inlet_example.did dual_inle… NA 7 cycle… 16 entri… standards,… +#> 2 dual_inlet_nu_example.… dual_inle… NA 82 cycl… 9 entries no method … # a subset of the files (by file_id) di_files[c("dual_inlet_example.did", "dual_inlet_example.caf")] #> Data from 2 dual inlet iso files: #> # A tibble: 2 × 6 -#> file_id raw_data file_…¹ metho…² vendo…³ file_…⁴ -#> <chr> <glue> <chr> <chr> <chr> <chr> -#> 1 dual_inlet_example.did 7 cycles, 6 ions (44,4… 16 ent… standa… 7 rows… dual_i… -#> 2 dual_inlet_example.caf 8 cycles, 6 ions (44,4… 22 ent… standa… 8 rows… dual_i… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, -#> # ³​vendor_data_table, ⁴​file_path +#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 dual_inlet_example.did dual_inlet… NA 7 cycle… 16 entri… standards,… +#> 2 dual_inlet_example.caf dual_inlet… NA 8 cycle… 22 entri… standards,… # same result using iso_filter_files (more flexible + verbose output) -di_files %>% iso_filter_files( +di_files |> iso_filter_files( file_id %in% c("dual_inlet_example.did", "dual_inlet_example.caf") ) #> Info: applying file filter, keeping 2 of 3 files #> Data from 2 dual inlet iso files: #> # A tibble: 2 × 6 -#> file_id raw_data file_…¹ metho…² vendo…³ file_…⁴ -#> <chr> <glue> <chr> <chr> <chr> <chr> -#> 1 dual_inlet_example.did 7 cycles, 6 ions (44,4… 16 ent… standa… 7 rows… dual_i… -#> 2 dual_inlet_example.caf 8 cycles, 6 ions (44,4… 22 ent… standa… 8 rows… dual_i… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, -#> # ³​vendor_data_table, ⁴​file_path +#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 dual_inlet_example.did dual_inlet… NA 7 cycle… 16 entri… standards,… +#> 2 dual_inlet_example.caf dual_inlet… NA 8 cycle… 22 entri… standards,… # recombining subset files c( @@ -439,12 +431,10 @@

Combining / subsetting isofiles) #> Data from 2 dual inlet iso files: #> # A tibble: 2 × 6 -#> file_id raw_data file_…¹ metho…² vendo…³ file_…⁴ -#> <chr> <glue> <chr> <chr> <chr> <chr> -#> 1 dual_inlet_nu_example.txt 82 cycles, 6 ions (… 9 entr… no met… no ven… dual_i… -#> 2 dual_inlet_example.did 7 cycles, 6 ions (4… 16 ent… standa… 7 rows… dual_i… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, -#> # ³​vendor_data_table, ⁴​file_path

+#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 dual_inlet_nu_example.… dual_inle… NA 82 cycl… 9 entries no method … +#> 2 dual_inlet_example.did dual_inle… NA 7 cycle… 16 entri… standards,… +iso_files |> iso_get_problems_summary() |> knitr::kable()

@@ -490,13 +480,13 @@

Dealing with file read problems
 
 # retrieve problem details
-iso_files %>% iso_get_problems() %>% knitr::kable()
+iso_files |> iso_get_problems() |> knitr::kable()

file_id
-+--++ @@ -509,13 +499,14 @@

Dealing with file read problemserror

+‘CEvalDataIntTransferPart’ not found after position 1 (nav block#1 +‘CFileHeader’, pos 65327, max 119237)
file_idextract_dxf_raw_voltage_data cannot identify measured masses - block -‘CEvalDataIntTransferPart’ not found after position 1 (pos 65327)
 
 # filter out erroneous files
-iso_files <- iso_files %>% iso_filter_files_with_problems()
+iso_files <- iso_files |> iso_filter_files_with_problems()
 #> Info: removing 1/2 files that have any error (keeping 1)
@@ -536,23 +527,21 @@

Re-reading filesiso_reread_all_files()).

 # re-read the 3 dual inlet files from their original location if any have changed
-di_files %>%
+di_files |>
   iso_reread_changed_files()
 #> Info: found 0 changed data file(s), re-reading 0/3.
 #> Data from 3 dual inlet iso files: 
 #> # A tibble: 3 × 6
-#>   file_id                   raw_data             file_…¹ metho…² vendo…³ file_…⁴
-#>   <chr>                     <glue>               <chr>   <chr>   <chr>   <chr>  
-#> 1 dual_inlet_example.did    7 cycles, 6 ions (4… 16 ent… standa… 7 rows… dual_i…
-#> 2 dual_inlet_example.caf    8 cycles, 6 ions (4… 22 ent… standa… 8 rows… dual_i…
-#> 3 dual_inlet_nu_example.txt 82 cycles, 6 ions (… 9 entr… no met… no ven… dual_i…
-#> # … with abbreviated variable names ¹​file_info, ²​method_info,
-#> #   ³​vendor_data_table, ⁴​file_path
+#>   file_id                 file_path_ file_subpath raw_data file_info method_info
+#>   <chr>                   <chr>      <chr>        <glue>   <chr>     <chr>      
+#> 1 dual_inlet_example.did  dual_inle… NA           7 cycle… 16 entri… standards,…
+#> 2 dual_inlet_example.caf  dual_inle… NA           8 cycle… 22 entri… standards,…
+#> 3 dual_inlet_nu_example.… dual_inle… NA           82 cycl… 9 entries no method …
 
 # update the file_root for the files before re-read (in this case to a location
 # that does not hold these files and hence will lead to a warning)
-di_files %>%
-  iso_set_file_root(root = ".") %>%
+di_files |>
+  iso_set_file_root(root = ".") |>
   iso_reread_all_files()
 #> Info: setting file root for 3 data file(s) to '.'
 #> Warning: 3 file(s) do not exist at their referenced location and can not be re-read. Consider setting a new root directory with iso_set_file_root() first:
@@ -562,13 +551,11 @@ 

Re-reading files#> Info: found 0 data file(s), re-reading 0/3. #> Data from 3 dual inlet iso files: #> # A tibble: 3 × 6 -#> file_id raw_data file_…¹ metho…² vendo…³ file_…⁴ -#> <chr> <glue> <chr> <chr> <chr> <chr> -#> 1 dual_inlet_example.did 7 cycles, 6 ions (4… 16 ent… standa… 7 rows… dual_i… -#> 2 dual_inlet_example.caf 8 cycles, 6 ions (4… 22 ent… standa… 8 rows… dual_i… -#> 3 dual_inlet_nu_example.txt 82 cycles, 6 ions (… 9 entr… no met… no ven… dual_i… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, -#> # ³​vendor_data_table, ⁴​file_path +#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 dual_inlet_example.did dual_inle… NA 7 cycle… 16 entri… standards,… +#> 2 dual_inlet_example.caf dual_inle… NA 8 cycle… 22 entri… standards,… +#> 3 dual_inlet_nu_example.… dual_inle… NA 82 cycl… 9 entries no method … #> #> Problem summary: #> # A tibble: 3 × 3 @@ -588,9 +575,9 @@

Units implicit.

 # strip all units
-cf_file %>%
-  iso_get_vendor_data_table(select = c(`Ampl 28`, `rIntensity 28`, `d 15N/14N`)) %>%
-  iso_strip_units() %>% head(3)
+cf_file |>
+  iso_get_vendor_data_table(select = c(`Ampl 28`, `rIntensity 28`, `d 15N/14N`)) |>
+  iso_strip_units() |> head(3)
 #> Info: aggregating vendor data table from 1 data file(s)
 #> # A tibble: 3 × 4
 #>   file_id                     `Ampl 28` `rIntensity 28` `d 15N/14N`
@@ -600,41 +587,39 @@ 

Units #> 3 continuous_flow_example.dxf 2074. 52732. 1.05 # make units explicit -cf_file %>% - iso_get_vendor_data_table(select = c(`Ampl 28`, `rIntensity 28`, `d 15N/14N`)) %>% - iso_make_units_explicit() %>% head(3) +cf_file |> + iso_get_vendor_data_table(select = c(`Ampl 28`, `rIntensity 28`, `d 15N/14N`)) |> + iso_make_units_explicit() |> head(3) #> Info: aggregating vendor data table from 1 data file(s) #> # A tibble: 3 × 4 -#> file_id `Ampl 28 [mV]` `rIntensity 28 [mVs]` d 15N/14N […¹ -#> <chr> <dbl> <dbl> <dbl> -#> 1 continuous_flow_example.dxf 3024. 57524. 0.0160 -#> 2 continuous_flow_example.dxf 3023. 57383. 0 -#> 3 continuous_flow_example.dxf 2074. 52732. 1.05 -#> # … with abbreviated variable name ¹​`d 15N/14N [permil]` +#> file_id `Ampl 28 [mV]` `rIntensity 28 [mVs]` `d 15N/14N [permil]` +#> <chr> <dbl> <dbl> <dbl> +#> 1 continuous_flow_exa… 3024. 57524. 0.0160 +#> 2 continuous_flow_exa… 3023. 57383. 0 +#> 3 continuous_flow_exa… 2074. 52732. 1.05 # introduce new unit columns e.g. in the file info -cf_file %>% - iso_mutate_file_info(weight = iso_with_units(0.42, "mg")) %>% +cf_file |> + iso_mutate_file_info(weight = iso_with_units(0.42, "mg")) |> iso_get_vendor_data_table(select = c(`Ampl 28`, `rIntensity 28`, `d 15N/14N`), - include_file_info = weight) %>% - iso_make_units_explicit() %>% head(3) + include_file_info = weight) |> + iso_make_units_explicit() |> head(3) #> Info: mutating file info for 1 data file(s) #> Info: aggregating vendor data table from 1 data file(s), including file info 'weight' #> # A tibble: 3 × 5 -#> file_id `weight [mg]` `Ampl 28 [mV]` rIntensity …¹ d 15N…² -#> <chr> <dbl> <dbl> <dbl> <dbl> -#> 1 continuous_flow_example.dxf 0.42 3024. 57524. 0.0160 -#> 2 continuous_flow_example.dxf 0.42 3023. 57383. 0 -#> 3 continuous_flow_example.dxf 0.42 2074. 52732. 1.05 -#> # … with abbreviated variable names ¹​`rIntensity 28 [mVs]`, -#> # ²​`d 15N/14N [permil]` +#> file_id `weight [mg]` `Ampl 28 [mV]` `rIntensity 28 [mVs]` +#> <chr> <dbl> <dbl> <dbl> +#> 1 continuous_flow_example.dxf 0.42 3024. 57524. +#> 2 continuous_flow_example.dxf 0.42 3023. 57383. +#> 3 continuous_flow_example.dxf 0.42 2074. 52732. +#> # ℹ 1 more variable: `d 15N/14N [permil]` <dbl> # or turn a column e.g. with custom format units in the header into implicit units -cf_file %>% - iso_mutate_file_info(weight.mg = 0.42) %>% +cf_file |> + iso_mutate_file_info(weight.mg = 0.42) |> iso_get_vendor_data_table(select = c(`Ampl 28`, `rIntensity 28`, `d 15N/14N`), - include_file_info = weight.mg) %>% - iso_make_units_implicit(prefix = ".", suffix = "") %>% head(3) + include_file_info = weight.mg) |> + iso_make_units_implicit(prefix = ".", suffix = "") |> head(3) #> Info: mutating file info for 1 data file(s) #> Info: aggregating vendor data table from 1 data file(s), including file info 'weight.mg' #> # A tibble: 3 × 5 @@ -665,10 +650,10 @@

Formatting#> [1] "pi: 3.142 | x: 42mg | ID: ABC" # example inside a data frame -cf_file %>% - iso_get_vendor_data_table(select = c(`Nr.`, `Ampl 28`, `d 15N/14N`)) %>% - dplyr::select(-file_id) %>% - head(3) %>% +cf_file |> + iso_get_vendor_data_table(select = c(`Nr.`, `Ampl 28`, `d 15N/14N`)) |> + dplyr::select(-file_id) |> + head(3) |> # introduce new label columns using iso_format dplyr::mutate( # default concatenation of values @@ -689,12 +674,11 @@

Formatting) #> Info: aggregating vendor data table from 1 data file(s) #> # A tibble: 3 × 6 -#> Nr. `Ampl 28` `d 15N/14N` label_default label…¹ label…² -#> <int> <dbl[mV]> <dbl[permil]> <chr> <chr> <chr> -#> 1 1 3024.040 0.01600287 Nr.: 1, Ampl 28: 3020mV, d 15N/… #: 1, … 1, 302… -#> 2 2 3022.789 0.00000000 Nr.: 2, Ampl 28: 3020mV, d 15N/… #: 2, … 2, 302… -#> 3 3 2073.872 1.04910065 Nr.: 3, Ampl 28: 2070mV, d 15N/… #: 3, … 3, 207… -#> # … with abbreviated variable names ¹​label_named, ²​label_value

+#> Nr. `Ampl 28` `d 15N/14N` label_default label_named label_value +#> <int> <dbl[mV]> <dbl[permil]> <chr> <chr> <chr> +#> 1 1 3024.040 0.01600287 Nr.: 1, Ampl 28: 3020mV… #: 1, A: 3… 1, 3024.04… +#> 2 2 3022.789 0.00000000 Nr.: 2, Ampl 28: 3020mV… #: 2, A: 3… 2, 3022.79… +#> 3 3 2073.872 1.04910065 Nr.: 3, Ampl 28: 2070mV… #: 3, A: 2… 3, 2073.87…

diff --git a/articles/quick_start.html b/articles/quick_start.html index f78ce4b..e0e77a1 100644 --- a/articles/quick_start.html +++ b/articles/quick_start.html @@ -107,7 +107,7 @@ +iso_get_reader_examples() |> knitr::kable() @@ -234,7 +234,7 @@

Dual Inlet Files#> Info: reading file 'dual_inlet_example.did' with '.did' reader... #> Info: reading file 'dual_inlet_nu_example.txt' with '.txt' reader... #> Warning: found 6 channels but 0 masses were specified - the raw data will b... -#> Info: finished reading 3 files in 11.57 secs +#> Info: finished reading 3 files in 9.46 secs #> Warning: encountered 1 problem. #> # | FILE | PROBLEM | OCCURRED IN | DETAILS #> 1 | dual_inlet_nu_example.txt | warning | iso_read_nu | found 6 channels but ... @@ -245,7 +245,7 @@

Dual Inlet Files#> Info: exporting data from 3 iso_files into R Data Storage 'di_save.di.rds'
 # export to excel
-iso_export_to_excel(di_files, filepath = "di_export")
+iso_export_files_to_excel(di_files, filepath = "di_export") +#> Info: finished reading 3 files in 6.61 secs
 # save as r data storage (read back in with iso_read_continuous_flow)
 iso_save(cf_files, filepath = "cf_save")
 #> Info: exporting data from 6 iso_files into R Data Storage 'cf_save.cf.rds'
 # export to excel
-iso_export_to_excel(cf_files, filepath = "cf_export")
+iso_export_files_to_excel(cf_files, filepath = "cf_export")
 # export to excel
-iso_export_to_excel(scan_files, filepath = "scan_export")
+iso_export_files_to_excel(scan_files, filepath = "scan_export") diff --git a/articles/scan.html b/articles/scan.html index 54c6e5c..11bbad2 100644 --- a/articles/scan.html +++ b/articles/scan.html @@ -107,7 +107,7 @@

@@ -233,11 +233,11 @@

Reading files#> Info: reading file 'background_scan_example.scn' with '.scn' reader... #> Info: reading file 'full_scan_example.scn' with '.scn' reader... #> Info: reading file 'time_scan_example.scn' with '.scn' reader... -#> Info: finished reading 4 files in 3.02 secs -#> Warning: file creation date could not be accessed for all files because -#> this information is not available on some Linux systems, reporting -#> last modified time for file_datetime instead. To turn these warnings -#> off, call iso_turn_datetime_warnings_off() and reread these files with +#> Info: finished reading 4 files in 1.44 secs +#> Warning: file creation date could not be accessed for all files because this +#> information is not available on some Linux systems, reporting last modified +#> time for file_datetime instead. To turn these warnings off, call +#> iso_turn_datetime_warnings_off() and reread these files with #> iso_reread_all_files(). #> Warning: encountered 4 problems. #> # | FILE | PROBLEM | OCCURRED IN ... @@ -255,51 +255,57 @@

File summaryiso_get_data_summary() function.

-scan_files %>% iso_get_data_summary() %>% knitr::kable()
+scan_files |> iso_get_data_summary() |> knitr::kable()
 #> Info: aggregating data summary from 4 data file(s)

---++-+++ + + - + + - + - + + - + + - + + -
file_idfile_path_file_subpath raw_data file_info method_infofile_path
peak_shape_scan_example.scnpeak_shape_scan_example.scnNA 220 measurements, 3 ions (44,45,46)8 entries7 entries resistorspeak_shape_scan_example.scn
background_scan_example.scnbackground_scan_example.scnNA 525 measurements, 7 ions (44,45,46,47,54,48,49) 8 entries resistorsbackground_scan_example.scn
full_scan_example.scnfull_scan_example.scnNA 799 measurements, 3 channels (2,4,6) 8 entries resistorsfull_scan_example.scn
time_scan_example.scntime_scan_example.scnNA 5532 measurements, 2 ions (38,40) 8 entries resistorstime_scan_example.scn
@@ -313,7 +319,7 @@

Problemsisoreader issue tracker.

-scan_files %>% iso_get_problems_summary() %>% knitr::kable()
+scan_files |> iso_get_problems_summary() |> knitr::kable() @@ -344,7 +350,7 @@

Problems

file_id
+scan_files |> iso_get_problems() |> knitr::kable() @@ -401,17 +407,17 @@

File Information
 # all file information
-scan_files %>% iso_get_file_info(select = c(-file_root)) %>% knitr::kable()
+scan_files |> iso_get_file_info(select = c(-file_root)) |> knitr::kable()
 #> Info: aggregating file info from 4 data file(s), selecting info columns 'c(-file_root)'

-----++-++++ @@ -427,16 +433,16 @@

File Informationpeak_shape_scan_example.scn

- + - + - + @@ -445,7 +451,7 @@

File Informationfull_scan_example.scn

- + @@ -454,7 +460,7 @@

File Informationtime_scan_example.scn

- + @@ -469,24 +475,24 @@

Select/Renameiso_rename_file_info() functions:

 # select + rename specific file info columns
-scan_files2 <- scan_files %>%
-  iso_select_file_info(-file_root) %>%
+scan_files2 <- scan_files |>
+  iso_select_file_info(-file_root) |>
   iso_rename_file_info(`Date & Time` = file_datetime)
 #> Info: selecting/renaming the following file info across 4 data file(s): '-file_root'
 #> Info: renaming the following file info across 4 data file(s): 'file_datetime'->'Date & Time'
 
 # fetch all file info
-scan_files2 %>% iso_get_file_info() %>% knitr::kable()
+scan_files2 |> iso_get_file_info() |> knitr::kable()
 #> Info: aggregating file info from 4 data file(s)

file_idpeak_shape_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 36411 High Voltagetest this comment featureNA
background_scan_example.scn background_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 62303 High Voltage NAfull_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 57551 MagnetCurrent NAtime_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 140550 Clock NA
-----++-++++ @@ -502,16 +508,16 @@

Select/Renamepeak_shape_scan_example.scn

- + - + - + @@ -520,7 +526,7 @@

Select/Renamefull_scan_example.scn

- + @@ -529,7 +535,7 @@

Select/Renametime_scan_example.scn

- + @@ -547,21 +553,21 @@

Filter syntax.

 # find files that have 'CIT' in the new ID field
-scan_files2 %>%
-  iso_filter_files(type == "High Voltage") %>%
-  iso_get_file_info() %>%
+scan_files2 |>
+  iso_filter_files(type == "High Voltage") |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: applying file filter, keeping 2 of 4 files
 #> Info: aggregating file info from 2 data file(s)

file_idpeak_shape_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 36411 High Voltagetest this comment featureNA
background_scan_example.scn background_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 62303 High Voltage NAfull_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 57551 MagnetCurrent NAtime_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 140550 Clock NA
-------+++++++ @@ -577,16 +583,16 @@

Filter

- + - + - + @@ -604,27 +610,27 @@

Mutate files) and supports full dplyr syntax.

-scan_files3 <- scan_files2 %>%
+scan_files3 <- scan_files2 |>
   iso_mutate_file_info(
     # introduce new column
     `Run in 2019?` = `Date & Time` > "2019-01-01" & `Date & Time` < "2020-01-01"
   )
 #> Info: mutating file info for 4 data file(s)
 
-scan_files3 %>%
-  iso_get_file_info() %>%
+scan_files3 |>
+  iso_get_file_info() |>
   knitr::kable()
 #> Info: aggregating file info from 4 data file(s)
-

file_idpeak_shape_scan_example.scn peak_shape_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 36411 High Voltagetest this comment featureNA
background_scan_example.scn background_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 62303 High Voltage NA
+
-----+++++++-- @@ -641,17 +647,17 @@

Mutate

- + - + - + @@ -661,7 +667,7 @@

Mutate

- + @@ -671,7 +677,7 @@

Mutate

- + @@ -688,7 +694,7 @@

Resistors
-scan_files %>% iso_get_resistors() %>% knitr::kable()
+scan_files |> iso_get_resistors() |> knitr::kable()
 #> Info: aggregating resistors info from 4 data file(s)

file_idpeak_shape_scan_example.scn peak_shape_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 36411 High Voltagetest this comment featureNA FALSE
background_scan_example.scn background_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 62303 High Voltage NAfull_scan_example.scn full_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 57551 MagnetCurrent NAtime_scan_example.scn time_scan_example.scn NA2023-01-07 08:46:372023-07-28 01:18:12 140550 Clock NA
@@ -802,7 +808,7 @@

Raw Dataiso_get_file_info function discussed earlier.

 # get raw data with default selections (all raw data, no additional file info)
-scan_files %>% iso_get_raw_data() %>% head(n=10) %>% knitr::kable()
+scan_files |> iso_get_raw_data() |> head(n=10) |> knitr::kable()
 #> Info: aggregating raw data from 4 data file(s)

@@ -1026,15 +1032,15 @@

Raw Data
 # get specific raw data and add some file information
-scan_files %>%
+scan_files |>
   iso_get_raw_data(
     # select just time and the two ions
     select = c(x, x_units, v44.mV, v45.mV),
     # include the scan type and rename the column
     include_file_info = c(`Scan Type` = type)
-  ) %>%
+  ) |>
   # look at first few records only
-  head(n=10) %>% knitr::kable()
+  head(n=10) |> knitr::kable()
 #> Info: aggregating raw data from 4 data file(s), selecting data columns 'c(x, x_units, v44.mV, v45.mV)', including file info 'c(`Scan Type` = type)'

@@ -1144,7 +1150,7 @@

For expert users: retrieving all d unnest), there is an easy way to retrieve all data from the iso file objects in a single nested data frame:

-all_data <- scan_files %>% iso_get_all_data()
+all_data <- scan_files |> iso_get_all_data()
 #> Info: aggregating all data from 4 data file(s)
 # not printed out because this data frame is very big
@@ -1160,7 +1166,7 @@

Saving collections
 # export to R data archive
-scan_files %>% iso_save("scan_files_export.scan.rds")
+scan_files |> iso_save("scan_files_export.scan.rds")
 #> Info: exporting data from 4 iso_files into R Data Storage 'scan_files_export.scan.rds'
 
 # read back the exported R data storage
@@ -1168,11 +1174,11 @@ 

Saving collections#> Info: preparing to read 1 data files (all will be cached)... #> Info: reading file 'scan_files_export.scan.rds' with '.scan.rds' reader... #> Info: loaded 4 data files from R Data Storage -#> Info: finished reading 1 files in 0.17 secs -#> Warning: file creation date could not be accessed for all files because -#> this information is not available on some Linux systems, reporting -#> last modified time for file_datetime instead. To turn these warnings -#> off, call iso_turn_datetime_warnings_off() and reread these files with +#> Info: finished reading 1 files in 0.09 secs +#> Warning: file creation date could not be accessed for all files because this +#> information is not available on some Linux systems, reporting last modified +#> time for file_datetime instead. To turn these warnings off, call +#> iso_turn_datetime_warnings_off() and reread these files with #> iso_reread_all_files(). #> Warning: encountered 4 problems. #> # | FILE | PROBLEM | OCCURRED IN ... @@ -1182,14 +1188,13 @@

Saving collections#> 4 | time_scan_example.scn | warning | extract_os_file_creation_datetime... #> Use iso_get_problems(...) for more details. #> Data from 4 scan iso files: -#> # A tibble: 4 × 5 -#> file_id raw_data file_…¹ metho…² file_…³ -#> <chr> <glue> <chr> <chr> <chr> -#> 1 peak_shape_scan_example.scn 220 measurements, 3 ions … 8 entr… resist… peak_s… -#> 2 background_scan_example.scn 525 measurements, 7 ions … 8 entr… resist… backgr… -#> 3 full_scan_example.scn 799 measurements, 3 chann… 8 entr… resist… full_s… -#> 4 time_scan_example.scn 5532 measurements, 2 ions… 8 entr… resist… time_s… -#> # … with abbreviated variable names ¹​file_info, ²​method_info, ³​file_path +#> # A tibble: 4 × 6 +#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 peak_shape_scan_exampl… peak_shap… NA 220 mea… 7 entries resistors +#> 2 background_scan_exampl… backgroun… NA 525 mea… 8 entries resistors +#> 3 full_scan_example.scn full_scan… NA 799 mea… 8 entries resistors +#> 4 time_scan_example.scn time_scan… NA 5532 me… 8 entries resistors #> #> Problem summary: #> # A tibble: 4 × 3 @@ -1211,13 +1216,13 @@

Data Export
 # export to excel
-scan_files %>% iso_export_to_excel("scan_files_export")
+scan_files |> iso_export_files_to_excel("scan_files_export")
 
 # data sheets available in the exported data file:
 readxl::excel_sheets("scan_files_export.scan.xlsx")
 # export to feather
-scan_files %>% iso_export_to_feather("scan_files_export")
+scan_files |> iso_export_files_to_feather("scan_files_export")
 
 # exported feather files
 list.files(pattern = ".scan.feather")
diff --git a/index.html b/index.html index 48c9f10..012f29b 100644 --- a/index.html +++ b/index.html @@ -106,7 +106,7 @@
-

CRAN_Status_Badge Documentation R build status Binder Binder

+

R build status Documentation DOI

About

@@ -116,7 +116,6 @@

About

Installation

-

You can install the latest release of isoreader from CRAN:

+#> # A tibble: 4 × 6 +#> file_id file_path_ file_subpath raw_data file_info method_info +#> <chr> <chr> <chr> <glue> <chr> <chr> +#> 1 background_scan_exampl… backgroun… <NA> 525 mea… 8 entries resistors +#> 2 full_scan_example.scn full_scan… <NA> 799 mea… 8 entries resistors +#> 3 peak_shape_scan_exampl… peak_shap… <NA> 220 mea… 7 entries resistors +#> 4 time_scan_example.scn time_scan… <NA> 5532 me… 8 entries resistors

Supported File Types diff --git a/news/index.html b/news/index.html index a9375b5..934a4c0 100644 --- a/news/index.html +++ b/news/index.html @@ -82,6 +82,28 @@

Changelog

Source: NEWS.md
+
+ +
+

Breaking changes

+

Several previously deprecated functions have been removed: iso_calculate_ratios(), iso_convert_signals(), iso_convert_time(), iso_plot_continuous_flow_data(), iso_plot_dual_inlet_data(), iso_plot_raw_data(), isoread(). Older code that still uses these functions instead of their replacements will no longer work.

+
+
+

New features

+
  • simpler cache file names that also removed dependency on the UNF package
  • +
  • faster implementation of binary file structure analysis for isodat files, accessible via the new iso_get_source_file_structure() function
  • +
+
+

Enhancements

+
+
+

Bug fixes

+
  • fixes to be compatible with latest tidyselect and dplyr updates
  • +
+
@@ -121,9 +143,9 @@
Aggregating data from files
Exporting information

This package provides the following data export functionality for all supported data files:

-
diff --git a/pkgdown.yml b/pkgdown.yml index d71bc0f..b5a6739 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -8,7 +8,7 @@ articles: operations: operations.html quick_start: quick_start.html scan: scan.html -last_built: 2023-01-07T08:51Z +last_built: 2023-07-28T01:19Z urls: reference: http://isoreader.isoverse.org/reference article: http://isoreader.isoverse.org/articles diff --git a/reference/deprecated.html b/reference/deprecated.html new file mode 100644 index 0000000..b270291 --- /dev/null +++ b/reference/deprecated.html @@ -0,0 +1,143 @@ + +These functions have been deprecated and will be removed in future versions of isoreader. — iso_get_data • Isoreader + + +
+
+ + + +
+
+ + +
+

These functions have been deprecated and will be removed in future versions of isoreader.

+
+ +
+
iso_get_data(...)
+
+iso_get_standards_info(...)
+
+iso_get_resistors_info(...)
+
+iso_export_to_excel(...)
+
+iso_export_to_feather(...)
+
+iso_omit_files_with_problems(...)
+
+ +
+

Arguments

+
...
+

deprecated (passed on to new function if superseded)

+ +
+
+

Details

+

iso_get_data: use iso_get_all_data instead

+

iso_get_standards_info: use iso_get_standards instead

+

iso_get_resistors_info: use iso_get_resistors instead

+

iso_export_to_excel: use iso_export_files_to_excel instead

+

iso_export_to_feather: use iso_export_files_to_feather instead

+

iso_omit_files_with_problems: use iso_filter_files_with_problems instead

+
+ +
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/reference/index.html b/reference/index.html index f5360a1..ba9ede2 100644 --- a/reference/index.html +++ b/reference/index.html @@ -222,11 +222,11 @@

Exporting/saving

+ + + + @@ -337,14 +345,6 @@

Low-level IO, debugging, a

set_temp()

- - - - @@ -362,53 +362,13 @@

Low-level IO, debugging, a

- - - - - - - - - - - - - - - - - - - - - +

Save data to R Data Storage (.rds)

-

iso_export_to_excel()

+

iso_export_files_to_excel()

Export data to Excel

-

iso_export_to_feather()

+

iso_export_files_to_feather()

Export to feather

@@ -325,6 +325,14 @@

Low-level IO, debugging, a

iso_turn_debug_on() iso_turn_debug_off() set_read_file_event_expr() set_finish_file_event_expr()

Debugging functions

+

iso_source_file_op_error()

+

Throw source file operation error with useful debugging information for the file type.

+

iso_get_source_file_structure() iso_print_source_file_structure() print(<binary_isodat_file>)

+

Get source file and structure

read_iso_file()

Set temporary option

-

map_binary_structure()

-

Map isodat file binary structure.

-

print(<binary_structure_map>)

-

Print binary structure map

print(<iso_file_list>) print(<iso_file>) print(<dual_inlet>) print(<continuous_flow>) print(<scan>)

vec_ptype2 for iso_double_with_units

-

Moved to isoprocessor or deprecated

+

Deprecated

-

iso_get_data()

-

DEPRECATED

-

iso_get_resistors_info()

-

DEPRECATED

-

iso_get_standards_info()

-

DEPRECATED

-

iso_omit_files_with_problems()

-

Renamed to iso_filter_files_with_problems

-

iso_calculate_ratios()

-

moved to isoprocessor

-

iso_convert_signals()

-

moved to isoprocessor

-

iso_convert_time()

-

moved to isoprocessor

-

iso_plot_continuous_flow_data()

-

moved to isoprocessor

-

iso_plot_dual_inlet_data()

-

moved to isoprocessor

-

iso_plot_raw_data()

-

moved to isoprocessor

-

isoread()

+

iso_get_data() iso_get_standards_info() iso_get_resistors_info() iso_export_to_excel() iso_export_to_feather() iso_omit_files_with_problems()

Read isotope data file

These functions have been deprecated and will be removed in future versions of isoreader.

diff --git a/reference/iso_source_file_op_error.html b/reference/iso_source_file_op_error.html new file mode 100644 index 0000000..fc8e7c4 --- /dev/null +++ b/reference/iso_source_file_op_error.html @@ -0,0 +1,132 @@ + +Throw source file operation error with useful debugging information for the file type. — iso_source_file_op_error • Isoreader + + +
+
+ + + +
+
+ + +
+

Throw source file operation error with useful debugging information for the file type.

+
+ +
+
iso_source_file_op_error(source_file_obj, msg, ...)
+
+ +
+

Arguments

+
source_file_obj
+

the source file object for which to print the operation error

+ + +
msg
+

the message to print

+ + +
...
+

additional parameters depending on source file type

+ +
+ +
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/reference/iso_with_units.html b/reference/iso_with_units.html index e2aa781..c619d42 100644 --- a/reference/iso_with_units.html +++ b/reference/iso_with_units.html @@ -84,7 +84,7 @@

Generate values with units

-

These functions generate values with units that work well within data frames and tibbles and implement safety checks on operations that combine values with different units. To retrieve the value without units, use iso_strip_units (works for single variables and data frames/tibbles). To retrieve the unit use iso_get_units. Note that to correctly combine data frames / tibbles that have values with units in them, use vec_rbind instead of rbind or bind_rows. vec_rbind will combine columns that have values with units if they have the same unit and otherwise convert back to plain values without units with a warning. The other functions will either fail or reduce the unit values to plain values with a cryptic warning message about not preserving attributes.

+

These functions generate values with units that work well within data frames and tibbles and implement safety checks on operations that combine values with different units. To retrieve the value without units, use iso_strip_units (works for single variables and data frames/tibbles). To retrieve the unit use iso_get_units. Note that to correctly combine data frames / tibbles that have values with units in them, use vec_rbind instead of rbind or bind_rows. vec_rbind will combine columns that have values with units if they have the same unit and otherwise convert back to plain values without units with a warning. The other functions will either fail or reduce the unit values to plain values with a cryptic warning message about not preserving attributes.

diff --git a/reference/reexports.html b/reference/reexports.html index 9de82f2..d5ac616 100644 --- a/reference/reexports.html +++ b/reference/reexports.html @@ -6,10 +6,6 @@ filter - magrittr -%&gt;% - - readr parse_datetime, parse_double, parse_integer, parse_logical, parse_number, problems, stop_for_problems @@ -117,10 +113,6 @@

Objects exported from other packages

filter

-
magrittr
-

%>%

- -
readr

parse_datetime, parse_double, parse_integer, parse_logical, parse_number, problems, stop_for_problems

diff --git a/sitemap.xml b/sitemap.xml index 49cdab0..8498f3a 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -39,6 +39,9 @@ http://isoreader.isoverse.org/paper.html + + http://isoreader.isoverse.org/reference/deprecated.html + http://isoreader.isoverse.org/reference/extract_data.html @@ -60,18 +63,9 @@ http://isoreader.isoverse.org/reference/iso_caching.html - - http://isoreader.isoverse.org/reference/iso_calculate_ratios.html - http://isoreader.isoverse.org/reference/iso_cleanup_reader_cache.html - - http://isoreader.isoverse.org/reference/iso_convert_signals.html - - - http://isoreader.isoverse.org/reference/iso_convert_time.html - http://isoreader.isoverse.org/reference/iso_data_structure.html @@ -82,10 +76,10 @@ http://isoreader.isoverse.org/reference/iso_expand_paths.html - http://isoreader.isoverse.org/reference/iso_export_to_excel.html + http://isoreader.isoverse.org/reference/iso_export_files_to_excel.html - http://isoreader.isoverse.org/reference/iso_export_to_feather.html + http://isoreader.isoverse.org/reference/iso_export_files_to_feather.html http://isoreader.isoverse.org/reference/iso_filter_files.html @@ -105,9 +99,6 @@ http://isoreader.isoverse.org/reference/iso_get_bgrd_data.html - - http://isoreader.isoverse.org/reference/iso_get_data.html - http://isoreader.isoverse.org/reference/iso_get_data_summary.html @@ -133,14 +124,11 @@ http://isoreader.isoverse.org/reference/iso_get_resistors.html - http://isoreader.isoverse.org/reference/iso_get_resistors_info.html + http://isoreader.isoverse.org/reference/iso_get_source_file_structure.html http://isoreader.isoverse.org/reference/iso_get_standards.html - - http://isoreader.isoverse.org/reference/iso_get_standards_info.html - http://isoreader.isoverse.org/reference/iso_get_supported_file_types.html @@ -168,21 +156,9 @@ http://isoreader.isoverse.org/reference/iso_mutate_file_info.html - - http://isoreader.isoverse.org/reference/iso_omit_files_with_problems.html - http://isoreader.isoverse.org/reference/iso_parse_file_info.html - - http://isoreader.isoverse.org/reference/iso_plot_continuous_flow_data.html - - - http://isoreader.isoverse.org/reference/iso_plot_dual_inlet_data.html - - - http://isoreader.isoverse.org/reference/iso_plot_raw_data.html - http://isoreader.isoverse.org/reference/iso_printing.html @@ -226,23 +202,17 @@ http://isoreader.isoverse.org/reference/iso_shorten_relative_paths.html - http://isoreader.isoverse.org/reference/iso_strip_units.html + http://isoreader.isoverse.org/reference/iso_source_file_op_error.html - http://isoreader.isoverse.org/reference/iso_with_units.html + http://isoreader.isoverse.org/reference/iso_strip_units.html - http://isoreader.isoverse.org/reference/isoread.html + http://isoreader.isoverse.org/reference/iso_with_units.html http://isoreader.isoverse.org/reference/isoreader-package.html - - http://isoreader.isoverse.org/reference/map_binary_structure.html - - - http://isoreader.isoverse.org/reference/print.binary_structure_map.html - http://isoreader.isoverse.org/reference/read_iso_file.html