Mercurial > repos > jfb > kinatest_r_7_7testing
comparison kinatestid_r/Kinatest-R_part2.R @ 9:f80306fc5d69 draft
Uploaded
author | jfb |
---|---|
date | Thu, 08 Feb 2018 13:48:59 -0500 |
parents | 2f3df9b1c05b |
children |
comparison
equal
deleted
inserted
replaced
8:927eaf73feca | 9:f80306fc5d69 |
---|---|
8 # require(rJava) | 8 # require(rJava) |
9 # require(xlsxjars) | 9 # require(xlsxjars) |
10 # require(xlsx) | 10 # require(xlsx) |
11 # # require(readxl) | 11 # # require(readxl) |
12 | 12 |
13 View(SDtable) | 13 #View(SDtable) |
14 bareSDs<-SDtable[2:21,2:16] | 14 bareSDs<-SDtable[2:21,2:16] |
15 goodones<-bareSDs>2 | 15 goodones<-bareSDs>2 |
16 | 16 |
17 Positionm7<-which(goodones[,1] %in% TRUE) | 17 Positionm7<-which(goodones[,1] %in% TRUE) |
18 if (length(Positionm7)<1){Positionm7<-which(bareSDs[,1]==max(bareSDs[,1]))} | 18 if (length(Positionm7)<1){Positionm7<-which(bareSDs[,1]==max(bareSDs[,1]))} |
47 Positionp7<-which(goodones[,15] %in% TRUE) | 47 Positionp7<-which(goodones[,15] %in% TRUE) |
48 if (length(Positionp7)<1){Positionp7<-which(bareSDs[,15]==max(bareSDs[,15]))} | 48 if (length(Positionp7)<1){Positionp7<-which(bareSDs[,15]==max(bareSDs[,15]))} |
49 | 49 |
50 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", | 50 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", |
51 "13"="P", "14"="Q", "15"="R", "16"="S", "17"="T", "18"="V", "19"="W", "20"="Y") | 51 "13"="P", "14"="Q", "15"="R", "16"="S", "17"="T", "18"="V", "19"="W", "20"="Y") |
52 aa_props2<-c(1="A") | |
53 | 52 |
54 Positionm7<-sapply(Positionm7, function (x) aa_props2[x]) | 53 Positionm7<-sapply(Positionm7, function (x) aa_props2[x]) |
55 Positionm6<-sapply(Positionm6, function (x) aa_props2[x]) | 54 Positionm6<-sapply(Positionm6, function (x) aa_props2[x]) |
56 Positionm5<-sapply(Positionm5, function (x) aa_props2[x]) | 55 Positionm5<-sapply(Positionm5, function (x) aa_props2[x]) |
57 Positionm4<-sapply(Positionm4, function (x) aa_props2[x]) | 56 Positionm4<-sapply(Positionm4, function (x) aa_props2[x]) |
645 PeptidesWithRanks<-cbind.data.frame(FullMotifs,GeneratedPeptides,Scores,ThresholdValues) | 644 PeptidesWithRanks<-cbind.data.frame(FullMotifs,GeneratedPeptides,Scores,ThresholdValues) |
646 PeptidesWithRanks<-cbind.data.frame(PeptidesWithRanks,AllActive,AblActive,ArgActive,BtkActive,CskActive,FynActive,HckActive,JAk2Active,LckActive,LynActive,Pyk2Active,SrcActive,SykActive,YesActive) | 645 PeptidesWithRanks<-cbind.data.frame(PeptidesWithRanks,AllActive,AblActive,ArgActive,BtkActive,CskActive,FynActive,HckActive,JAk2Active,LckActive,LynActive,Pyk2Active,SrcActive,SykActive,YesActive) |
647 RanksPeptides<-PeptidesWithRanks[order(PeptidesWithRanks$AllActive,decreasing = FALSE),] | 646 RanksPeptides<-PeptidesWithRanks[order(PeptidesWithRanks$AllActive,decreasing = FALSE),] |
648 # PepRankHead<-c(1:9,"Sequence","RPMS","PMS") | 647 # PepRankHead<-c(1:9,"Sequence","RPMS","PMS") |
649 # RanksPeptides<-rbind.data.frame(PepRankHead,PeptidesWithRanks) | 648 # RanksPeptides<-rbind.data.frame(PepRankHead,PeptidesWithRanks) |
650 head(RanksPeptides) | 649 #head(RanksPeptides) |
651 | 650 |
652 | 651 |
653 #now I have to score the negative sequences... for some reason | 652 #now I have to score the negative sequences... for some reason |
654 #write up how we transfect with lipofectamine | 653 #write up how we transfect with lipofectamine |
655 #3,4,5 questions | 654 #3,4,5 questions |
656 | 655 |
657 #PAUSED EHRE AT 4:50, HOPING THAT FIXING MINERVOTHING SO THAT LEFT SPACES WORKS FIXES A THING. OTHERWISE | 656 #PAUSED EHRE AT 4:50, HOPING THAT FIXING MINERVOTHING SO THAT LEFT SPACES WORKS FIXES A THING. OTHERWISE |
658 #I FUCKED WITH THE MCC TABLE AND NEED TO FINISH IT | 657 #I FUCKED WITH THE MCC TABLE AND NEED TO FINISH IT |
659 | 658 |
660 ThisKinBlanks<-rep(1,times=17) | 659 ThisKinBlanks<-rep(1,times=17) |
661 ThisKinTable<-rbind(ThisKinTable,ThisKinBlanks) | 660 #indx <- sapply(breast, is.factor) |
661 #ThisKinTable[indx] <- lapply(ThisKinTable[indx], function(x) as.character(x)) | |
662 ThisKinTable$SetOfAAs<-as.character(ThisKinTable$SetOfAAs) | |
663 | |
664 #ThisKinTest<-rbind.data.frame(ThisKinTable,ThisKinBlanks) | |
665 ThisKinTable<-rbind.data.frame(ThisKinTable,ThisKinBlanks) | |
662 | 666 |
663 NegativeScores<-rep(NA,times=nrow(NegativeSubstrateList)) | 667 NegativeScores<-rep(NA,times=nrow(NegativeSubstrateList)) |
664 NegativeWeirdScores<-rep(NA,times=nrow(NegativeSubstrateList)) | 668 NegativeWeirdScores<-rep(NA,times=nrow(NegativeSubstrateList)) |
665 for (v in 1:nrow(NegativeSubstrateList)) { | 669 for (v in 1:nrow(NegativeSubstrateList)) { |
666 motif<-NegativeSubstrateList[v,2] | 670 motif<-NegativeSubstrateList[v,2] |
772 # write.xlsx(NegativeWithScores,file = FILENAME, sheetName = "Negative Sequences Scored",col.names = TRUE,row.names = FALSE,append = TRUE) | 776 # write.xlsx(NegativeWithScores,file = FILENAME, sheetName = "Negative Sequences Scored",col.names = TRUE,row.names = FALSE,append = TRUE) |
773 # write.xlsx(Characterization,file = FILENAME,sheetName = "Characterization Table",col.names = TRUE,row.names = FALSE,append = TRUE) | 777 # write.xlsx(Characterization,file = FILENAME,sheetName = "Characterization Table",col.names = TRUE,row.names = FALSE,append = TRUE) |
774 # write.xlsx(RanksPeptides,file = FILENAME,sheetName = "Ranked Generated Peptides",col.names = FALSE,row.names = FALSE,append = TRUE) | 778 # write.xlsx(RanksPeptides,file = FILENAME,sheetName = "Ranked Generated Peptides",col.names = FALSE,row.names = FALSE,append = TRUE) |
775 # write.xlsx(positivewithscores,file = FILENAME, sheetName = "Positive Sequences Scored",col.names = FALSE,row.names = FALSE,append = TRUE) | 779 # write.xlsx(positivewithscores,file = FILENAME, sheetName = "Positive Sequences Scored",col.names = FALSE,row.names = FALSE,append = TRUE) |
776 write.table(x=c("Characterzation Table"),file = FILENAME2, col.names = FALSE,row.names = FALSE, append = TRUE,sep = ",") | 780 write.table(x=c("Characterzation Table"),file = FILENAME2, col.names = FALSE,row.names = FALSE, append = TRUE,sep = ",") |
777 write.table(Characterization,file = FILENAME2, col.names = TRUE,row.names = FALSE, append = TRUE,sep = ",") | 781 header<-colnames(Characterization) |
778 | 782 Characterization<-rbind.data.frame(header,Characterization) |
779 | 783 write.table(Characterization,file = FILENAME2, col.names = FALSE,row.names = FALSE, append = TRUE,sep = ",") |
780 write.table(RanksPeptides,file = FILENAME3,append = TRUE,row.names = FALSE,col.names = TRUE,sep = ",") | 784 |
781 | 785 # header<-colnames(RanksPeptides) |
782 | 786 # RanksPeptides<-rbind.data.frame(header,RanksPeptides) |
787 write.table(RanksPeptides,file = FILENAME3,append = FALSE,row.names = FALSE,col.names = TRUE,sep = ",") | |
788 | |
789 | |
790 |