Skip to contents

Convert .raw file header information from either grover::sampleInfo(), grover::runInfo() or rawrrr::readFileHeader() into a sample information format compatible with binneR or profilePro.

Usage

convertSampleInfo(
  sample_info,
  gzip_ext = TRUE,
  user_text = c("batch", "block", "class", "rawFileOrder", "sampleOrder")
)

Arguments

sample_info

a tibble containing sample information as returned from from either grover::sampleInfo(), grover::runInfo() or rawrrr::readFileHeader()

gzip_ext

add a .gz extension to the returned mzML file names

user_text

the column names for the five User text columns

Value

A tibble containing converted sample information.

Examples

## Read the file header information from an example .raw file in the 
## grover package available from <https://jasenfinch.github.io/grover/>
sample_information <- system.file(
    'repository/Thermo-Exactive/Experiment_1/QC01.raw',
    package = 'grover') %>% 
    rawrr::readFileHeader() %>% 
    tibble::as_tibble()

## Convert the header information
converted_sample_info <- convertSampleInfo(
    sample_information,
    user_text = c('batch','block','name','class','rawFileOrder'))

converted_sample_info
#> # A tibble: 2 × 8
#>   fileOrder injOrder fileName     name  batch block class rawFileOrder
#>       <int>    <int> <chr>        <chr> <chr> <chr> <chr> <chr>       
#> 1         1        1 QC01.mzML.gz QC01  1     0     QC    6           
#> 2         2        2 QC01.mzML.gz QC01  1     0     QC    6