diff NMF/NMF.R @ 1:a098e1274f63 draft

Uploaded
author jfb
date Wed, 28 Feb 2018 14:09:56 -0500
parents dd301fc4b54e
children
line wrap: on
line diff
--- a/NMF/NMF.R	Fri Feb 23 16:37:29 2018 -0500
+++ b/NMF/NMF.R	Wed Feb 28 14:09:56 2018 -0500
@@ -1,26 +1,29 @@
 NAMEOFOUTPUTFILE<-"output1.csv"
-#this is the name of the file you will create
-
-
 
 SuperAwesometrial <- read.delim2("input1.tabular", header=FALSE)
 #once you've used the other script to turn the FASFA into a CSV, copypaste the filepath and name 
 #of the csv into this line between the quote marks.  
 
-SBF<-read.csv("input3.csv", stringsAsFactors = FALSE)
-  
+SBF<-read.csv("input3.csv", stringsAsFactors = FALSE, header = FALSE)
+SBF<-t(SBF)
 
 PositiveMotifs <- read.csv("input2.csv", stringsAsFactors=FALSE)
 #because of R reasons, it is required that the motifs in this file have blank cells instead of spaces where there is no letter in 
 #the motif
 
+YsToim<-rep("xY",times=nrow(PositiveMotifs))
+PositiveMotifs[,11]<-YsToim
+
+
+
 ################################################################################################################################
 #I have to paste them, then split and unlist them, then find the x and paste again
 Positive9Letters<-PositiveMotifs[,4:18]
 #head(Positive9Letters)
 PositiveTrueMotifs<-c()
 
-AccessionNumbers<-SBF[,1]
+AccessionNumbers<-as.character(SBF[2:nrow(SBF),1])
+AccessionNumbers<-AccessionNumbers[!is.na(AccessionNumbers)]
 ALLPOSSIBLE<-SuperAwesometrial[,1]
 ALLPOSSIBLE<-as.character(ALLPOSSIBLE)
 ################################################################################################################################
@@ -59,7 +62,7 @@
 #TrueMotifNums<-which(ALLPOSSIBLE %in% AccessionNumbers)
 #fihlodeANs<-c()
 for (q in 1:length(AccessionNumbers)) {
-  patterno<-AccessionNumbers[q]
+  patterno<-as.character(AccessionNumbers[q])
   location<-sapply(ALLPOSSIBLE, grepl, pattern=patterno, fixed=TRUE)
   if (sum(location)>0){
     whereisit<-which(location %in% TRUE)