testFile = system.file("extdata", "test.bed", package="cleanUpdTSeq")
testSet = read.table(testFile, sep = "\t", header = TRUE)
#convert the test set to GRanges without upstream and downstream sequence information
peaks = BED2GRangesSeq(testSet,withSeq=FALSE)
#build the feature vector for the test set without sequence information
testSet.NaiveBayes = buildFeatureVector(peaks,BSgenomeName = Drerio, upstream = 40,
downstream = 30, wordSize = 6, alphabet=c("ACGT"),
sampleType = "unknown",replaceNAdistance = 30,
method = "NaiveBayes", ZeroBasedIndex = 1, fetchSeq = TRUE)
data(data.NaiveBayes)
## sample the test data for code testing, DO NOT do this for real data
## START SAMPLING
samp <- c(1:22, sample(23:4119, 50), 4119, 4120)
Ndata.NaiveBayes <- data.NaiveBayes$Negative[,samp]
Pdata.NaiveBayes <- data.NaiveBayes$Positive[,samp]
testSet.NaiveBayes@data <- testSet.NaiveBayes@data[, samp-1]
## END SAMPLING
predictTestSet(Ndata.NaiveBayes,
Pdata.NaiveBayes,
testSet.NaiveBayes,
outputFile="test-predNaiveBayes.xls",
assignmentCutoff = 0.5)
Run the code above in your browser using DataLab