View source: R/annotations_matrix.R
annotations_matrix | R Documentation |
This functions performs a search and replace in the contents of an annotation. A simple matrix consisting of two columns will be used. The first column of the matrix needs to contain the search string, the second column the replacement string. The matrix needs to be in CSV format.
annotations_matrix(x, path_replacementMatrixCSV, filterTranscriptNames = NULL)
x |
Corpus object. |
path_replacementMatrixCSV |
Character string; path to replacement matrix (a CSV file). |
filterTranscriptNames |
Vector of character strings; names of the transcripts to be included. |
Corpus object.
matrix_load()
for loading the matrix
and matrix_save()
for saving the matrix to a CSV file.
If only certain transcripts or tiers should be affected set the parameter filterTranscriptNames
.
In case that you want to select transcripts by using regular expressions use the function act::search_makefilter
first.
media_delete, media_getPathToExistingFile
library(act)
# An example replacement matrix comes with the package.
# It replaces most of the GAT conventions.
path <- system.file("extdata", "normalization", "normalizationMatrix.csv", package="act")
# Have a look at the matrix
mymatrix <- act::matrix_load(path)
mymatrix
# Apply matrix to examplecorpus
test <- act::annotations_matrix(x=examplecorpus, path_replacementMatrixCSV=path)
# Compare some annotations in the original examplecorpus object and
# in the modified corpus object test
examplecorpus@transcripts[[1]]@annotations$content[[1]]
test@transcripts[[1]]@annotations$content[[1]]
examplecorpus@transcripts[[2]]@annotations$content[[3]]
test@transcripts[[2]]@annotations$content[[3]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.