Code
# Option 1: scp from local machine to RStudio Server
scp icpoes_metals_2026-05-21_batch01.csv \
username@rstudio.pomona.edu:~/project/data/raw/
# Option 2: Use the RStudio Files pane
# Click Upload > Browse > select file > OKMarc Los Huertos
EA Program, Pomona College
2026-06-26
This SOP standardizes the procedures for exporting raw data from laboratory instruments, transferring files to the data management system, and organizing instrument outputs for downstream analysis. It ensures that raw instrument data are preserved without modification, properly documented, and accessible for reproducible analysis (Gandrud, 2015).
| Role | Responsibility |
|---|---|
| Lab PI | Approve file management protocols; ensure backup compliance |
| Lab Manager | Maintain instrument computers; manage shared storage; train users on export procedures |
| Analyst / Student | Export data following this SOP; verify file integrity; commit to version control |
| Data Reviewer | Confirm that raw files match lab notebook entries and are properly archived |
YYYY-MM-DD_InstrumentID_ProjectCode_UserInitials_raw.csv); required for all EA Program instrument export files.Data export is a computational activity with no physical hazards. When interacting with instruments (connecting USB drives, accessing instrument PCs), follow the safety protocols in the relevant instrument SOP.
| Instrument | Native Format | Preferred Export | Notes |
|---|---|---|---|
| Shimadzu UV-Vis (UV-1900i) | .spc / .csv |
CSV | Export from UVProbe software |
| Thermo iCAP ICP-OES | .rst / .csv |
CSV | Export from Qtegra software |
| Shimadzu TOC-L | .toa / .csv |
CSV | Export from TOC-Control |
| Dionex ICS Ion Chromatograph | .cdf / .csv |
CSV | Export from Chromeleon |
| Mettler Toledo balance | Direct serial output | CSV via terminal log | Use logging script |
| YSI ProDSS multiparameter | .csv / .dat |
CSV | Download via KorDSS software |
| Hach DR3900 spectrophotometer | Internal memory | CSV via USB | Export from instrument menu |
| Bio-Rad QX200 ddPCR | .qlp / .csv |
CSV | Export from QuantaSoft |
| PANalytical XRF | .csv / .xls |
CSV | Export from SuperQ |
| Item | Purpose | Notes |
|---|---|---|
| USB flash drive (lab) | Sneakernet transfer | Dedicated drive; virus-scanned |
| Network shared folder | Direct instrument PC transfer | If instrument PC has network access |
| RStudio Server upload | Upload to analysis environment | Via Files pane or scp |
The same sequence applies to all instruments:
[instrument]_[method]_[YYYY-MM-DD]_[batch].[ext] (e.g., icpoes_metals_2026-05-21_batch01.csv)data/raw/ directory using USB or network transferNever modify raw instrument files after export. If corrections are needed, create a new file in data/processed/ and document the changes in your processing script. The raw file is your permanent record.
.spc)uvvis_[method]_[YYYY-MM-DD].csvicpoes_[method]_[YYYY-MM-DD]_[batch].csvtoc_[method]_[YYYY-MM-DD].csvysi_[project]_[YYYY-MM-DD].csvddpcr_[target]_[YYYY-MM-DD].csvAfter exporting to USB or local machine:
Create a standardized import script for each instrument type. This ensures consistent parsing across analysts and batches:
#' Import ICP-OES data from Qtegra CSV export
#'
#' @param file_path Path to the exported CSV file
#' @return A tibble with standardized column names
import_icpoes <- function(file_path) {
raw <- read_csv(file_path, skip = 2) # Skip Qtegra header rows
raw %>%
rename_with(tolower) %>%
rename_with(~ gsub(" ", "_", .)) %>%
mutate(
date_analyzed = as.Date(date_analyzed, format = "%m/%d/%Y"),
across(where(is.character) & !c(sample_id, sample_type),
as.numeric)
) %>%
# Flag values below detection
mutate(across(
where(is.numeric),
~ if_else(. < 0, NA_real_, .)
))
}
# Usage
icp_data <- import_icpoes("data/raw/icpoes_metals_2026-05-21_batch01.csv")
glimpse(icp_data)#' Import TOC data from TOC-Control CSV export
#'
#' @param file_path Path to the exported CSV file
#' @return A tibble with standardized column names
import_toc <- function(file_path) {
raw <- read_csv(file_path)
raw %>%
rename_with(tolower) %>%
rename_with(~ gsub("[^a-z0-9]", "_", .)) %>%
select(sample_name, injection, area, concentration_mg_l = conc,
cv_percent = cv) %>%
filter(!is.na(sample_name))
}After importing, run basic integrity checks:
# --- Row count matches instrument ---
cat(sprintf("Rows in file: %d\n", nrow(icp_data)))
# Compare with number of samples in lab notebook
# --- No fully blank rows ---
stopifnot(!any(rowSums(is.na(icp_data)) == ncol(icp_data)))
# --- Sample IDs match the run sequence ---
expected_ids <- c("Blank", "Std1", "Std2", "Std3",
paste0("S", sprintf("%03d", 1:20)),
"CRM", "Dup")
setdiff(expected_ids, icp_data$sample_id)
# Should be empty if all expected samples are present
# --- Calibration standards in expected range ---
icp_data %>%
filter(grepl("^Std", sample_id)) %>%
select(sample_id, starts_with("fe_")) %>%
print()All raw instrument files must be archived in three locations:
| Location | When | Responsible |
|---|---|---|
GitHub repository (data/raw/) |
Immediately after export | Analyst |
| Lab instrument PC | Retained on instrument | Lab Manager |
| External backup drive | End of each semester | Lab Manager |
Large binary files (e.g., raw .spc or .qlp files that exceed GitHub’s file size recommendations) should be stored on the external backup drive and the network share, not in Git. Only the exported CSV goes into the repository.
Every data export event must be recorded in the instrument log (see SOP-L007). The log entry should include:
md5sum filename.csv)Not applicable (computational procedure).
Training is documented in the EA Program training log. Before exporting instrument data independently, personnel must:
To confirm that a file has not been modified after export, compute and record an MD5 hash:
| Instrument | Header Rows to Skip | Delimiter | Encoding | Date Format |
|---|---|---|---|---|
| Shimadzu UV-Vis | 1 | Comma | UTF-8 | MM/DD/YYYY |
| Thermo iCAP | 2 | Comma | UTF-8 | MM/DD/YYYY HH:MM |
| Shimadzu TOC-L | 0 | Comma | Shift-JIS (convert to UTF-8) | YYYY/MM/DD |
| Dionex ICS | 3 | Comma | UTF-8 | MM/DD/YYYY HH:MM |
| YSI ProDSS | 0 | Comma | UTF-8 | MM/DD/YYYY HH:MM |
| Bio-Rad QX200 | 0 | Comma | UTF-8 | YYYY-MM-DD |
| PANalytical XRF | Variable | Tab or comma | UTF-8 | DD/MM/YYYY |