diff kinatestid_r/Kinatest-R_part2.R @ 9:f80306fc5d69 draft

Uploaded
author jfb
date Thu, 08 Feb 2018 13:48:59 -0500
parents 2f3df9b1c05b
children
line wrap: on
line diff
--- a/kinatestid_r/Kinatest-R_part2.R	Thu Feb 08 12:33:36 2018 -0500
+++ b/kinatestid_r/Kinatest-R_part2.R	Thu Feb 08 13:48:59 2018 -0500
@@ -10,7 +10,7 @@
 # require(xlsx)
 # # require(readxl)
 
-View(SDtable)
+#View(SDtable)
 bareSDs<-SDtable[2:21,2:16]
 goodones<-bareSDs>2
 
@@ -49,7 +49,6 @@
 
 aa_props2 <- c("1"="A", "2"="C", "3"="D", "4"="E", "5"="F", "6"="G", "7"="H", "8"="I", "9"="K", "10"="L", "11"="M", "12"="N",
                "13"="P", "14"="Q", "15"="R", "16"="S", "17"="T", "18"="V", "19"="W", "20"="Y")
-aa_props2<-c(1="A")
 
 Positionm7<-sapply(Positionm7, function (x) aa_props2[x])
 Positionm6<-sapply(Positionm6, function (x) aa_props2[x])
@@ -647,7 +646,7 @@
 RanksPeptides<-PeptidesWithRanks[order(PeptidesWithRanks$AllActive,decreasing = FALSE),]
 # PepRankHead<-c(1:9,"Sequence","RPMS","PMS")
 # RanksPeptides<-rbind.data.frame(PepRankHead,PeptidesWithRanks)
-head(RanksPeptides)
+#head(RanksPeptides)
 
 
 #now I have to score the negative sequences... for some reason
@@ -658,7 +657,12 @@
 #I FUCKED WITH THE MCC TABLE AND NEED TO FINISH IT 
 
 ThisKinBlanks<-rep(1,times=17)
-ThisKinTable<-rbind(ThisKinTable,ThisKinBlanks)
+#indx <- sapply(breast, is.factor)
+#ThisKinTable[indx] <- lapply(ThisKinTable[indx], function(x) as.character(x))
+ThisKinTable$SetOfAAs<-as.character(ThisKinTable$SetOfAAs)
+
+#ThisKinTest<-rbind.data.frame(ThisKinTable,ThisKinBlanks)
+ThisKinTable<-rbind.data.frame(ThisKinTable,ThisKinBlanks)
 
 NegativeScores<-rep(NA,times=nrow(NegativeSubstrateList))
 NegativeWeirdScores<-rep(NA,times=nrow(NegativeSubstrateList))
@@ -774,9 +778,13 @@
 # write.xlsx(RanksPeptides,file = FILENAME,sheetName = "Ranked Generated Peptides",col.names = FALSE,row.names = FALSE,append = TRUE)
 # write.xlsx(positivewithscores,file = FILENAME, sheetName = "Positive Sequences Scored",col.names = FALSE,row.names = FALSE,append = TRUE)
 write.table(x=c("Characterzation Table"),file = FILENAME2, col.names = FALSE,row.names = FALSE, append = TRUE,sep = ",")
-write.table(Characterization,file = FILENAME2, col.names = TRUE,row.names = FALSE, append = TRUE,sep = ",")
+header<-colnames(Characterization)
+Characterization<-rbind.data.frame(header,Characterization)
+write.table(Characterization,file = FILENAME2, col.names = FALSE,row.names = FALSE, append = TRUE,sep = ",")
+
+# header<-colnames(RanksPeptides)
+# RanksPeptides<-rbind.data.frame(header,RanksPeptides)
+write.table(RanksPeptides,file = FILENAME3,append = FALSE,row.names = FALSE,col.names = TRUE,sep = ",")
 
 
-write.table(RanksPeptides,file = FILENAME3,append = TRUE,row.names = FALSE,col.names = TRUE,sep = ",")
 
-