| write_gct | R Documentation |
Write matrix in GCT file format
write_gct(matrix, file = stdout(), feat.name, feat.desc, na = "")
matrix |
A numeric matrix |
file |
Output file name. By default the file is written to standard output |
feat.name |
Character vector, optional. Feature names; if missing the
row names are used as feature names. If given, |
feat.desc |
Character vector, optional. Feature descriptions; if missing, empty strings will be used as descriptions. |
na |
Character string, how 'NA' values will be printed? |
Input matrix will be transformed into the GCT format. The transformed texts are printed on the standard output or in specified files.
If the input matrix has NULL as row names, and the feat.name
option is left missing, a warning message will be print and the NAME
column of the gct file will use integer indices starting from 1.
feat.desc specifies feature descriptions. Leaving is missing, or
assigning it to NA or NULL will output a description column
filled with empty strings.
Texts printed in stdout() or in output file.
From version 1.0-22, write_gct is able to handle zero-row matrix (see examples below)
Jitao David Zhang <jitao_david.zhang@roche.com>
read_gct_matrix to read matrix from GCT files.
tmpMatrix <- matrix(rnorm(15), nrow=3L, ncol=5L,
dimnames=list(LETTERS[1:3L], letters[1:5L]))
write_gct(tmpMatrix)
write_gct(tmpMatrix, file=tempfile())
## specify feature names
write_gct(tmpMatrix, feat.name=c("F1", "F2", "F3"))
write_gct(tmpMatrix, feat.name=c("F1", "F2", "F3"), feat.desc=NULL)
write_gct(tmpMatrix, feat.name=c("F1", "F2", "F3"), feat.desc=NA)
## specify feature names and descriptions
write_gct(tmpMatrix, feat.name=c("F1", "F2", "F3"), feat.desc=
c("Feature 1", "Feature 2", "Feature 3"))
## special case: 0-row matrix
write_gct(tmpMatrix[c(FALSE,FALSE,FALSE),,drop=FALSE])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.