Previous changeset 3:dff99bed3f56 (2019-04-19) Next changeset 5:f375051b0fcd (2019-04-19) |
Commit message:
Uploaded |
modified:
all stuff/differenceFinder.xml |
added:
all stuff/Commonality and Difference finderMADE 7 TO 7 1-15-2019.R all stuff/Commonality and Difference finderMADE 7 TO 7.R all stuff/Difference finderMADE 7 TO 7 1-15-2019.R all stuff/Difference finderMADE 7 TO 7 fastversion 2-14-2019.R all stuff/Difference finderMADE 7 TO 7 fastversion.R all stuff/difference finder for 2 overlaps proper names 7-7_1-15-2019.R |
b |
diff -r dff99bed3f56 -r 74ada21ceb70 all stuff/Commonality and Difference finderMADE 7 TO 7 1-15-2019.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/all stuff/Commonality and Difference finderMADE 7 TO 7 1-15-2019.R Fri Apr 19 14:00:46 2019 -0400 |
[ |
b'@@ -0,0 +1,1281 @@\n+#I should make an SOP for this. Problems we encountered: no x in the xY motif, and the kilodemon\r\n+#the output files have both Y and xY, they shouldn\'t why is that happening? make it not happen\r\n+#make sure that accession numbers stay locked to each motif, somehow\r\n+#output should look just like the KALIP input\r\n+\r\n+#ff you want ONLY FULL MOTIFS, put "YES" here, please use all caps\r\n+FullMotifsOnly_questionmark<-"NO"\r\n+#If you want ONLY TRUNCATED MOTIFS, put "YES" here, please use all caps\r\n+TruncatedMotifsOnly_questionmark<-"NO"\r\n+#if you want to find the overlap, put a "YES" here (all caps), if you want to find the non-overlap, put "NO" (all caps)\r\n+Are_You_Looking_For_Commonality<-"NO"\r\n+\r\n+\r\n+#put the names of your input files here\r\n+FirstSubstrateSet<- read.csv("Galaxy63-BTK_PLUS-R1_Substrates.csv", stringsAsFactors=FALSE)\r\n+Firstsubbackfreq<- read.csv("Galaxy64-BTK_PLUS-R1_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+SecondSubstrateSet<- read.csv("Galaxy65-BTK_PLUS_R2_Substrates.csv", stringsAsFactors=FALSE)\r\n+Secondsubbackfreq<- read.csv("Galaxy66-BTK_PLUS_R2_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+ThirdSubstrateSet<- read.csv("Galaxy69-BTK_PLUS_R3_Substrates.csv", stringsAsFactors=FALSE)\r\n+Thirdsubbackfreq<- read.csv("Galaxy70-BTK_PLUS_R3_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+#then put the names of your output files here\r\n+Shared_motifs_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-substrates.csv"\r\n+Shared_subbackfreq_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-SubBackFreq.csv"\r\n+\r\n+# Shared_motifs_table<-"Shared motifs 7-27-17.csv"\r\n+# Shared_subbackfreq_table<-"SubstrateBackgrounFrequency-for-shared-motifs 4 7-27-17.csv"\r\n+\r\n+First_unshared_motifs_table<-"R1 substrates.csv"\r\n+First_unshared_subbackfreq<-"R1 SBF.csv"\r\n+\r\n+Second_unshared_motifs_table<-"R2 subs.csv"\r\n+Second_unshared_subbackfreq<-"R2 SBf.csv"\r\n+\r\n+Third_unshared_motifs_table<-"R3 subs.csv"\r\n+Third_unshared_subbackfreq<-"R3 SBF.csv"\r\n+\r\n+#final note, this code is going to be unworkable if you want to make a Venn diagram of more than 3 circles. I think I\'ll poke around\r\n+#other languages to see if any of them can do it.\r\n+####################################################################################################################################\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+FirstxY<-rep("xY",times=nrow(FirstSubstrateSet))\r\n+FirstSubstrateSet[,11]<-FirstxY\r\n+\r\n+SecondxY<-rep("xY",times=nrow(SecondSubstrateSet))\r\n+SecondSubstrateSet[,11]<-SecondxY\r\n+\r\n+ThirdxY<-rep("xY",times=nrow(ThirdSubstrateSet))\r\n+ThirdSubstrateSet[,11]<-ThirdxY\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+# better version of this code written in C: what happens when two kinases share a motif, but they found that motif in two \r\n+# separate proteins thus two separate accession numbers?\r\n+# It should actually output the shared motif and BOTH accession numbers. Right now it does not, it only maps out the second\r\n+# accession number. So that needs to be fixed BUT you need to keep the commonality between a motif and its accession number\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+\r\n+#Create the motif sets, deciding w'..b'ly after I\'ve unduped them\r\n+# D835YnondupeAccessionNumbers<-D835YnondupeAccessionNumbers[!duplicated(D835YnondupeAccessionNumbers)]\r\n+# \r\n+# columnalheader<-c(rep(NA,35))\r\n+# D835YFinalMatrix<-matrix(data =columnalheader,nrow = 1)\r\n+# \r\n+# for (k in 1:length(D835YnondupeAccessionNumbers)) {\r\n+# #I don\'t remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is\r\n+# #destroyed immediately after use\r\n+# for (m in 1:ncol(Secondsubbackfreq)) {\r\n+# AN <- as.character(Secondsubbackfreq[1, m])\r\n+# if (grepl(pattern = AN,\r\n+# x = D835YnondupeAccessionNumbers[k],\r\n+# fixed = TRUE) == TRUE) {\r\n+# outputmatrix <- as.character(Secondsubbackfreq[, m])\r\n+# outputmatrix <- matrix(outputmatrix, nrow = 1)\r\n+# #with that accession number, find a match in the subbackfreq file and save it here\r\n+# D835YFinalMatrix<-rbind(D835YFinalMatrix,outputmatrix)\r\n+# }\r\n+# }\r\n+# }\r\n+# \r\n+# \r\n+# \r\n+# # FinalFTLmotifs<-FTLwtmotifsFINAL[!duplicated(FTLwtmotifsFINAL)]\r\n+# # FinalFTLAccessionNumbers<-FTLnondupeAccessionNumbers[!duplicated(FTLnondupeAccessionNumbers)]\r\n+# # necessaryNAs<-rep(NA,times=(length(FinalFTLmotifs)-length(FinalFTLAccessionNumbers)))\r\n+# # FinalFTLAccessionNumbers<-c(FinalFTLAccessionNumbers,necessaryNAs)\r\n+# # TRUEFTLoutputmatrix<-cbind(FinalFTLmotifs,FinalFTLAccessionNumbers)\r\n+# # TRUEFTLoutputmatrix\r\n+# \r\n+# write.table(x=FTLwtmotifsFINAL,\r\n+# file=First_unshared_motifs_table,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))\r\n+# columnalheader<-matrix(columnalheader,nrow = 1)\r\n+# write.table(x=columnalheader,\r\n+# file=First_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# write.table(x=FTLFinalMatrix,\r\n+# file=First_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# write.table(x=D835YmotifsFINAL,\r\n+# file=Second_unshared_motifs_table,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))\r\n+# columnalheader<-matrix(columnalheader,nrow = 1)\r\n+# write.table(x=columnalheader,\r\n+# file=Second_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# write.table(x=D835YFinalMatrix,\r\n+# file=Second_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# write.table(x=ITDmotifsFINAL,\r\n+# file=Third_unshared_motifs_table,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))\r\n+# columnalheader<-matrix(columnalheader,nrow = 1)\r\n+# write.table(x=columnalheader,\r\n+# file=Third_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# write.table(x=ITDFinalMatrix,\r\n+# file=Third_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# }\r\n' |
b |
diff -r dff99bed3f56 -r 74ada21ceb70 all stuff/Commonality and Difference finderMADE 7 TO 7.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/all stuff/Commonality and Difference finderMADE 7 TO 7.R Fri Apr 19 14:00:46 2019 -0400 |
[ |
b'@@ -0,0 +1,1281 @@\n+#I should make an SOP for this. Problems we encountered: no x in the xY motif, and the kilodemon\r\n+#the output files have both Y and xY, they shouldn\'t why is that happening? make it not happen\r\n+#make sure that accession numbers stay locked to each motif, somehow\r\n+#output should look just like the KALIP input\r\n+\r\n+#ff you want ONLY FULL MOTIFS, put "YES" here, please use all caps\r\n+FullMotifsOnly_questionmark<-"NO"\r\n+#If you want ONLY TRUNCATED MOTIFS, put "YES" here, please use all caps\r\n+TruncatedMotifsOnly_questionmark<-"NO"\r\n+#if you want to find the overlap, put a "YES" here (all caps), if you want to find the non-overlap, put "NO" (all caps)\r\n+Are_You_Looking_For_Commonality<-"YES"\r\n+\r\n+\r\n+#put the names of your input files here\r\n+FirstSubstrateSet<- read.csv("Galaxy63-BTK_PLUS-R1_Substrates.csv", stringsAsFactors=FALSE)\r\n+Firstsubbackfreq<- read.csv("Galaxy64-BTK_PLUS-R1_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+SecondSubstrateSet<- read.csv("Galaxy65-BTK_PLUS_R2_Substrates.csv", stringsAsFactors=FALSE)\r\n+Secondsubbackfreq<- read.csv("Galaxy66-BTK_PLUS_R2_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+ThirdSubstrateSet<- read.csv("Galaxy69-BTK_PLUS_R3_Substrates.csv", stringsAsFactors=FALSE)\r\n+Thirdsubbackfreq<- read.csv("Galaxy70-BTK_PLUS_R3_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+#then put the names of your output files here\r\n+Shared_motifs_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-substrates.csv"\r\n+Shared_subbackfreq_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-SubBackFreq.csv"\r\n+\r\n+# Shared_motifs_table<-"Shared motifs 7-27-17.csv"\r\n+# Shared_subbackfreq_table<-"SubstrateBackgrounFrequency-for-shared-motifs 4 7-27-17.csv"\r\n+\r\n+First_unshared_motifs_table<-"R1 substrates.csv"\r\n+First_unshared_subbackfreq<-"R1 SBF.csv"\r\n+\r\n+Second_unshared_motifs_table<-"R2 subs.csv"\r\n+Second_unshared_subbackfreq<-"R2 SBf.csv"\r\n+\r\n+Third_unshared_motifs_table<-"R3 subs.csv"\r\n+Third_unshared_subbackfreq<-"R3 SBF.csv"\r\n+\r\n+#final note, this code is going to be unworkable if you want to make a Venn diagram of more than 3 circles. I think I\'ll poke around\r\n+#other languages to see if any of them can do it.\r\n+####################################################################################################################################\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+FirstxY<-rep("xY",times=nrow(FirstSubstrateSet))\r\n+FirstSubstrateSet[,11]<-FirstxY\r\n+\r\n+SecondxY<-rep("xY",times=nrow(SecondSubstrateSet))\r\n+SecondSubstrateSet[,11]<-SecondxY\r\n+\r\n+ThirdxY<-rep("xY",times=nrow(ThirdSubstrateSet))\r\n+ThirdSubstrateSet[,11]<-ThirdxY\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+# better version of this code written in C: what happens when two kinases share a motif, but they found that motif in two \r\n+# separate proteins thus two separate accession numbers?\r\n+# It should actually output the shared motif and BOTH accession numbers. Right now it does not, it only maps out the second\r\n+# accession number. So that needs to be fixed BUT you need to keep the commonality between a motif and its accession number\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+\r\n+#Create the motif sets, deciding '..b'ly after I\'ve unduped them\r\n+# D835YnondupeAccessionNumbers<-D835YnondupeAccessionNumbers[!duplicated(D835YnondupeAccessionNumbers)]\r\n+# \r\n+# columnalheader<-c(rep(NA,35))\r\n+# D835YFinalMatrix<-matrix(data =columnalheader,nrow = 1)\r\n+# \r\n+# for (k in 1:length(D835YnondupeAccessionNumbers)) {\r\n+# #I don\'t remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is\r\n+# #destroyed immediately after use\r\n+# for (m in 1:ncol(Secondsubbackfreq)) {\r\n+# AN <- as.character(Secondsubbackfreq[1, m])\r\n+# if (grepl(pattern = AN,\r\n+# x = D835YnondupeAccessionNumbers[k],\r\n+# fixed = TRUE) == TRUE) {\r\n+# outputmatrix <- as.character(Secondsubbackfreq[, m])\r\n+# outputmatrix <- matrix(outputmatrix, nrow = 1)\r\n+# #with that accession number, find a match in the subbackfreq file and save it here\r\n+# D835YFinalMatrix<-rbind(D835YFinalMatrix,outputmatrix)\r\n+# }\r\n+# }\r\n+# }\r\n+# \r\n+# \r\n+# \r\n+# # FinalFTLmotifs<-FTLwtmotifsFINAL[!duplicated(FTLwtmotifsFINAL)]\r\n+# # FinalFTLAccessionNumbers<-FTLnondupeAccessionNumbers[!duplicated(FTLnondupeAccessionNumbers)]\r\n+# # necessaryNAs<-rep(NA,times=(length(FinalFTLmotifs)-length(FinalFTLAccessionNumbers)))\r\n+# # FinalFTLAccessionNumbers<-c(FinalFTLAccessionNumbers,necessaryNAs)\r\n+# # TRUEFTLoutputmatrix<-cbind(FinalFTLmotifs,FinalFTLAccessionNumbers)\r\n+# # TRUEFTLoutputmatrix\r\n+# \r\n+# write.table(x=FTLwtmotifsFINAL,\r\n+# file=First_unshared_motifs_table,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))\r\n+# columnalheader<-matrix(columnalheader,nrow = 1)\r\n+# write.table(x=columnalheader,\r\n+# file=First_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# write.table(x=FTLFinalMatrix,\r\n+# file=First_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# write.table(x=D835YmotifsFINAL,\r\n+# file=Second_unshared_motifs_table,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))\r\n+# columnalheader<-matrix(columnalheader,nrow = 1)\r\n+# write.table(x=columnalheader,\r\n+# file=Second_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# write.table(x=D835YFinalMatrix,\r\n+# file=Second_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# write.table(x=ITDmotifsFINAL,\r\n+# file=Third_unshared_motifs_table,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# columnalheader<-c("Accession Numbers",as.character(Thirdsubbackfreq[1:35,1]))\r\n+# columnalheader<-matrix(columnalheader,nrow = 1)\r\n+# write.table(x=columnalheader,\r\n+# file=Third_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# write.table(x=ITDFinalMatrix,\r\n+# file=Third_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# \r\n+# }\r\n' |
b |
diff -r dff99bed3f56 -r 74ada21ceb70 all stuff/Difference finderMADE 7 TO 7 1-15-2019.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/all stuff/Difference finderMADE 7 TO 7 1-15-2019.R Fri Apr 19 14:00:46 2019 -0400 |
[ |
b'@@ -0,0 +1,351 @@\n+#I should make an SOP for this. Problems we encountered: no x in the xY motif, and the kilodemon\r\n+#the output files have both Y and xY, they shouldn\'t why is that happening? make it not happen\r\n+#make sure that accession numbers stay locked to each motif, somehow\r\n+#output should look just like the KALIP input\r\n+\r\n+#ff you want ONLY FULL MOTIFS, put "YES" here, please use all caps\r\n+FullMotifsOnly_questionmark<-"NO"\r\n+#If you want ONLY TRUNCATED MOTIFS, put "YES" here, please use all caps\r\n+TruncatedMotifsOnly_questionmark<-"NO"\r\n+#if you want to find the overlap, put a "YES" here (all caps), if you want to find the non-overlap, put "NO" (all caps)\r\n+Are_You_Looking_For_Commonality<-"NO"\r\n+\r\n+\r\n+#put the names of your input files here\r\n+FirstSubstrateSet<- read.csv("S1.csv", stringsAsFactors=FALSE)\r\n+Firstsubbackfreq<- read.csv("SBF1.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+SecondSubstrateSet<- read.csv("S2.csv", stringsAsFactors=FALSE)\r\n+Secondsubbackfreq<- read.csv("SBF2.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+# ThirdSubstrateSet<- read.csv("Galaxy69-BTK_PLUS_R3_Substrates.csv", stringsAsFactors=FALSE)\r\n+# Thirdsubbackfreq<- read.csv("Galaxy70-BTK_PLUS_R3_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+#then put the names of your output files here\r\n+# Shared_motifs_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-substrates.csv"\r\n+# Shared_subbackfreq_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-SubBackFreq.csv"\r\n+\r\n+# Shared_motifs_table<-"Shared motifs 7-27-17.csv"\r\n+# Shared_subbackfreq_table<-"SubstrateBackgrounFrequency-for-shared-motifs 4 7-27-17.csv"\r\n+\r\n+First_unshared_motifs_table<-"1RS.csv"\r\n+First_unshared_subbackfreq<-"1RSBF.csv"\r\n+\r\n+Second_unshared_motifs_table<-"2RS.csv"\r\n+Second_unshared_subbackfreq<-"2RSBF.csv"\r\n+\r\n+# Third_unshared_motifs_table<-"R3 subs.csv"\r\n+# Third_unshared_subbackfreq<-"R3 SBF.csv"\r\n+\r\n+#final note, this code is going to be unworkable if you want to make a Venn diagram of more than 3 circles. I think I\'ll poke around\r\n+#other languages to see if any of them can do it.\r\n+####################################################################################################################################\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+# grepl(pattern = "S", x=asdf, ignore.case = TRUE)\r\n+\r\n+FirstCentralLetters<-FirstSubstrateSet[,11]\r\n+SecondCentralLetters<-SecondSubstrateSet[,11]\r\n+\r\n+FirstEsses<-sapply(FirstCentralLetters, grepl, pattern="S", ignore.case=TRUE)\r\n+FirstTees<-sapply(FirstCentralLetters, grepl, pattern="T", ignore.case=TRUE)\r\n+FirstWys<-sapply(FirstCentralLetters, grepl, pattern="Y", ignore.case=TRUE)\r\n+\r\n+SecondEsses<-sapply(SecondCentralLetters, grepl, pattern="S", ignore.case=TRUE)\r\n+SecondTees<-sapply(SecondCentralLetters, grepl, pattern="T", ignore.case=TRUE)\r\n+SecondWys<-sapply(SecondCentralLetters, grepl, pattern="Y", ignore.case=TRUE)\r\n+\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstEsses,"xS")\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstTees,"xT")\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstWys,"xY")\r\n+\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondEsses,"xS")\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondTees,"xT")\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondWys,"xY")\r\n+\r\n+FirstCentralLetters->FirstSubstrateSet[,11]\r\n+SecondCentralLetters->SecondSubstrateSet[,11]\r\n+\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+# better version of this code written in C: what happens when two kinases share a motif, but they found that motif in two \r\n+# separate proteins thus two separate accession numbers?\r\n+# It should actually output the shared motif and BOTH accession numbers. Right now it does not, it only maps out the second\r\n+# '..b'es(FTLoutputmatrix2)<-NULL\r\n+ rownames(FTLoutputmatrix2)<-NULL\r\n+ colnames(FLTheader)<-NULL\r\n+ rownames(FLTheader)<-NULL\r\n+ \r\n+ \r\n+ FirstCentralLettersAGAIN<-FTLoutputmatrix2[,11]\r\n+ \r\n+ FirstEsses<-sapply(FirstCentralLettersAGAIN, grepl, pattern="S", ignore.case=TRUE)\r\n+ FirstTees<-sapply(FirstCentralLettersAGAIN, grepl, pattern="T", ignore.case=TRUE)\r\n+ FirstWys<-sapply(FirstCentralLettersAGAIN, grepl, pattern="Y", ignore.case=TRUE)\r\n+ \r\n+ FirstCentralLettersAGAIN<-replace(FirstCentralLettersAGAIN,FirstEsses,"xS")\r\n+ FirstCentralLettersAGAIN<-replace(FirstCentralLettersAGAIN,FirstTees,"xT")\r\n+ FirstCentralLettersAGAIN<-replace(FirstCentralLettersAGAIN,FirstWys,"xY")\r\n+ \r\n+ FirstCentralLettersAGAIN->FTLoutputmatrix2[,11]\r\n+ \r\n+ FTLoutputmatrix2<-rbind(FLTheader,FTLoutputmatrix2)\r\n+ \r\n+ write.table(x=FTLoutputmatrix2,\r\n+ file=First_unshared_motifs_table,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+ \r\n+ columnalheader<-c("Accession Numbers",as.character(Firstsubbackfreq[1:35,1]))\r\n+ columnalheader<-matrix(columnalheader,nrow = 1)\r\n+ write.table(x=columnalheader,\r\n+ file=First_unshared_subbackfreq,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+ \r\n+ write.table(x=FTLFinalMatrix,\r\n+ file=First_unshared_subbackfreq,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+ \r\n+ ############################################################################################################\r\n+ \r\n+ D835Youtputmatrix<-matrix(data=c(D835YmotifsFINAL,names(D835YmotifsFINAL)),ncol = 2)\r\n+ \r\n+ D835Yheader<-c("Substrate","Species","Reference","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","Phosphite")\r\n+ # D835Yheader<-unlist(D835Yheader)\r\n+ lefthandD835<-matrix(data = rep(NA,times=2*nrow(D835Youtputmatrix)),nrow=nrow(D835Youtputmatrix))\r\n+ righthandD835<-matrix(data = rep(NA,times=1*nrow(D835Youtputmatrix)),nrow=nrow(D835Youtputmatrix))\r\n+ D835Yaset<-D835Youtputmatrix[,2]\r\n+ D835meat<-sapply(D835Youtputmatrix[,1], strsplit, "")\r\n+ D835meat<-sapply(D835meat, unlist)\r\n+ colnames(D835meat)<-NULL\r\n+ D835meat<-t(D835meat)\r\n+ \r\n+ D835Youtputmatrix2<-cbind(lefthandD835,D835Yaset,D835meat,righthandD835)\r\n+ colnames(D835Youtputmatrix2)<-NULL\r\n+ rownames(D835Youtputmatrix2)<-NULL\r\n+ colnames(D835Yheader)<-NULL\r\n+ rownames(D835Yheader)<-NULL\r\n+ \r\n+ \r\n+ SecondCentralLettersAGAIN<-D835Youtputmatrix2[,11]\r\n+ \r\n+ SecondEsses<-sapply(SecondCentralLettersAGAIN, grepl, pattern="S", ignore.case=TRUE)\r\n+ SecondTees<-sapply(SecondCentralLettersAGAIN, grepl, pattern="T", ignore.case=TRUE)\r\n+ SecondWys<-sapply(SecondCentralLettersAGAIN, grepl, pattern="Y", ignore.case=TRUE)\r\n+ \r\n+ SecondCentralLettersAGAIN<-replace(SecondCentralLettersAGAIN,SecondEsses,"xS")\r\n+ SecondCentralLettersAGAIN<-replace(SecondCentralLettersAGAIN,SecondTees,"xT")\r\n+ SecondCentralLettersAGAIN<-replace(SecondCentralLettersAGAIN,SecondWys,"xY")\r\n+ \r\n+ SecondCentralLettersAGAIN->D835Youtputmatrix2[,11]\r\n+ \r\n+ D835Youtputmatrix2<-rbind(D835Yheader,D835Youtputmatrix2)\r\n+ \r\n+ write.table(x=D835Youtputmatrix2,\r\n+ file=Second_unshared_motifs_table,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+ \r\n+ columnalheader<-c("Accession Numbers",as.character(Firstsubbackfreq[1:35,1]))\r\n+ columnalheader<-matrix(columnalheader,nrow = 1)\r\n+ write.table(x=columnalheader,\r\n+ file=Second_unshared_subbackfreq,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+ \r\n+ write.table(x=D835YFinalMatrix,\r\n+ file=Second_unshared_subbackfreq,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+}\r\n+\r\n' |
b |
diff -r dff99bed3f56 -r 74ada21ceb70 all stuff/Difference finderMADE 7 TO 7 fastversion 2-14-2019.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/all stuff/Difference finderMADE 7 TO 7 fastversion 2-14-2019.R Fri Apr 19 14:00:46 2019 -0400 |
[ |
b'@@ -0,0 +1,453 @@\n+#I should make an SOP for this. Problems we encountered: no x in the xY motif, and the kilodemon\r\n+#the output files have both Y and xY, they shouldn\'t why is that happening? make it not happen\r\n+#make sure that accession numbers stay locked to each motif, somehow\r\n+#output should look just like the KALIP input\r\n+#S2 is negatives\r\n+#ff you want ONLY FULL MOTIFS, put "YES" here, please use all caps\r\n+FullMotifsOnly_questionmark<-"NO"\r\n+#If you want ONLY TRUNCATED MOTIFS, put "YES" here, please use all caps\r\n+TruncatedMotifsOnly_questionmark<-"NO"\r\n+#if you want to find the overlap, put a "YES" here (all caps), if you want to find the non-overlap, put "NO" (all caps)\r\n+Are_You_Looking_For_Commonality<-"NO"\r\n+\r\n+\r\n+#put the names of your input files here\r\n+FirstSubstrateSet<- read.csv("Substrates 1A TiO2 and FeNTA no duplicates.csv", stringsAsFactors=FALSE)\r\n+Firstsubbackfreq<- read.csv("SBF 1A TiO2 and FeNTA no duplicates.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+SecondSubstrateSet<- read.csv("Substrates 1B TiO2 and FeNTA no duplicates.csv", stringsAsFactors=FALSE)\r\n+Secondsubbackfreq<- read.csv("SBF 1B TiO2 and FeNTA no duplicates.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+# ThirdSubstrateSet<- read.csv("Galaxy69-BTK_PLUS_R3_Substrates.csv", stringsAsFactors=FALSE)\r\n+# Thirdsubbackfreq<- read.csv("Galaxy70-BTK_PLUS_R3_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+#then put the names of your output files here\r\n+# Shared_motifs_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-substrates.csv"\r\n+# Shared_subbackfreq_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-SubBackFreq.csv"\r\n+\r\n+# Shared_motifs_table<-"Shared motifs 7-27-17.csv"\r\n+# Shared_subbackfreq_table<-"SubstrateBackgrounFrequency-for-shared-motifs 4 7-27-17.csv"\r\n+\r\n+First_unshared_motifs_table<-"pka_minus_wo-plus_wo_vector_subs.csv"\r\n+First_unshared_subbackfreq<-"pka_minus_wo-plus_wo_vector_sbf.csv"\r\n+\r\n+Second_unshared_motifs_table<-"pka_plus_wo-minus_wo_vector_subs.csv"\r\n+Second_unshared_subbackfreq<-"pka_plus_wo-minus_wo_vector_sbf.csv"\r\n+\r\n+# Third_unshared_motifs_table<-"R3 subs.csv"\r\n+# Third_unshared_subbackfreq<-"R3 SBF.csv"\r\n+\r\n+#final note, this code is going to be unworkable if you want to make a Venn diagram of more than 3 circles. I think I\'ll poke around\r\n+#other languages to see if any of them can do it.\r\n+####################################################################################################################################\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+# grepl(pattern = "S", x=asdf, ignore.case = TRUE)\r\n+\r\n+FirstCentralLetters<-FirstSubstrateSet[,11]\r\n+SecondCentralLetters<-SecondSubstrateSet[,11]\r\n+\r\n+FirstEsses<-sapply(FirstCentralLetters, grepl, pattern="S", ignore.case=TRUE)\r\n+FirstTees<-sapply(FirstCentralLetters, grepl, pattern="T", ignore.case=TRUE)\r\n+FirstWys<-sapply(FirstCentralLetters, grepl, pattern="Y", ignore.case=TRUE)\r\n+\r\n+SecondEsses<-sapply(SecondCentralLetters, grepl, pattern="S", ignore.case=TRUE)\r\n+SecondTees<-sapply(SecondCentralLetters, grepl, pattern="T", ignore.case=TRUE)\r\n+SecondWys<-sapply(SecondCentralLetters, grepl, pattern="Y", ignore.case=TRUE)\r\n+\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstEsses,"xS")\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstTees,"xT")\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstWys,"xY")\r\n+\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondEsses,"xS")\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondTees,"xT")\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondWys,"xY")\r\n+\r\n+FirstCentralLetters->FirstSubstrateSet[,11]\r\n+SecondCentralLetters->SecondSubstrateSet[,11]\r\n+\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+# better version of this code written in C: w'..b'otif, which is the Y and +/- 4 amino acids, including truncation\r\n+# motif<-motif[!motif %in% "x"]\r\n+# motif<-paste(motif, sep="", collapse="")\r\n+# FTLwtletters<-motif\r\n+# FTLwtmotifs[i,1]<-FTLwtletters\r\n+# FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]\r\n+# \r\n+# \r\n+# }\r\n+# \r\n+# }\r\n+\r\n+\r\n+\r\n+# for (i in 1:nrow(SecondSubstrateSet)){\r\n+# D835letters<-SecondSubstrateSet[i,4:18]\r\n+# D835letters<-D835letters[D835letters !="XXXXX"]\r\n+# D835letters<-paste(D835letters, sep="", collapse="")\r\n+# leftspaces<-c()\r\n+# rightspaces<-c()\r\n+# \r\n+# YYYmotif <- unlist(strsplit(D835letters, split = ""))\r\n+# YYYposition <- match(x = "x", table = YYYmotif)\r\n+# #position itself tells me how much is to the left of that X by what it\'s number is. x at position 4 tells me that there are\r\n+# #just 3 letters to the left of x\r\n+# \r\n+# YYYLettersToTheLeft <- YYYposition - 1\r\n+# #how many letters to the right SHOULD just be length(motif)-position-1 if it\'s 5 long and x is at 3 then Y is at 4 and there is\r\n+# #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1\r\n+# YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1\r\n+# #then sanity check, we\'re currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the\r\n+# #variable the user puts in is\r\n+# if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {\r\n+# leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))\r\n+# rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))\r\n+# #add blank spaces if the motif has less than 4 letters to the left/right\r\n+# motif<-c(leftspaces,YYYmotif,rightspaces)\r\n+# #save that motif, which is the Y and +/- 4 amino acids, including truncation\r\n+# motif<-motif[!motif %in% "x"]\r\n+# motif<-paste(motif, sep="", collapse="")\r\n+# D835letters<-motif\r\n+# D835Ymotifs[i,1]<-D835letters\r\n+# D835YAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]\r\n+# }\r\n+# \r\n+# if(YYYLettersToTheLeft>6 && YYYLettersToTheRight>6){\r\n+# motif<-YYYmotif\r\n+# #add blank spaces if the motif has less than 4 letters to the left/right\r\n+# motif<-c(leftspaces,YYYmotif,rightspaces)\r\n+# #save that motif, which is the Y and +/- 4 amino acids, including truncation\r\n+# motif<-motif[!motif %in% "x"]\r\n+# motif<-paste(motif, sep="", collapse="")\r\n+# D835letters<-motif\r\n+# D835Ymotifs[i,1]<-D835letters\r\n+# D835YAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]\r\n+# }\r\n+# }\r\n+\r\n+# for (k in 1:length(FTLwtmotifsFINAL)) {\r\n+# AN<-00000\r\n+# #I don\'t remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is\r\n+# #destroyed immediately after use\r\n+# for (m in 1:ncol(Firstsubbackfreq)) {\r\n+# AN <- as.character(Firstsubbackfreq[1, m])\r\n+# if (grepl(pattern = AN,\r\n+# x = names(FTLwtmotifsFINAL[k]),\r\n+# fixed = TRUE) == TRUE) {\r\n+# outputmatrix <- as.character(Firstsubbackfreq[, m])\r\n+# outputmatrix <- matrix(outputmatrix, nrow = 1)\r\n+# #with that accession number, find a match in the subbackfreq file and save it here\r\n+# FTLFinalMatrix<-rbind(FTLFinalMatrix,outputmatrix)\r\n+# }\r\n+# }\r\n+# }\r\n+# for (k in 1:length(D835YmotifsFINAL)) {\r\n+# #I don\'t remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is\r\n+# #destroyed immediately after use\r\n+# for (m in 1:ncol(Secondsubbackfreq)) {\r\n+# AN <- as.character(Secondsubbackfreq[1, m])\r\n+# if (grepl(pattern = AN,\r\n+# x = names(D835YmotifsFINAL[k]),\r\n+# fixed = TRUE) == TRUE) {\r\n+# outputmatrix <- as.character(Secondsubbackfreq[, m])\r\n+# outputmatrix <- matrix(outputmatrix, nrow = 1)\r\n+# #with that accession number, find a match in the subbackfreq file and save it here\r\n+# D835YFinalMatrix<-rbind(D835YFinalMatrix,outputmatrix)\r\n+# }\r\n+# }\r\n+# }\n\\ No newline at end of file\n' |
b |
diff -r dff99bed3f56 -r 74ada21ceb70 all stuff/Difference finderMADE 7 TO 7 fastversion.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/all stuff/Difference finderMADE 7 TO 7 fastversion.R Fri Apr 19 14:00:46 2019 -0400 |
[ |
b'@@ -0,0 +1,451 @@\n+#I should make an SOP for this. Problems we encountered: no x in the xY motif, and the kilodemon\r\n+#the output files have both Y and xY, they shouldn\'t why is that happening? make it not happen\r\n+#make sure that accession numbers stay locked to each motif, somehow\r\n+#output should look just like the KALIP input\r\n+#S2 is negatives\r\n+#ff you want ONLY FULL MOTIFS, put "YES" here, please use all caps\r\n+FullMotifsOnly_questionmark<-"NO"\r\n+#If you want ONLY TRUNCATED MOTIFS, put "YES" here, please use all caps\r\n+TruncatedMotifsOnly_questionmark<-"NO"\r\n+#if you want to find the overlap, put a "YES" here (all caps), if you want to find the non-overlap, put "NO" (all caps)\r\n+Are_You_Looking_For_Commonality<-"NO"\r\n+\r\n+\r\n+#put the names of your input files here\r\n+FirstSubstrateSet<- read.csv("pka_minus_wo_vector_subs.csv", stringsAsFactors=FALSE)\r\n+Firstsubbackfreq<- read.csv("pka_minus_wo_vector_sbf.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+SecondSubstrateSet<- read.csv("pka_plus_wo_vector_substrates.csv", stringsAsFactors=FALSE)\r\n+Secondsubbackfreq<- read.csv("pka_plus_wo_vector_sbf.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+# ThirdSubstrateSet<- read.csv("Galaxy69-BTK_PLUS_R3_Substrates.csv", stringsAsFactors=FALSE)\r\n+# Thirdsubbackfreq<- read.csv("Galaxy70-BTK_PLUS_R3_SubstrateBackgroundFrequency.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+#then put the names of your output files here\r\n+# Shared_motifs_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-substrates.csv"\r\n+# Shared_subbackfreq_table<-"180719_GALAXY-BTK-plus-rep-OVLP-7to7-SubBackFreq.csv"\r\n+\r\n+# Shared_motifs_table<-"Shared motifs 7-27-17.csv"\r\n+# Shared_subbackfreq_table<-"SubstrateBackgrounFrequency-for-shared-motifs 4 7-27-17.csv"\r\n+\r\n+First_unshared_motifs_table<-"pka_minus_wo-plus_wo_vector_subs.csv"\r\n+First_unshared_subbackfreq<-"pka_minus_wo-plus_wo_vector_sbf.csv"\r\n+\r\n+Second_unshared_motifs_table<-"pka_plus_wo-minus_wo_vector_subs.csv"\r\n+Second_unshared_subbackfreq<-"pka_plus_wo-minus_wo_vector_sbf.csv"\r\n+\r\n+# Third_unshared_motifs_table<-"R3 subs.csv"\r\n+# Third_unshared_subbackfreq<-"R3 SBF.csv"\r\n+\r\n+#final note, this code is going to be unworkable if you want to make a Venn diagram of more than 3 circles. I think I\'ll poke around\r\n+#other languages to see if any of them can do it.\r\n+####################################################################################################################################\r\n+\r\n+\r\n+\r\n+\r\n+\r\n+# grepl(pattern = "S", x=asdf, ignore.case = TRUE)\r\n+\r\n+FirstCentralLetters<-FirstSubstrateSet[,11]\r\n+SecondCentralLetters<-SecondSubstrateSet[,11]\r\n+\r\n+FirstEsses<-sapply(FirstCentralLetters, grepl, pattern="S", ignore.case=TRUE)\r\n+FirstTees<-sapply(FirstCentralLetters, grepl, pattern="T", ignore.case=TRUE)\r\n+FirstWys<-sapply(FirstCentralLetters, grepl, pattern="Y", ignore.case=TRUE)\r\n+\r\n+SecondEsses<-sapply(SecondCentralLetters, grepl, pattern="S", ignore.case=TRUE)\r\n+SecondTees<-sapply(SecondCentralLetters, grepl, pattern="T", ignore.case=TRUE)\r\n+SecondWys<-sapply(SecondCentralLetters, grepl, pattern="Y", ignore.case=TRUE)\r\n+\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstEsses,"xS")\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstTees,"xT")\r\n+FirstCentralLetters<-replace(FirstCentralLetters,FirstWys,"xY")\r\n+\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondEsses,"xS")\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondTees,"xT")\r\n+SecondCentralLetters<-replace(SecondCentralLetters,SecondWys,"xY")\r\n+\r\n+FirstCentralLetters->FirstSubstrateSet[,11]\r\n+SecondCentralLetters->SecondSubstrateSet[,11]\r\n+\r\n+####################################################################################################################################\r\n+####################################################################################################################################\r\n+# better version of this code written in C: what happens when two kinases share a motif, but they fou'..b'otif, which is the Y and +/- 4 amino acids, including truncation\r\n+# motif<-motif[!motif %in% "x"]\r\n+# motif<-paste(motif, sep="", collapse="")\r\n+# FTLwtletters<-motif\r\n+# FTLwtmotifs[i,1]<-FTLwtletters\r\n+# FTLwtAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]\r\n+# \r\n+# \r\n+# }\r\n+# \r\n+# }\r\n+\r\n+\r\n+\r\n+# for (i in 1:nrow(SecondSubstrateSet)){\r\n+# D835letters<-SecondSubstrateSet[i,4:18]\r\n+# D835letters<-D835letters[D835letters !="XXXXX"]\r\n+# D835letters<-paste(D835letters, sep="", collapse="")\r\n+# leftspaces<-c()\r\n+# rightspaces<-c()\r\n+# \r\n+# YYYmotif <- unlist(strsplit(D835letters, split = ""))\r\n+# YYYposition <- match(x = "x", table = YYYmotif)\r\n+# #position itself tells me how much is to the left of that X by what it\'s number is. x at position 4 tells me that there are\r\n+# #just 3 letters to the left of x\r\n+# \r\n+# YYYLettersToTheLeft <- YYYposition - 1\r\n+# #how many letters to the right SHOULD just be length(motif)-position-1 if it\'s 5 long and x is at 3 then Y is at 4 and there is\r\n+# #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1\r\n+# YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1\r\n+# #then sanity check, we\'re currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the\r\n+# #variable the user puts in is\r\n+# if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < 7) {\r\n+# leftspaces<-rep(" ",times=(7-YYYLettersToTheLeft))\r\n+# rightspaces<-rep(" ",times=7-(YYYLettersToTheRight))\r\n+# #add blank spaces if the motif has less than 4 letters to the left/right\r\n+# motif<-c(leftspaces,YYYmotif,rightspaces)\r\n+# #save that motif, which is the Y and +/- 4 amino acids, including truncation\r\n+# motif<-motif[!motif %in% "x"]\r\n+# motif<-paste(motif, sep="", collapse="")\r\n+# D835letters<-motif\r\n+# D835Ymotifs[i,1]<-D835letters\r\n+# D835YAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]\r\n+# }\r\n+# \r\n+# if(YYYLettersToTheLeft>6 && YYYLettersToTheRight>6){\r\n+# motif<-YYYmotif\r\n+# #add blank spaces if the motif has less than 4 letters to the left/right\r\n+# motif<-c(leftspaces,YYYmotif,rightspaces)\r\n+# #save that motif, which is the Y and +/- 4 amino acids, including truncation\r\n+# motif<-motif[!motif %in% "x"]\r\n+# motif<-paste(motif, sep="", collapse="")\r\n+# D835letters<-motif\r\n+# D835Ymotifs[i,1]<-D835letters\r\n+# D835YAccessionNumbers[i,1]<-FirstSubstrateSet[i,3]\r\n+# }\r\n+# }\r\n+\r\n+# for (k in 1:length(FTLwtmotifsFINAL)) {\r\n+# AN<-00000\r\n+# #I don\'t remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is\r\n+# #destroyed immediately after use\r\n+# for (m in 1:ncol(Firstsubbackfreq)) {\r\n+# AN <- as.character(Firstsubbackfreq[1, m])\r\n+# if (grepl(pattern = AN,\r\n+# x = names(FTLwtmotifsFINAL[k]),\r\n+# fixed = TRUE) == TRUE) {\r\n+# outputmatrix <- as.character(Firstsubbackfreq[, m])\r\n+# outputmatrix <- matrix(outputmatrix, nrow = 1)\r\n+# #with that accession number, find a match in the subbackfreq file and save it here\r\n+# FTLFinalMatrix<-rbind(FTLFinalMatrix,outputmatrix)\r\n+# }\r\n+# }\r\n+# }\r\n+# for (k in 1:length(D835YmotifsFINAL)) {\r\n+# #I don\'t remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is\r\n+# #destroyed immediately after use\r\n+# for (m in 1:ncol(Secondsubbackfreq)) {\r\n+# AN <- as.character(Secondsubbackfreq[1, m])\r\n+# if (grepl(pattern = AN,\r\n+# x = names(D835YmotifsFINAL[k]),\r\n+# fixed = TRUE) == TRUE) {\r\n+# outputmatrix <- as.character(Secondsubbackfreq[, m])\r\n+# outputmatrix <- matrix(outputmatrix, nrow = 1)\r\n+# #with that accession number, find a match in the subbackfreq file and save it here\r\n+# D835YFinalMatrix<-rbind(D835YFinalMatrix,outputmatrix)\r\n+# }\r\n+# }\r\n+# }\n\\ No newline at end of file\n' |
b |
diff -r dff99bed3f56 -r 74ada21ceb70 all stuff/difference finder for 2 overlaps proper names 7-7_1-15-2019.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/all stuff/difference finder for 2 overlaps proper names 7-7_1-15-2019.R Fri Apr 19 14:00:46 2019 -0400 |
[ |
b'@@ -0,0 +1,547 @@\n+#Difference finder for only 2 \r\n+\r\n+#ff you want ONLY FULL MOTIFS, put "YES" here, please use all caps\r\n+FullMotifsOnly_questionmark<-"NO"\r\n+#If you want ONLY TRUNCATED MOTIFS, put "YES" here, please use all caps\r\n+TruncatedMotifsOnly_questionmark<-"NO"\r\n+\r\n+FirstSubstrateSet<- read.csv("Substrates 1A TiO2 and FeNTA no duplicates.csv", stringsAsFactors=FALSE)\r\n+Firstsubbackfreq<- read.csv("SBF 1A TiO2 and FeNTA no duplicates.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+SecondSubstrateSet<- read.csv("Substrates 1B TiO2 and FeNTA no duplicates.csv", stringsAsFactors=FALSE)\r\n+Secondsubbackfreq<- read.csv("SBF 1B TiO2 and FeNTA no duplicates.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+\r\n+First_unshared_motifs_table<-"Substrates 1A no duplicates no negatives.csv"\r\n+First_unshared_subbackfreq<-"SBF 1A no duplicates no negatives.csv"\r\n+\r\n+Second_unshared_motifs_table<-"Substrates 1B no duplicates no negatives.csv"\r\n+Second_unshared_subbackfreq<-"SBF 1B no duplicates no negatives.csv"\r\n+\r\n+\r\n+LeftOfYLetters<-7\r\n+RightOfYLetters<-7\r\n+\r\n+if (FullMotifsOnly_questionmark=="YES"){\r\n+ FirstMotifs=rep(NA,times=nrow(FirstSubstrateSet))\r\n+ FirstAccessionNumbers=rep(NA,times=nrow(FirstSubstrateSet))\r\n+ leftspaces<-c()\r\n+ rightspaces<-c()\r\n+ for (i in 1:nrow(FirstSubstrateSet)){\r\n+ FirstLetters<-FirstSubstrateSet[i,7:15]\r\n+ FirstLetters<-FirstLetters[FirstLetters !="XXXXX"]\r\n+ FirstLetters<-paste(FirstLetters, sep="", collapse="")\r\n+ \r\n+ \r\n+ YYYmotif <- unlist(strsplit(FirstLetters, split = ""))\r\n+ YYYposition <- match(x = "x", table = YYYmotif)\r\n+ #position itself tells me how much is to the left of that X by what it\'s number is. x at position 4 tells me that there are\r\n+ #just 3 letters to the left of x\r\n+ \r\n+ YYYLettersToTheLeft <- YYYposition - 1\r\n+ #how many letters to the right SHOULD just be length(motif)-position-1 if it\'s 5 long and x is at 3 then Y is at 4 and there is\r\n+ #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1\r\n+ YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1\r\n+ #then sanity check, we\'re currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the\r\n+ #variable the user puts in is\r\n+ \r\n+ if (YYYLettersToTheLeft > 3 && YYYLettersToTheRight > 3) {\r\n+ motif<-YYYmotif\r\n+ #save that motif, which is the Y and +/- 4 amino acids, including truncation\r\n+ motif<-motif[!motif %in% "x"]\r\n+ motif<-paste(motif, sep="", collapse="")\r\n+ FirstLetters<-motif\r\n+ FirstMotifs[i]<-FirstLetters\r\n+ FirstAccessionNumbers[i]<-FirstSubstrateSet[i,3]\r\n+ }\r\n+ \r\n+ }\r\n+ # FirstMotifs <- FirstMotifs[!is.na(FirstMotifs)]\r\n+ # FirstMotifs<-matrix(FirstMotifs,ncol = 1)\r\n+ # \r\n+ \r\n+ SecondMotifs=rep(NA,times=nrow(FirstSubstrateSet))\r\n+ SecondAccessionNumbers=rep(NA,times=nrow(FirstSubstrateSet))\r\n+ \r\n+ for (i in 1:nrow(SecondSubstrateSet)){\r\n+ SecondLetters<-SecondSubstrateSet[i,7:15]\r\n+ SecondLetters<-SecondLetters[SecondLetters !="XXXXX"]\r\n+ SecondLetters<-paste(SecondLetters, sep="", collapse="")\r\n+ \r\n+ \r\n+ YYYmotif <- unlist(strsplit(SecondLetters, split = ""))\r\n+ YYYposition <- match(x = "x", table = YYYmotif)\r\n+ #position itself tells me how much is to the left of that X by what it\'s number is. x at position 4 tells me that there are\r\n+ #just 3 letters to the left of x\r\n+ \r\n+ YYYLettersToTheLeft <- YYYposition - 1\r\n+ #how many letters to the right SHOULD just be length(motif)-position-1 if it\'s 5 long and x is at 3 then Y is at 4 and there is\r\n+ #just 1 spot to the right of Y so LettersToTheRight<-1 because 5-3-1=1\r\n+ YYYLettersToTheRight <- length(YYYmotif) - YYYposition - 1\r\n+ #then sanity check, we\'re currently looking only at +/-4, but this spot allows for up to +/- 7 as well, just depends on what the\r\n+ #variable the user puts in is\r\n+ \r\n+ if (YYYLettersToTheLeft > 3 && YYYLettersToTheRigh'..b' outputmatrix <- as.character(Thirdsubbackfreq[, m])\r\n+ outputmatrix <- matrix(outputmatrix, nrow = 1)\r\n+ #with that accession number, find a match in the subbackfreq file and save it here\r\n+ ITDFinalMatrix<-rbind(ITDFinalMatrix,outputmatrix)\r\n+ }\r\n+ }\r\n+ }\r\n+ ITDFinalMatrix<-ITDFinalMatrix[!duplicated(ITDFinalMatrix),]\r\n+}\r\n+\r\n+columnalheader<-c(rep(NA,36))\r\n+SecondFinalMatrix<-matrix(data =columnalheader,nrow = 1)\r\n+\r\n+for (k in 1:length(SecondMotifsFINAL)) {\r\n+ #I don\'t remember why, but I felt it necessary to destroy the accession number multiple times to ensure it is\r\n+ #destroyed immediately after use\r\n+ for (m in 1:ncol(Secondsubbackfreq)) {\r\n+ AN <- as.character(Secondsubbackfreq[1, m])\r\n+ if (grepl(pattern = AN,\r\n+ x = names(SecondMotifsFINAL[k]),\r\n+ fixed = TRUE) == TRUE) {\r\n+ outputmatrix <- as.character(Secondsubbackfreq[, m])\r\n+ outputmatrix <- matrix(outputmatrix, nrow = 1)\r\n+ #with that accession number, find a match in the subbackfreq file and save it here\r\n+ SecondFinalMatrix<-rbind(SecondFinalMatrix,outputmatrix)\r\n+ }\r\n+ }\r\n+}\r\n+SecondFinalMatrix<-SecondFinalMatrix[!duplicated(SecondFinalMatrix),]\r\n+FTLoutputmatrix<-matrix(data=c(FirstMotifsFINAL,names(FirstMotifsFINAL)),ncol = 2)\r\n+\r\n+\r\n+write.table(x=FTLoutputmatrix,\r\n+ file=First_unshared_motifs_table,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+\r\n+columnalheader<-c(as.character(Firstsubbackfreq[1:36,1]))\r\n+columnalheader<-matrix(columnalheader,nrow = 1)\r\n+write.table(x=columnalheader,\r\n+ file=First_unshared_subbackfreq,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+FirstFinalMatrix<-FirstFinalMatrix[2:nrow(FirstFinalMatrix),]\r\n+write.table(x=FirstFinalMatrix,\r\n+ file=First_unshared_subbackfreq,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+\r\n+############################################################################################################\r\n+\r\n+D835Youtputmatrix<-matrix(data=c(SecondMotifsFINAL,names(SecondMotifsFINAL)),ncol = 2)\r\n+\r\n+write.table(x=D835Youtputmatrix,\r\n+ file=Second_unshared_motifs_table,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+\r\n+columnalheader<-c(as.character(Firstsubbackfreq[1:36,1]))\r\n+columnalheader<-matrix(columnalheader,nrow = 1)\r\n+write.table(x=columnalheader,\r\n+ file=Second_unshared_subbackfreq,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+SecondFinalMatrix<-SecondFinalMatrix[2:nrow(SecondFinalMatrix),] \r\n+write.table(x=SecondFinalMatrix,\r\n+ file=Second_unshared_subbackfreq,\r\n+ quote=FALSE, sep=",",\r\n+ row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+\r\n+############################################################################################################\r\n+\r\n+# ITDoutputmatrix<-matrix(data = c(ITDmotifsFINAL,names(ITDmotifsFINAL)),ncol = 2)\r\n+# \r\n+# write.table(x=ITDoutputmatrix,\r\n+# file=Third_unshared_motifs_table,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# \r\n+# columnalheader<-c(as.character(Thirdsubbackfreq[1:36,1]))\r\n+# columnalheader<-matrix(columnalheader,nrow = 1)\r\n+# write.table(x=columnalheader,\r\n+# file=Third_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n+# ITDFinalMatrix<-ITDFinalMatrix[2:nrow(ITDFinalMatrix),]\r\n+# write.table(x=ITDFinalMatrix,\r\n+# file=Third_unshared_subbackfreq,\r\n+# quote=FALSE, sep=",",\r\n+# row.names=FALSE,col.names = FALSE, na="", append=TRUE)\n\\ No newline at end of file\n' |
b |
diff -r dff99bed3f56 -r 74ada21ceb70 all stuff/differenceFinder.xml --- a/all stuff/differenceFinder.xml Fri Apr 19 10:57:28 2019 -0400 +++ b/all stuff/differenceFinder.xml Fri Apr 19 14:00:46 2019 -0400 |
b |
@@ -1,4 +1,4 @@ -<tool id="commonality_r" name="difference_finder" version="1.0.0"> +<tool id="commonality_r" name="difference_finder" version="17.0.0"> <description>finds differences</description> <requirements> <requirement type="package">R</requirement> |