Repository 'difference_finder'
hg clone https://toolshed.g2.bx.psu.edu/repos/jfb/difference_finder

Changeset 11:77e47268b650 (2020-07-14)
Previous changeset 10:78f16bc92ba6 (2020-02-21)
Commit message:
Uploaded
modified:
all stuff/differenceFinder.xml
added:
all stuff/Difference finder for GalaxyP july 2020.R
removed:
all stuff/Difference finder for GalaxyP 2-21-20.R
all stuff/Difference finder for GalaxyP working.R
b
diff -r 78f16bc92ba6 -r 77e47268b650 all stuff/Difference finder for GalaxyP 2-21-20.R
--- a/all stuff/Difference finder for GalaxyP 2-21-20.R Fri Feb 21 16:37:08 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,358 +0,0 @@\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,colClasses = "character")\r\n-Firstsubbackfreq<- read.csv("SBF1.csv", header=FALSE, stringsAsFactors=FALSE)\r\n-\r\n-SecondSubstrateSet<- read.csv("S2.csv", stringsAsFactors=FALSE,colClasses = "character")\r\n-Secondsubbackfreq<- read.csv("SBF2.csv", header=FALSE, stringsAsFactors=FALSE)\r\n-\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-EmptySubHeader<-colnames(FirstSubstrateSet)\r\n-EmptySubHeader<-matrix(EmptySubHeader, nrow=1)\r\n-EmptySBFHeader<-Firstsubbackfreq[,1]\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-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-# 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 wether or not you\'re looking for truncated or full here\r\n-#full only\r\n-\r\n-\r\n-###############################################\r\n-#ALL motifs, full and truncated\r\n-\r\n-if (FullMotifs'..b'     quote=FALSE, sep=",",\r\n-              row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n-}\r\n-\r\n-\r\n-columnalheader<-c(rep(NA,36))\r\n-D835YFinalMatrix<-matrix(data =columnalheader,nrow = 1)\r\n-\r\n-if (length(D835YmotifsFINAL)>0){\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-  }\r\n-  D835YFinalMatrix<-D835YFinalMatrix[!duplicated(D835YFinalMatrix),]\r\n-  D835YFinalMatrix<-D835YFinalMatrix[2:nrow(D835YFinalMatrix),]\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(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-  \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-} else {\r\n-  D835YFinalMatrix<- columnalheader\r\n-  write.table(x=EmptySubHeader,\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-}\n\\ No newline at end of file\n'
b
diff -r 78f16bc92ba6 -r 77e47268b650 all stuff/Difference finder for GalaxyP july 2020.R
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/all stuff/Difference finder for GalaxyP july 2020.R Tue Jul 14 19:53:34 2020 -0400
[
b'@@ -0,0 +1,333 @@\n+FirstSubstrateSet<- read.csv("S1.csv", stringsAsFactors=FALSE,colClasses = "character")\r\n+Firstsubbackfreq<- read.csv("SBF1.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+SecondSubstrateSet<- read.csv("S2.csv", stringsAsFactors=FALSE,colClasses = "character")\r\n+Secondsubbackfreq<- read.csv("SBF2.csv", header=FALSE, stringsAsFactors=FALSE)\r\n+#this brings in the input files\r\n+\r\n+\r\n+First_unshared_motifs_table<-"1RS.csv"\r\n+First_unshared_subbackfreq<-"1RSBF.csv"\r\n+Second_unshared_motifs_table<-"2RS.csv"\r\n+Second_unshared_subbackfreq<-"2RSBF.csv"\r\n+#this names the output files\r\n+\r\n+EmptySubHeader<-colnames(FirstSubstrateSet)\r\n+EmptySubHeader<-matrix(EmptySubHeader, nrow=1)\r\n+EmptySBFHeader<-Firstsubbackfreq[,1]\r\n+#this creates the headers which comes from the input files, so that the output files can be given this header so that they will look identical to the input files\r\n+\r\n+\r\n+#the below code is used to ensure that all phospho-amino acids get marked with an "x" to denote their phosphoness\r\n+FirstCentralLetters<-FirstSubstrateSet[,11]\r\n+SecondCentralLetters<-SecondSubstrateSet[,11]\r\n+#the phospho AAs are always found in position 12, so take them from there\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+#use an 3 apply functions to create vectors, these vetors have true values where they find an S, T or Y.  \r\n+#so FirstEsses has a True anywhere it sees an S, and FirstTees has a True anywhere it sees a Y\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+#do the same for the second substrate set\'s central letters\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+#where there is a True value in FirstEsses, replace that value in the original substrate set with an xS.  This is because there was originally an S in that\r\n+#position, and I want that S to be marked with an x, denoting phospho\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+#then I put these x-marked letters back where I found them, in position 11 of the substrate sets\r\n+\r\n+FTLwtmotifs=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)\r\n+FTLwtAccessionNumbers=matrix(,nrow = nrow(FirstSubstrateSet),ncol=1)\r\n+\r\n+for (i in 1:nrow(FirstSubstrateSet)){\r\n+  FTLwtletters<-FirstSubstrateSet[i,4:18]\r\n+  FTLwtletters<-FTLwtletters[FTLwtletters !="XXXXX"]\r\n+  FTLwtletters<-paste(FTLwtletters, sep="", collapse="")\r\n+  leftspaces<-c()\r\n+  rightspaces<-c()\r\n+  \r\n+  YYYmotif <- unlist(strsplit(FTLwtletters, 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+  \r\n+  if (YYYLettersToTheLeft < 7 | YYYLettersToTheRight < '..b'hared_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+columnalheader<-c(rep(NA,36))\r\n+D835YFinalMatrix<-matrix(data =columnalheader,nrow = 1)\r\n+\r\n+if (length(D835YmotifsFINAL)>0){\r\n+  for (k in 1:length(D835YmotifsFINAL)) {\r\n+    #it is 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+  }\r\n+  D835YFinalMatrix<-D835YFinalMatrix[!duplicated(D835YFinalMatrix),]\r\n+  D835YFinalMatrix<-D835YFinalMatrix[2:nrow(D835YFinalMatrix),]\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(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+  \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+} else {\r\n+  D835YFinalMatrix<- columnalheader\r\n+  write.table(x=EmptySubHeader,\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+}\n\\ No newline at end of file\n'
b
diff -r 78f16bc92ba6 -r 77e47268b650 all stuff/Difference finder for GalaxyP working.R
--- a/all stuff/Difference finder for GalaxyP working.R Fri Feb 21 16:37:08 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
b'@@ -1,358 +0,0 @@\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,colClasses = "character")\r\n-Firstsubbackfreq<- read.csv("SBF1.csv", header=FALSE, stringsAsFactors=FALSE)\r\n-\r\n-SecondSubstrateSet<- read.csv("S2.csv", stringsAsFactors=FALSE,colClasses = "character")\r\n-Secondsubbackfreq<- read.csv("SBF2.csv", header=FALSE, stringsAsFactors=FALSE)\r\n-\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-EmptySubHeader<-colnames(FirstSubstrateSet)\r\n-EmptySubHeader<-matrix(EmptySubHeader, nrow=1)\r\n-EmptySBFHeader<-Firstsubbackfreq[,1]\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-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-# 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 wether or not you\'re looking for truncated or full here\r\n-#full only\r\n-\r\n-\r\n-###############################################\r\n-#ALL motifs, full and truncated\r\n-\r\n-if (FullMotifs'..b'   row.names=FALSE,col.names = FALSE, na="", append=TRUE)\r\n-}\r\n-\r\n-\r\n-columnalheader<-c(rep(NA,36))\r\n-D835YFinalMatrix<-matrix(data =columnalheader,nrow = 1)\r\n-\r\n-if (length(D835YmotifsFINAL)>0){\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-  }\r\n-  D835YFinalMatrix<-D835YFinalMatrix[!duplicated(D835YFinalMatrix),]\r\n-  D835YFinalMatrix<-D835YFinalMatrix[2:nrow(D835YFinalMatrix),]\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-} else {\r\n-  D835YFinalMatrix<- columnalheader\r\n-  write.table(x=EmptySubHeader,\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-}\n\\ No newline at end of file\n'
b
diff -r 78f16bc92ba6 -r 77e47268b650 all stuff/differenceFinder.xml
--- a/all stuff/differenceFinder.xml Fri Feb 21 16:37:08 2020 -0500
+++ b/all stuff/differenceFinder.xml Tue Jul 14 19:53:34 2020 -0400
b
@@ -9,7 +9,7 @@
  ln -s '$input3' S2.csv &&
  ln -s '$input4' SBF2.csv &&
 
- Rscript '$__tool_directory__/Difference finder for GalaxyP 2-21-20.R'
+ Rscript '$__tool_directory__/Difference finder for GalaxyP july 2020.R'
     ]]></command>
     <inputs>
  <param format="csv" name="input1" type="data" label="First Substrate Set"/>