-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsvSplitterCommandLine.R
More file actions
executable file
·60 lines (36 loc) · 1.49 KB
/
csvSplitterCommandLine.R
File metadata and controls
executable file
·60 lines (36 loc) · 1.49 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#csvsplitter
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
csvSplitter<-function(inputfile,resultspath)
{
result<-read.csv(inputfile,sep=' ',header=F)
resultdfInitial<-data.frame(result)
rowsizeInitial<-nrow(resultdfInitial)
resultdf<-result[3:rowsizeInitial,] #subset out data
dir.create(resultspath)
k=1
g=1
while (g < 100)
{
print(k+1)
print(k+1365)
resultpiece<-resultdf[(k):(k+1365),]
iteratorchar<-as.character(g)
if(g<10)
iteratorchar<-paste("00",iteratorchar,sep="")
else if(g==10 || g<100)
iteratorchar<-paste("0",iteratorchar,sep="")
if (g==10)
print(resultpiece)
constructedname<-paste("pararesults",iteratorchar,sep="")
constructednamefinal<-paste(constructedname,".csv",sep="")
destination<-paste(resultspath,"/",constructednamefinal,sep='')
write.table(resultpiece, file=destination, row.names=FALSE, quote=F, col.names = c("x","y","z","radius","WUSRNA","WUSNuc_WS","WUSCyto","CLV3Sig1","CLV3_Peptide","StochasticTimeOverFlow","CLV3Sig2", "MarkerOverFlow", "Monomer", "Dimer","MonomerMarker","DimerMarker",
"ckReceptor","ckLigand","ckComplex","WExport", "neighbors?"))
#henrik annotations
#write.table(resultpiece, file=constructednamefinal, row.names=FALSE, quote=F, col.names = c("x","y","z","WUSRNA","WUSNuc_WS","CLV3MRNA","Y","Kanadi","KanadiSig","A","B","AG1","AS1","AG2","AS2a","AS2b","var1","var2"))
k=k+1366+1
g=g+1
}
}
csvSplitter(args[1],args[2])