checkexptab | R Documentation |
The 'checkexptab' function verifies the structure and content of an experiment table to ensure it meets specific formatting requirements. It checks for the presence of required columns, and validates that the 'direction' and 'strand' columns contain only allowable values.
checkexptab(exptab)
exptab |
A data frame containing experiment data that should have columns named 'condition', 'replicate', 'strand', and 'path'. |
The function performs the following checks: - The column names of 'exptab' must match exactly: '"condition"', '"replicate"', '"direction"', and '"strand"'. - The 'direction' column must contain only '"forward"' and '"reverse"'. - The 'strand' column must contain only '"plus"' and '"minus"'.
If the experiment table is valid, the function returns 'NULL'. If the table is invalid, the function throws an error specifying the issue.
# Create a valid experiment table
exptab <- data.frame(
condition = c("cond1", "cond2"),
replicate = c(1, 1),
direction = c("forward", "reverse"),
strand = c("plus", "minus"),
path = c("toto/", "toto/"))
checkexptab(exptab) # Should pass without errors
# Invalid experiment table (wrong column names)
invalid_exptab <- data.frame(
cond = c("cond1", "cond2"),
rep = c(1, 1),
dir = c("forward", "reverse"),
str = c("+", "-"),
paths = c("toto/", "toto/"))
try(checkexptab(invalid_exptab))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.