knitr::opts_chunk$set(echo = TRUE) require(knitr) require(kableExtra) require(plotly) require(seqLogo) output <- readRDS("output.rds") param <- readRDS("param.rds") input <- readRDS("input.rds") data <- readRDS("data.rds") dataset = input$meta samples = input$getNames() debug <- FALSE
Started on r format(Sys.time(), "%Y-%m-%d %H:%M:%S")
The counts are estimated by MAGeCK
sgRNAPerLib <- data.frame(data$sgRNAPerLib) colnames(sgRNAPerLib) <- c('Library', '#sgRNAs') ezInteractiveTableRmd(sgRNAPerLib)
countsPerLib <- data$countsPerLib for (nm in names(countsPerLib)){ #x = countsPerLib[[nm]]/1000 #par(mar=c(15.1, 6.1, 4.1, 2.1)) #if (length(x[x > 0]) > 0){ # bplot <- barplot(x[x > 0], names.arg = rep('',length(x[x>0])), col = 'royalblue3', # main = nm, ylab = 'sgRNA Count per Library per K', las = 2) # text(x = bplot, y = par("usr")[3] - 1, srt = 45, adj = 1, # labels = names(x)[x > 0], xpd = TRUE) #} x = 100*(countsPerLib[[nm]]/param$nReads) par(mar=c(15.1, 6.1, 4.1, 2.1)) if (length(x[x > 0]) > 0){ bplot <- barplot(x[x > 0], names.arg = rep('',length(x[x>0])), col = 'royalblue3', main = nm, ylab = 'MappingRate per Library in %', las = 2, ylim = c(0,100)) text(x = bplot, y = par("usr")[3] - 3, srt = 45, adj = 1, labels = names(x)[x > 0], xpd = TRUE) } }
topFeatureResults <- data$topFeatureResults myTable <- c() for (nm in names(topFeatureResults)){ topFeatureResult <- data.frame(topFeatureResults[[nm]]) if(nrow(topFeatureResult)>0){ topFeatureResult[['Sample']] = nm colnames(topFeatureResult) <- c('sgRNA', 'Gene', 'Count', 'Library', 'Sample') myTable <- rbind(myTable, topFeatureResult) } } ezInteractiveTableRmd(myTable)
PWMs <- data$PWMs consensusSeqs <- c() for (nm in names(PWMs)){ cat(nm, "\n \n") seqLogo(PWMs[[nm]]) cons <- limma::strsplit2(consensus(PWMs[[nm]]), split ='') cons[ic(PWMs[[nm]]) <1] <- 'N' cons <- paste(cons, collapse = '') consensusSeqs <- c(consensusSeqs, cons) cat("\n \n") } names(consensusSeqs) <- names(PWMs)
ezInteractiveTableRmd(values=data.frame(Name=names(consensusSeqs), Sequence = consensusSeqs, row.names = NULL))
ezInteractiveTableRmd(values=dataset)
ezSessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.