View source: R/readAnnotationFile.R
readAnnotationFile | R Documentation |
Read in an annotation file in the tsv-format, with or without row names
readAnnotationFile(file, outputKeyName = "FeatureName", ...)
file |
A tab-delimited file without quotes, the first column must contain identifiers (key names). In case the first column has no column name and it contains row names, they will be used as feature names. |
outputKeyName |
The key name used in the output |
... |
Other parameters passed to |
A data.frame
containing the annotation, with the first
column named as outputKeyName
that contains feature identifiers as character
strings. In case the input table contains the column with the same name,
the content in that column must match the row names, otherwise an error
is reported.
This function is called by readFeatureAnnotationFile
and
readSampleAnnotationFile
. Normal users are unlikely to use it.
f1 <- system.file("extdata",
"featureAnnotation/featureAnnotationFile-withRowNames.txt",
package="ribiosExpression")
f2 <- system.file("extdata",
"featureAnnotation/featureAnnotationFile-withoutRowNames.txt",
package="ribiosExpression")
# 'FeatureName' does not exist in the column names of f1
f1Read <- readAnnotationFile(f1, outputKeyName="FeatureName")
# 'GeneID' exists in the colum names of f2, and it is the first column.
f2Read <- readAnnotationFile(f2, outputKeyName="GeneID")
head(f1Read)
head(f2Read)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.