sync_sampledescription: Synchronize a meta data table (sampledescription) with FCS...

View source: R/sync_sampledescription.R

sync_sampledescriptionR Documentation

Synchronize a meta data table (sampledescription) with FCS files

Description

When running this function the rows in the 'file.name' (e.g. 'sampledescription.xlsx') and FCS files in the FCS.files.folder are synchronized. When new FCS files are added the sampledescription is appended. When entries in the FileName column of sampledescription are changed, FCS files are renamed accordingly. Always, sampledescription is written to the parent folder of FCS.file.folder. See Details below of the cases that can be handled.

Usage

sync_sampledescription(
  FCS.file.folder,
  file.name = "sampledescription.xlsx",
  exclude.folders = c("compensation", "other_fcs_files", "experiment.file",
    "deleted_fcs_files", "8_peak_bead", "rainbow_bead", "8_peak_beads", "rainbow_beads"),
  init.columns = c("AbCalcFile", "AbCalcSheet", "ExpProtocolFile", "ExpPart"),
  write.log = T
)

Arguments

FCS.file.folder

path to the folder which contains FCS files

file.name

name of the sampledescription file, one of the following file types: .xlsx, .ods, .txt, .tsv, .csv

exclude.folders

character vector of folders to exclude when checking for FCS files

init.columns

additional columns to add to the initial file

write.log

write a hidden (not hidden on windows) log file every time changes take place

Details

Five cases can be handled: (i) if no 'file.name'-file exists, one will be initiated based on FCS files in 'FCS.file.folder'. (ii) When new FCS files are added to 'FCS.file.folder' these are added in order of acquisition to the 'file.name'-file. (iii) When file names in the FileName column of the 'file.name'-file are altered, FCS files in FCS.file.folder are renamed accordingly. (iv) If FCS files are to be excluded or removed, the entry in the FileName column has to be left blank and the function has to be called. (v) When the order of rows in the xlsx-file is changed prefixes will be re-numbered.

Preferentially, do not have the file.name'-file open in another program when calling the the function. Never edit the 'identity' column in the 'file.name'-file manually. Never mix up rows of FileName and identity. The identity column contains a concatenated string of the $FIL keyword from FCS files, the number of events ($TOT) and the acquisition date time of the FCS file.

Value

No return value. Instead sampledescription table and FCS files are synchronized.

Examples

## Not run: 
sync_sampledescription(FCS.file.folder = file.path(wd, 'FCS_files'))

## End(Not run)

Close-your-eyes/fcexpr documentation built on Sept. 29, 2023, 12:27 a.m.