changeset 9:f80306fc5d69 draft

Uploaded
author jfb
date Thu, 08 Feb 2018 13:48:59 -0500
parents 927eaf73feca
children de59605e960a
files kinatestid_r/Kinatest-R_part1.R kinatestid_r/Kinatest-R_part2.R
diffstat 2 files changed, 20 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/kinatestid_r/Kinatest-R_part1.R	Thu Feb 08 12:33:36 2018 -0500
+++ b/kinatestid_r/Kinatest-R_part1.R	Thu Feb 08 13:48:59 2018 -0500
@@ -3,7 +3,7 @@
 NegativeSubstrateList<- read.csv("input2", stringsAsFactors=FALSE)
 SubstrateBackgroundFrequency<- read.csv("input3", stringsAsFactors=FALSE)
 
-ScreenerFilename<-"screener7-7.csv"
+ScreenerFilename<-"screener"
 
 
 
@@ -588,9 +588,11 @@
 SDtableu<-SDtable
 HeaderSD<-c(-7:7)
 SDtable<-rbind(HeaderSD,SDtableu)
+row.names(SDtable)<-NULL
 SDtable<-data.frame(SetOfAAs,SDtable)
 
 PercentTable<-rbind(HeaderSD,PercentTable)
+row.names(PercentTable)<-NULL
 PercentTable<-data.frame(SetOfAAs,PercentTable)
 numberofY<-as.numeric(SubstrateBackgroundFrequency$Number.of.Y)
 numberofY<-numberofY[!is.na(numberofY)]
@@ -1095,6 +1097,7 @@
 EPMtableu<-EPMtable
 HeaderSD<-c(-7:7)
 EPMtableu<-rbind(HeaderSD,EPMtableu)
+row.names(EPMtableu)<-NULL
 EPMtableu<-data.frame(SetOfAAs,EPMtableu)
 
 write.table("Site Selectivity Matrix", file = FILENAME2, append = TRUE, sep = ",", row.names = FALSE, col.names = FALSE)
@@ -1108,3 +1111,4 @@
 write.table(x=c("Endogenous Probability Matrix"),file=FILENAME2,append = TRUE,sep=",", row.names = FALSE, col.names = FALSE)
 write.table(EPMtableu,file = FILENAME2, append = TRUE,sep = ",",row.names = FALSE, col.names = FALSE)
 write.table(NormalizationScore, file = FILENAME2, append = TRUE,sep = ",",row.names = FALSE, col.names = FALSE)
+
--- 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 = ",")
 
-