Description Usage Arguments Value Author(s) See Also Examples
View source: R/class_dmDSdata.R
Constructor function for a dmDSdata
object.
1 |
counts |
Data frame with counts. Rows correspond to features, for
example, transcripts or exons. This data frame has to contain a
|
samples |
Data frame where each row corresponds to one sample. Columns
have to contain unique sample IDs in |
Returns a dmDSdata object.
Malgorzata Nowicka
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # --------------------------------------------------------------------------
# Create dmDSdata object
# --------------------------------------------------------------------------
## Get kallisto transcript counts from the 'PasillaTranscriptExpr' package
library(PasillaTranscriptExpr)
data_dir <- system.file("extdata", package = "PasillaTranscriptExpr")
## Load metadata
pasilla_metadata <- read.table(file.path(data_dir, "metadata.txt"),
header = TRUE, as.is = TRUE)
## Load counts
pasilla_counts <- read.table(file.path(data_dir, "counts.txt"),
header = TRUE, as.is = TRUE)
## Create a pasilla_samples data frame
pasilla_samples <- data.frame(sample_id = pasilla_metadata$SampleName,
group = pasilla_metadata$condition)
levels(pasilla_samples$group)
## Create a dmDSdata object
d <- dmDSdata(counts = pasilla_counts, samples = pasilla_samples)
## Use a subset of genes, which is defined in the following file
gene_id_subset <- readLines(file.path(data_dir, "gene_id_subset.txt"))
d <- d[names(d) %in% gene_id_subset, ]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.