View source: R/import-functions.R
import_association_file | R Documentation |
Imports the association file and optionally performs a check on the file system starting from the root to assess the alignment between the two.
import_association_file(
path,
root = NULL,
dates_format = "ymd",
separator = "\t",
filter_for = NULL,
import_iss = FALSE,
convert_tp = TRUE,
report_path = default_report_path(),
transformations = default_af_transform(convert_tp),
tp_padding = lifecycle::deprecated(),
...
)
path |
The path on disk to the association file. |
root |
The path on disk of the root folder of VISPA2 output or |
dates_format |
A single string indicating how dates should be parsed.
Must be a value in: |
separator |
The column separator used in the file |
filter_for |
A named list where names represent column names that
must be filtered. For example: |
import_iss |
Import VISPA2 pool stats and merge them with the association file? Logical value |
convert_tp |
Should be time points be converted into months and years? Logical value |
report_path |
The path where the report file should be saved.
Can be a folder or |
transformations |
Either |
tp_padding |
|
... |
Additional arguments to pass to
|
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.
If the root
argument is set to NULL
no file system alignment is
performed. This allows to import the basic file but it won't be
possible to perform automated matrix and stats import.
For more details see the "How to use import functions" vignette:
vignette("workflow_start", package = "ISAnalytics")
The time point conversion is based on the following logic, given TPD
is the column containing the time point expressed in days and
TPM
and TPY
are respectively the time points expressed as month
and years
If TPD
is NA
–> NA
(for both months and years)
TPM
= 0, TPY
= 0 if and only if TPD
= 0
For conversion in months:
TPM
= ceiling(TPD
/30) if TPD
< 30 otherwise TPM
= round(TPD
/30)
For conversion in years:
TPY
= ceiling(TPD
/360)
The data frame containing metadata
The function will explicitly check for the presence of these tags:
project_id
pool_id
tag_seq
subject
tissue
tp_days
cell_marker
pcr_replicate
vispa_concatenate
pcr_repl_id
proj_folder
The function will use all the available specifications contained in
association_file_columns(TRUE)
to read and parse the file.
If the specifications contain columns with a type "date"
, the function
will parse the generic date with the format in the dates_format
argument.
transform_columns
date_formats
Other Import functions:
import_Vispa2_stats()
,
import_parallel_Vispa2Matrices()
,
import_single_Vispa2Matrix()
fs_path <- generate_default_folder_structure(type = "correct")
af <- import_association_file(fs_path$af,
root = fs_path$root,
report_path = NULL
)
head(af)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.