comparison kinatestid_r/Kinatest-R_part1.R @ 9:f80306fc5d69 draft

Uploaded
author jfb
date Thu, 08 Feb 2018 13:48:59 -0500
parents 927eaf73feca
children cf93d3535a31
comparison
equal deleted inserted replaced
8:927eaf73feca 9:f80306fc5d69
1 1
2 ImportedSubstrateList<- read.csv("input1", stringsAsFactors=FALSE) 2 ImportedSubstrateList<- read.csv("input1", stringsAsFactors=FALSE)
3 NegativeSubstrateList<- read.csv("input2", stringsAsFactors=FALSE) 3 NegativeSubstrateList<- read.csv("input2", stringsAsFactors=FALSE)
4 SubstrateBackgroundFrequency<- read.csv("input3", stringsAsFactors=FALSE) 4 SubstrateBackgroundFrequency<- read.csv("input3", stringsAsFactors=FALSE)
5 5
6 ScreenerFilename<-"screener7-7.csv" 6 ScreenerFilename<-"screener"
7 7
8 8
9 9
10 FILENAME<-"output1" 10 FILENAME<-"output1"
11 FILENAME2<-"output2" 11 FILENAME2<-"output2"
586 SetOfAAs<-matrix(data = SetOfAAs,ncol = 1) 586 SetOfAAs<-matrix(data = SetOfAAs,ncol = 1)
587 587
588 SDtableu<-SDtable 588 SDtableu<-SDtable
589 HeaderSD<-c(-7:7) 589 HeaderSD<-c(-7:7)
590 SDtable<-rbind(HeaderSD,SDtableu) 590 SDtable<-rbind(HeaderSD,SDtableu)
591 row.names(SDtable)<-NULL
591 SDtable<-data.frame(SetOfAAs,SDtable) 592 SDtable<-data.frame(SetOfAAs,SDtable)
592 593
593 PercentTable<-rbind(HeaderSD,PercentTable) 594 PercentTable<-rbind(HeaderSD,PercentTable)
595 row.names(PercentTable)<-NULL
594 PercentTable<-data.frame(SetOfAAs,PercentTable) 596 PercentTable<-data.frame(SetOfAAs,PercentTable)
595 numberofY<-as.numeric(SubstrateBackgroundFrequency$Number.of.Y) 597 numberofY<-as.numeric(SubstrateBackgroundFrequency$Number.of.Y)
596 numberofY<-numberofY[!is.na(numberofY)] 598 numberofY<-numberofY[!is.na(numberofY)]
597 599
598 numberofPY<-as.numeric(SubstrateBackgroundFrequency$Number.of.pY) 600 numberofPY<-as.numeric(SubstrateBackgroundFrequency$Number.of.pY)
1093 write.table(PercentTable,file=FILENAME, append = TRUE,sep=",",row.names = FALSE, col.names = FALSE) 1095 write.table(PercentTable,file=FILENAME, append = TRUE,sep=",",row.names = FALSE, col.names = FALSE)
1094 1096
1095 EPMtableu<-EPMtable 1097 EPMtableu<-EPMtable
1096 HeaderSD<-c(-7:7) 1098 HeaderSD<-c(-7:7)
1097 EPMtableu<-rbind(HeaderSD,EPMtableu) 1099 EPMtableu<-rbind(HeaderSD,EPMtableu)
1100 row.names(EPMtableu)<-NULL
1098 EPMtableu<-data.frame(SetOfAAs,EPMtableu) 1101 EPMtableu<-data.frame(SetOfAAs,EPMtableu)
1099 1102
1100 write.table("Site Selectivity Matrix", file = FILENAME2, append = TRUE, sep = ",", row.names = FALSE, col.names = FALSE) 1103 write.table("Site Selectivity Matrix", file = FILENAME2, append = TRUE, sep = ",", row.names = FALSE, col.names = FALSE)
1101 SelectivityHeader=matrix(data = c("Position",-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7),nrow = 1) 1104 SelectivityHeader=matrix(data = c("Position",-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7),nrow = 1)
1102 head<-matrix(data=rep(" ",times=16),nrow = 1) 1105 head<-matrix(data=rep(" ",times=16),nrow = 1)
1106 #colnames(SelectivitySheet)<-c("-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7") 1109 #colnames(SelectivitySheet)<-c("-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7")
1107 write.table(SelectivitySheet,file = FILENAME2, append = TRUE,sep = ",",row.names = TRUE, col.names = FALSE) 1110 write.table(SelectivitySheet,file = FILENAME2, append = TRUE,sep = ",",row.names = TRUE, col.names = FALSE)
1108 write.table(x=c("Endogenous Probability Matrix"),file=FILENAME2,append = TRUE,sep=",", row.names = FALSE, col.names = FALSE) 1111 write.table(x=c("Endogenous Probability Matrix"),file=FILENAME2,append = TRUE,sep=",", row.names = FALSE, col.names = FALSE)
1109 write.table(EPMtableu,file = FILENAME2, append = TRUE,sep = ",",row.names = FALSE, col.names = FALSE) 1112 write.table(EPMtableu,file = FILENAME2, append = TRUE,sep = ",",row.names = FALSE, col.names = FALSE)
1110 write.table(NormalizationScore, file = FILENAME2, append = TRUE,sep = ",",row.names = FALSE, col.names = FALSE) 1113 write.table(NormalizationScore, file = FILENAME2, append = TRUE,sep = ",",row.names = FALSE, col.names = FALSE)
1114