Mercurial > repos > proteomisc > preprocess_dataset
comparison preprocess_datasets/Make_matrix_two_channels.R @ 11:bdc430a41508 draft
Uploaded
author | proteomisc |
---|---|
date | Sun, 03 Dec 2023 14:07:23 +0000 |
parents | ebf6607b4e6a |
children |
comparison
equal
deleted
inserted
replaced
10:09a8947f1031 | 11:bdc430a41508 |
---|---|
1 make_design<-function(MA_matrix){ | |
2 matrix<-RG.MA(MA_matrix$dataNBA) | |
3 colnames_matrix<-NULL | |
4 tmp<-strsplit(colnames(MA_matrix$dataNBA),split=".",fixed = T) | |
5 for(i in 1:ncol(MA_matrix$dataNBA)){ | |
6 colnames_matrix[i]<-paste(tmp[[i]][1],"R",sep=".") | |
7 | |
8 # .Red intensity | |
9 } | |
10 i=1; | |
11 for(j in (ncol(MA_matrix$dataNBA)+1):((ncol(MA_matrix$dataNBA)*2))){ | |
12 | |
13 colnames_matrix[j]<-paste(tmp[[i]][1],"G",sep=".") | |
14 i<-i+1; | |
15 # .Green intensity | |
16 } | |
17 matrix_data<-cbind(matrix$R,matrix$G) | |
18 colnames(matrix_data)<-colnames_matrix | |
19 rownames(matrix_data)<-rownames(MA_matrix$dataNBA) | |
20 MA_matrix$matrix_data<-log2(matrix_data) | |
21 groupe<-c(rep("case",ncol(matrix$R)),rep("control",ncol(matrix$G))) | |
22 sample=colnames(matrix_data) | |
23 designo<-data.frame(sample=sample,groupetype=rep(designo$group,2),group=groupe) | |
24 MA_matrix$designo<-designo | |
25 write.table(format(designo, justify="right"),sep="\t", quote=FALSE, | |
26 row.names=T, col.names=T,file="design.txt") | |
27 return(MA_matrix) | |
28 } |