View source: R/import-functions.R
import_single_Vispa2Matrix | R Documentation |
This function allows to read and import an integration matrix (ideally produced by VISPA2) and converts it to a tidy format.
import_single_Vispa2Matrix(
path,
separator = "\t",
additional_cols = NULL,
transformations = NULL,
sample_names_to = pcr_id_column(),
values_to = "Value",
to_exclude = lifecycle::deprecated(),
keep_excluded = lifecycle::deprecated()
)
path |
The path to the file on disk |
separator |
The column delimiter used, defaults to |
additional_cols |
Either |
transformations |
Either |
sample_names_to |
Name of the output column holding the sample
identifier. Defaults to |
values_to |
Name of the output column holding the quantification
values. Defaults to |
to_exclude |
|
keep_excluded |
Additional columns are annotation columns present in the integration matrix to import that are not
part of the mandatory IS vars (see mandatory_IS_vars()
)
part of the annotation IS vars (see annotation_IS_vars()
)
the sample identifier column
the quantification column
When specified they tell the function how to treat those columns in the import phase, by providing a named character vector, where names correspond to the additional column names and values are a choice of the following:
"char"
for character (strings)
"int"
for integers
"logi"
for logical values (TRUE / FALSE)
"numeric"
for numeric values
"factor"
for factors
"date"
for generic date format - note that functions that
need to read and parse files will try to guess the format and parsing
may fail
One of the accepted date/datetime formats by lubridate
,
you can use ISAnalytics::date_formats()
to view the accepted formats
"_"
to drop the column
For more details see the "How to use import functions" vignette:
vignette("workflow_start", package = "ISAnalytics")
Lambdas provided in input in the transformations
argument,
must be transformations, aka functions that take
in input a vector and return a vector of the same length as the input.
If the transformation list contains column names that are not present in the data frame, they are simply ignored.
A data frame object in tidy format
The function will explicitly check for the presence of these tags:
All columns declared in mandatory_IS_vars()
transform_columns
Other Import functions:
import_Vispa2_stats()
,
import_association_file()
,
import_parallel_Vispa2Matrices()
fs_path <- generate_default_folder_structure(type = "correct")
matrix_path <- fs::path(
fs_path$root, "PJ01", "quantification",
"POOL01-1", "PJ01_POOL01-1_seqCount_matrix.no0.annotated.tsv.gz"
)
matrix <- import_single_Vispa2Matrix(matrix_path)
head(matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.