#Sys.setlocale("LC_COLLATE", "C") Sys.setlocale("LC_COLLATE", "en_US.UTF-8") # ensure common sorting envir library(SomaDataIO) knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" ) dcf <- read.dcf(file = file.path(".", "DESCRIPTION")) if ( nrow(dcf) < 1L) stop("DESCRIPTION file of package is corrupt.", call. = FALSE) desc <- as.list(dcf[1L, ]) ver <- paste0("https://img.shields.io/badge/Version-", desc$Version, "-success.svg?style=flat&logo=github")
The SomaDataIO
R package loads and exports 'SomaScan' data via the
Standard BioTools, Inc. structured text file called an ADAT (*.adat
).
The package also exports auxiliary functions for manipulating, wrangling,
and extracting relevant information from an ADAT object once in memory.
Basic familiarity with the R environment is assumed, as is the ability to install
contributed packages from the Comprehensive R Archive Network (CRAN).
If you run into any issues/problems with SomaDataIO
full documentation
of the most recent
release
can be found at our
website of articles and workflows.
If the issue persists we encourage you to consult the
issues
page and, if appropriate, submit an issue and/or feature request.
The SomaDataIO
package is licensed under the
MIT
license and is intended solely for research use only (“RUO”) purposes.
The code contained herein may not be used for diagnostic, clinical,
therapeutic, or other commercial purposes.
The easiest way to install SomaDataIO
is to install directly from CRAN:
install.packages("SomaDataIO")
Alternatively from GitHub:
remotes::install_github("SomaLogic/SomaDataIO")
which installs the most current "development" version from the repository
HEAD
. To install the most recent release, use:
remotes::install_github("SomaLogic/SomaDataIO@*release")
To install a specific tagged release, use:
remotes::install_github("SomaLogic/SomaDataIO@v5.3.0")
The SomaDataIO
package was intentionally developed to contain a
limited number of dependencies from CRAN. This makes
the package more stable to external software design changes but
also limits its contained feature set. With this in mind, SomaDataIO
aims to strike a balance providing long(er)-term stability and a
limited set of features.
Below are the package dependencies
(see also the DESCRIPTION
file):
The Biobase
package is suggested, being required by only
two functions, pivotExpressionSet()
and adat2eSet()
.
Biobase
must be installed separately from
Bioconductor
by entering the following from the R
Console:
if (!requireNamespace("BiocManager", quietly = TRUE)) { install.packages("BiocManager") } BiocManager::install("Biobase", version = remotes::bioc_version())
Information about Bioconductor can be found here: https://bioconductor.org/install/
Upon successful installation, load SomaDataIO
as normal:
library(SomaDataIO)
For an index of available commands:
library(help = SomaDataIO)
The SomaDataIO
package comes with four (4) objects available
to users to run canned examples (or analyses). They can be accessed once
SomaDataIO
has been attached via library()
. They are:
example_data
: the original 'SomaScan' file (example_data.adat
) can
be found here or downloaded
directly via:
bash
wget https://raw.githubusercontent.com/SomaLogic/SomaLogic-Data/main/example_data.adat
SomaDataIO
it has been replaced by an abbreviated,
light-weight version containing only the first 10 samples:
r
dir(system.file("extdata", package = "SomaDataIO"), full.names = TRUE)
ex_analytes
: the analyte (feature) variables in example_data
ex_anno_tbl
: the annotations table associated with example_data
ex_target_names
: a mapping object for analyte -> target?SomaScanObjects
Loading data (Import)
*.adat
text file into an R
session
as a soma_adat
object.Wrangling data (manipulation)
soma_adat
object.?SeqId
analyte (feature) matching.soma_adat
class.?rownames
helpers that do not break soma_adat
attributes.Exporting data (Output)
soma_adat
object as a *.adat
text file.Loading an ADAT text file is simple using read_adat()
:
# Sample file name f <- system.file("extdata", "example_data10.adat", package = "SomaDataIO", mustWork = TRUE) my_adat <- read_adat(f) # test object class is.soma_adat(my_adat) # S3 print method (forwards -> tibble) my_adat
Please see the article Loading and Wrangling SomaScan for more details and options.
The soma_adat
class comes with numerous class-specific
S3 methods to the most popular
dplyr and
tidyr generics.
# see full complement of `soma_adat` methods methods(class = "soma_adat")
Please see the article Loading and Wrangling SomaScan
for more details about available soma_adat
methods.
The soma_adat
object also contains specific structure that are useful
to users. Please also see ?colmeta
or ?annotations
for further
details about these fields.
This section now lives in individual package articles. For further detail please see:
stats::t.test()
see workflow: Two-Group Comparison
Multi-group comparison (e.g. differential expression) via ANOVA
stats::aov()
see workflow: ANOVA Three-Group Analysis
Binary classification
stats::glm()
see workflow: Binary Classification
Linear regression
stats::lm()
Note that, in an effort to reduce package size and dependencies, these articles
and workflows are only accessible via the SomaDataIO
pkgdown
website, and
are not included with the installed package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.