-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck_data_mtxDE.Rd
More file actions
68 lines (63 loc) · 2.52 KB
/
check_data_mtxDE.Rd
File metadata and controls
68 lines (63 loc) · 2.52 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mtxDE.R
\name{check_data_mtxDE}
\alias{check_data_mtxDE}
\title{Check data validity for mtxDE function}
\usage{
check_data_mtxDE(feature.table, dna.table = NULL, metadata, sampleID)
}
\arguments{
\item{feature.table}{A data frame where rows are samples and
columns are features (e.g., genes).
Row names should correspond to sample IDs.}
\item{dna.table}{A data frame where rows are samples and
columns are features (e.g., genes).
Row names should correspond to sample IDs.
This table should contain gene abundance data.}
\item{metadata}{A data frame containing metadata for the samples,
where rows are samples
and columns are metadata variables (e.g., phenotype, timepoint).}
\item{sampleID}{A string representing the column name in `metadata`
that contains the sample IDs.
This column is used to merge the metadata with the feature table.}
}
\value{
Nothing.
}
\description{
This function checks the validity of your
data for mtxDE analyses. This will check that your
dna and feature tables have row names that match the given
sampleID metadata column. It also ensures that dna.table and
feature.table share column names.
}
\examples{
feature.table <- data.frame(a=c(0.1, 0.0, 0.0, 0.0),
b=c(0.5, 0.5, 0.5, 0.4),
c=c(0.4, 0.5, 0.0, 0.0),
d=c(0.0, 0.0, 0.5, 0.6))
dna.table <- data.frame(a=c(0.3, 0.1, 0.0, 0.0),
b=c(0.2, 0.2, 0.2, 0.1),
c=c(0.4, 0.5, 0.1, 0.0),
d=c(0.0, 0.0, 0.5, 0.6))
row.names(feature.table) <- paste0("sample_", seq_len(4))
row.names(dna.table) <- paste0("sample_", seq_len(4))
metadata <- data.frame(SampleID=paste0("sample_", seq_len(4)),
phenotype=c(0,0,1,1),
participant=c(0,1,0,1),
timepoint=c(0,0,1,1))
# This will not raise an error
check_data_mtxDE(feature.table = feature.table,
dna.table = dna.table,
metadata = metadata,
sampleID="SampleID")
# This will raise an error
# feature.table <- data.frame(e=c(0.1, 0.0, 0.0, 0.0),
# f=c(0.5, 0.5, 0.5, 0.4),
# g=c(0.4, 0.5, 0.0, 0.0),
# h=c(0.0, 0.0, 0.5, 0.6))
# check_data_mtxDE(feature.table = feature.table,
# dna.table = dna.table,
# metadata = metadata,
# sampleID="SampleID")
}