writing: Exporting a SummarizedExperiment (or MultiAssayExperiment)...

writingR Documentation

Exporting a SummarizedExperiment (or MultiAssayExperiment) instance into (subfolders with) the 3 tabulated files 'dataMatrix.tsv', sampleMetadata.tsv', 'variableMetadata.tsv'

Description

Note that the dataMatrix is transposed before export (e.g., the samples are written column wise in the 'dataMatrix.tsv' exported file).

Usage

writing(
  x,
  dir.c,
  prefix.c = "",
  files.ls = NULL,
  overwrite.l = FALSE,
  report.c = c("none", "interactive", "myfile.txt")[2]
)

## S4 method for signature 'MultiAssayExperiment'
writing(
  x,
  dir.c,
  prefix.c = "",
  files.ls = NULL,
  overwrite.l = FALSE,
  report.c = c("none", "interactive", "myfile.txt")[2]
)

## S4 method for signature 'SummarizedExperiment'
writing(
  x,
  dir.c,
  prefix.c = "",
  files.ls = NULL,
  overwrite.l = FALSE,
  report.c = c("none", "interactive", "myfile.txt")[2]
)

## S4 method for signature 'MultiDataSet'
writing(
  x,
  dir.c,
  prefix.c = "",
  files.ls = NULL,
  overwrite.l = FALSE,
  report.c = c("none", "interactive", "myfile.txt")[2]
)

## S4 method for signature 'ExpressionSet'
writing(
  x,
  dir.c,
  prefix.c = "",
  files.ls = NULL,
  overwrite.l = FALSE,
  report.c = c("none", "interactive", "myfile.txt")[2]
)

Arguments

x

An S4 object of class SummarizedExperiment or MultiAssayExperiment

dir.c

character(1): directory where each dataset should be written

prefix.c

character(1): prefix to be used (followed by '_') in the 'dataMatrix.tsv', 'sampleMetadata.tsv', and 'variableMetadata.tsv' file names

files.ls

list: alternatively to the dir.c argument, the full names of the files can be provided as a list

overwrite.l

logical(1): should existing files be overwritten?

report.c

character(1): File name with '.txt' extension for the printed results (call to sink()'); if 'interactive' (default), messages will be printed on the screen; if 'none', no verbose will be generated

Value

No object returned.

Examples

metabo.se <- reading(system.file("extdata/prometis/metabolomics", package="phenomis"))
## Not run: 
writing(metabo.se, dir.c = file.path(getwd(), "metabolomics"))

## End(Not run)
# MultiAssayExperiment
prometis.mae <- reading(system.file("extdata/prometis",package="phenomis"))
## Not run: 
writing(prometis.mae, dir.c = file.path(getwd(), "prometis"))
# alternatively
writing(prometis.mae,
         dir.c = NA,
         files.ls = list(metabolomics = list(dataMatrix.tsvC = file.path(getwd(), "met_dataMatrix.tsv"),
                                      sampleMetadata.tsvC = file.path(getwd(), "met_sampleMetadata.tsv"),
                                      variableMetadata.tsvC = file.path(getwd(), "met_variableMetadata.tsv")),
                        proteomics = list(dataMatrix.tsvC = file.path(getwd(), "pro_dataMatrix.tsv"),
                                      sampleMetadata.tsvC = file.path(getwd(), "pro_sampleMetadata.tsv"),
                                      variableMetadata.tsvC = file.path(getwd(), "pro_variableMetadata.tsv"))))

## End(Not run)

SciDoPhenIA/phenomis documentation built on June 9, 2022, 11:54 p.m.