1
|
1 args = commandArgs();
|
|
2 input_file=args[4];
|
|
3 av=as.numeric(args[5]);
|
|
4 sd=as.numeric(args[6]);
|
|
5 nu=as.numeric(args[7]);
|
|
6
|
|
7
|
|
8 data=read.table(input_file);
|
|
9
|
|
10 col=4;
|
|
11 x=data[,col];
|
|
12 pup=pnorm(x, mean=av, sd=sd, lower.tail = FALSE);
|
|
13 adpup=p.adjust(pup,method="fdr");
|
|
14 pdn=pnorm(x, mean=av, sd=sd, lower.tail = TRUE);
|
|
15 adpdn=p.adjust(pdn,method="fdr");
|
|
16
|
|
17 p=pup;
|
|
18
|
|
19 size = length(x);
|
|
20
|
|
21 for (i in 1:size)
|
|
22 {
|
|
23 if(x[i]<0)
|
|
24 {
|
|
25 p[i]=pdn[i];
|
|
26 }
|
|
27 }
|
|
28 write(p, file=paste(input_file,"p",sep="."),ncolumns=1);
|
|
29
|