Description Usage Arguments Value Author(s) Examples
Takes in a filename/path and checks if the file exists or is empty. Then it checks that it is either a .csv or a .txt file. If it is empty or does not exist it stops and reports this. If it is not a .csv or .txt it stops and reports this. If it is a .csv or .txt it will create a dataframe from the data and return it filtered for cell barcodes with colsums >= 500
1 | getFile(filepath)
|
filepath |
The file name or path as a string |
returns a dataframe of the scppin form the file if it is in the proper format
Matt Heffernan, University of Illinois at Chicago
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
getFile("GSM4008666_Adult-Uterus1_dge.txt")
## The function is currently defined as
function (filepath)
{
if ((file.exists(filepath)) & (file.size(filepath) > 0)) {
if (grepl(".csv", filepath, fixed = T)) {
Data <- read.csv(filepath, header = T, row.names = 1)
}
else if (grepl(".txt", filepath, fixed = T)) {
Data <- read.delim(filepath, header = T, row.names = 1)
}
else {
stop("FILE NOT IN PROPER FORMAT (.csv OR .txt)")
}
}
else {
stop("FILE DOES NOT EXIST OR IS EMPTY")
}
Data <- Data[, colSums(Data) >= 500]
return(Data)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.