Description Usage Arguments Value Author(s) See Also Examples
View source: R/readSampleKey.R
Function to extract sample key data from a file and link chip ID information with aliases if they exist.
1 | readSampleKey(file = NULL, chips = NULL, comment.char = "#", sep = "\t")
|
file |
the name of the file containing sample key information. Each line of the file is interpreted as a single chip-to-sample map. If it does not contain an absolute path, the file name is relative to the current working directory, |
chips |
a character vector specifying a specific chip ID lookup in the sample key, for which the function will return the appropriate sample aliases |
comment.char |
character: a character vector of length one containing a single character or an empty string. Use "" to turn off the interpretation of comments altogether. |
sep |
the field separator character. Values on each line of the file are separated by this character. If sep = "" the separator is "white space", that is one or more spaces, tabs, newlines or carriage returns. |
Returns a character vector of sample alias information corresponding to the chips present in the sample key or a subset thereof, specified by the chips
input.
Reid F. Thompson (rthompso@aecom.yu.edu)
1 2 3 4 5 6 7 8 | #demo(pipeline,package="HELP")
cat("#COMMENT\nCHIP_ID\tSAMPLE\n",file="./sample.key.txt")
write.table(cbind(1:10,1001:1010),file="./sample.key.txt",append=TRUE,col.names=FALSE,row.names=FALSE,quote=FALSE,sep="\t")
readSampleKey(file="./sample.key.txt")
readSampleKey(file="./sample.key.txt",chips=c(7:10,"NA1","NA2"))
#file.remove("./sample.key.txt")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.