annotate preprocess_datasets/Make_matrix_two_channels.R @ 22:2f468dd9ea39 draft

Uploaded
author proteomisc
date Sun, 03 Dec 2023 17:20:30 +0000
parents ebf6607b4e6a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
1 make_design<-function(MA_matrix){
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
2 matrix<-RG.MA(MA_matrix$dataNBA)
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
3 colnames_matrix<-NULL
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
4 tmp<-strsplit(colnames(MA_matrix$dataNBA),split=".",fixed = T)
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
5 for(i in 1:ncol(MA_matrix$dataNBA)){
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
6 colnames_matrix[i]<-paste(tmp[[i]][1],"R",sep=".")
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
7
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
8 # .Red intensity
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
9 }
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
10 i=1;
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
11 for(j in (ncol(MA_matrix$dataNBA)+1):((ncol(MA_matrix$dataNBA)*2))){
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
12
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
13 colnames_matrix[j]<-paste(tmp[[i]][1],"G",sep=".")
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
14 i<-i+1;
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
15 # .Green intensity
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
16 }
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
17 matrix_data<-cbind(matrix$R,matrix$G)
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
18 colnames(matrix_data)<-colnames_matrix
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
19 rownames(matrix_data)<-rownames(MA_matrix$dataNBA)
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
20 MA_matrix$matrix_data<-log2(matrix_data)
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
21 groupe<-c(rep("case",ncol(matrix$R)),rep("control",ncol(matrix$G)))
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
22 sample=colnames(matrix_data)
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
23 designo<-data.frame(sample=sample,groupetype=rep(designo$group,2),group=groupe)
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
24 MA_matrix$designo<-designo
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
25 write.table(format(designo, justify="right"),sep="\t", quote=FALSE,
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
26 row.names=T, col.names=T,file="design.txt")
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
27 return(MA_matrix)
ebf6607b4e6a Uploaded
proteomisc
parents:
diff changeset
28 }