-
Notifications
You must be signed in to change notification settings - Fork 0
/
RawDataToTables.r
34 lines (25 loc) · 1.27 KB
/
RawDataToTables.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
library(plyr)
rawDistanceRows <- readLines("stats/violin-distance.txt")
rawIntensityRows <- readLines("stats/violin-intensity.txt")
# split by sep
rawDistanceRowsSplits <- strsplit(rawDistanceRows, "\t")
# Make each into a list of dataframes (for rbind.fill)
rawDistanceRowsSplits <- lapply(rawDistanceRowsSplits, function(x)as.data.frame(t(x)))
# now bind
distanceRowsModified <- rbind.fill(rawDistanceRowsSplits)
distanceColumnsModified <- as.data.frame(t(as.matrix(distanceRowsModified)));
write.table(distanceRowsModified, "stats/violin-distance-modifedrows.txt");
write.table(distanceColumnsModified, "stats/violin-distance-modifiedcolumns.txt");
# split by sep
rawIntensityRowsSplits <- strsplit(rawIntensityRows, "\t")
# Make each into a list of dataframes (for rbind.fill)
rawIntensityRowsSplits <- lapply(rawIntensityRowsSplits, function(x)as.data.frame(t(x)))
# now bind
intensityRowsModified <- rbind.fill(rawIntensityRowsSplits)
intensityColumnsModified <- as.data.frame(t(as.matrix(intensityRowsModified)));
write.table(intensityRowsModified, "stats/violin-intensity-modifedrows.txt");
write.table(intensityColumnsModified, "stats/violin-intensity-modifiedcolumns.txt");
dim(distanceRowsModified)
dim(distanceColumnsModified)
dim(intensityRowsModified)
dim(intensityColumnsModified)