-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperformPreprocessing.R
36 lines (31 loc) · 1.65 KB
/
performPreprocessing.R
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
27
28
29
30
31
32
33
34
35
rm(list=ls())
library(plyr)
library(zoo)
library(foreign)
library(tiff)
library(data.table)
source('/Users/jaywarrick/Public/Dropbox/GitHub/R-SingleCell/preprocessingHelperFunctions.R')
# Generate Master data files based on arff files from JEX
# masterData <- getData()
# errors <- getErrors()
# data <- masterData$data # Note that data is a data.table not a data.frame
# countData <- masterData$countData # Note that countData is a data.table not a data.frame
# writeData(data, countData, errors)
# andreaData <- getAndreaData()
# Load saved Master data
savedData <- readData()
data <- savedData$data
countData <- savedData$countData
errors <- savedData$errors
rm(savedData)
# Remove ROIS with errors (bubbles etc.)
data <- data[!(data$ID %in% errors$ID),]
# preprocess and write the preprocessed data to files
temp <- preprocessVirusData(data, virusType='M51R')
write.table(temp$single, '/Users/jaywarrick/Google Drive/SingleCellLatest/Processed Data/M51R_Data_1Cell.txt', row.names=FALSE)
write.table(temp$zero, '/Users/jaywarrick/Google Drive/SingleCellLatest/Processed Data/M51R_Data_0Cell.txt', row.names=FALSE)
write.table(temp$thresholds, '/Users/jaywarrick/Google Drive/SingleCellLatest/Processed Data/M51R_Thresholds.txt', row.names=FALSE)
temp <- preprocessVirusData(data, virusType='N1')
write.table(temp$single, '/Users/jaywarrick/Google Drive/SingleCellLatest/Processed Data/N1_Data_1Cell.txt', row.names=FALSE)
write.table(temp$zero, '/Users/jaywarrick/Google Drive/SingleCellLatest/Processed Data/N1_Data_0Cell.txt', row.names=FALSE)
write.table(temp$thresholds, '/Users/jaywarrick/Google Drive/SingleCellLatest/Processed Data/N1_Thresholds.txt', row.names=FALSE)