ImportSamples: Sample definitions

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function imports a sample list that will be processed from a tab delimited file.

Usage

1
2
3
4
ImportSamples(sampfile, CDFpath=".", RIpath=".", ftype=c("binary", "text"), ...)

ImportSamplesFromDir(CDFpath=".", RIfiles=FALSE, ignore.case=TRUE,
	ftype=c("binary", "text"))

Arguments

sampfile

A character string naming a sample file. See details.

CDFpath

A character string naming a directory where the CDF files are located.

RIpath

A character string naming a directory where the RI corrected text files are/will be located.

RIfiles

Logical. If TRUE, the function will look for for RI files (RI_*) instead of CDF files (the default).

ftype

A character string giving the file type for RI files. Options are "binary" and "text".

ignore.case

Logical. Should pattern-matching be case-insensitive?

...

Other options passed to read.delim function.

Details

The sample file is a tab-delimited text file with at least two columns:

The column names must be exactly as those indicated, but the column order doesn't matter. Other columns could be included in that file. They won't be used by the script, but will be included in the "sample" R object.

The ftype parameter sets the file format of the RI files, which are created by the function RIcorrect. "text" is the classic text format and "binary" is a binary version, designed for speed, of the text format (TargetSearch >= 1.12.0). The file format can be identified by the file extension (".txt" for text, ".dat" for binary), but this is just an indicator: the file format is detected dinamically during file reading. Use the method fileFormat to set or get this parameter.

Value

A tsSample object.

Author(s)

Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig

See Also

ImportLibrary, tsSample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# get the sample definition definition file
cdfpath <- file.path(find.package("TargetSearchData"), "gc-ms-data")
sample.file  <- file.path(cdfpath, "samples.txt")

# set a path where the RI files will be created
RIpath <- "."

# import samples
sampleDescription <- ImportSamples(sample.file, CDFpath = cdfpath, RIpath = RIpath)

# change the sample names
sampleNames(sampleDescription) <- paste("Sample", 1:length(sampleDescription), sep = "_")

# change the file paths (relative to the working path)
CDFpath(sampleDescription) <- "my_cdfs/"
RIpath(sampleDescription)  <- "my_RIs/"

TargetSearch documentation built on May 31, 2017, 2:45 p.m.