ReadFids: Read FIDs in Bruker format from a directory

Description Usage Arguments Details Value Author(s) Examples

View source: R/ReadFids.R

Description

Finds all directories of path which contain a valid FID (i.e. contain the files fid, acqu and acqus) and loads them in a matrix.

Usage

1
ReadFids(path, l = 1, subdirs = FALSE, dirs.names = FALSE, verbose = FALSE)

Arguments

path

A character string specifying the directory where the FIDs are searched.

l

A positive number indicating which line of the title file to use as spectra names.

subdirs

If TRUE, will search inside subdirectories for FIDs and will merge them to have unique FID and info matrices.

dirs.names

If TRUE, the FID names are recovered from the (sub)directories names, provided one subdirectory corresponds to one FID.

verbose

If "TRUE", will print processing information.

Details

The row names are the first line of the file "pdata/1/title" in the directory or the directory name(and subdirectory if subdirs == TRUE) if the title file doesn't exists or the line l is blank. The column names are the time coordinates of the FID. All the FIDs therefore need to have the same length and time interval between points.

Case 1: subdirs = FALSE

DIR1 => 1, 2, 3, ...

Case 2a: subdirs = TRUE

DIR1 => 1 ; DIR2 => 1 ; DIR3 => 1 ; ...

Case 2b: subdirs = TRUE

DIR1 => 1, 2, ... ; DIR2 => 1, 2, ... ; ...

Value

Returns a list with the FIDs and their related information.

Fid_data

The matrix containing the FIDs.

Fid_info

A matrix containing the information about the FIDs. The naming of the row is the same than for Fid_data.

The columns are:

TD

Time domain size

BYTORDA

Determine the endiness of stored data. If 0 -> Little Endian; if 1 -> Big Endian

DIGMOD

Digitization mode

DECIM

Decimation rate of digital filter

DSPFVS

DSP firmware version

SW_h

Sweep width in Hz

SW

Sweep width in ppm

O1

Spectrometer frequency offset

GPRDLY

Group Delay

DT

Dwell time in microseconds

Author(s)

BenoƮt Legat & Manon Martin

Examples

1
2
3
4
5
6
path <-  system.file("extdata", package = "PepsNMRData")
dir(path)

fidList_HS <- ReadFids(file.path(path, "HumanSerum"))
FidData_HS_0 <- fidList_HS[["Fid_data"]]
FidInfo_HS <- fidList_HS[["Fid_info"]]

ManonMartin/PepsNMR documentation built on Nov. 28, 2021, 6:22 p.m.