X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rsem-plot-model;h=f7b84fc0e3664d5441807281afc2ad276aef4b8b;hb=58f823f5be6dfbe00896fc44ac3aac5e881e9c5c;hp=e9225eddf41466424d265cc9b55ef7ebf96b7aa4;hpb=019648be71e0b8ea5772530b5496720fcb841bba;p=rsem.git diff --git a/rsem-plot-model b/rsem-plot-model index e9225ed..f7b84fc 100755 --- a/rsem-plot-model +++ b/rsem-plot-model @@ -2,13 +2,20 @@ argv <- commandArgs(TRUE) if (length(argv) != 2) { - cat("Usage: rsem-plot-model modelF outF\n") + cat("Usage: rsem-plot-model sample_name outF\n") q(status = 1) } -con <- file(argv[1], open = "r") +strvec <- strsplit(argv[1], split = "/")[[1]] +token <- strvec[length(strvec)] + +modelF <- paste(argv[1], ".stat/", token, ".model") +cntF <- paste(argv[1], ".stat/", token, ".cnt") + pdf(argv[2]) +con <- file(modelF, open = "r") + # model type and forward probability model_type <- as.numeric(readLines(con, n = 4)[1]) @@ -108,5 +115,9 @@ if (model_type == 1 || model_type == 3) { legend("topleft", c("A", "C", "G", "T"), lty = 1:4, pch = 0:3, col = 1:4) } -dev.off() close(con) + +pair <- read.table(file = cntF, skip = 3, sep = "\t") +plot(pair[,1], pair[,2], xlab = "Number of Alignments", ylab = "Number of Reads", main = "Among alignable reads, distribution of # of alignments") + +dev.off()