File: plot_ExN50_statistic.Rscript

package info (click to toggle)
trinityrnaseq 2.11.0%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 417,528 kB
  • sloc: perl: 48,420; cpp: 17,749; java: 12,695; python: 3,124; sh: 1,030; ansic: 983; makefile: 688; xml: 62
file content (40 lines) | stat: -rwxr-xr-x 783 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env Rscript

args<-commandArgs(TRUE)

if (length(args) == 0) {
    stop("\n\n\tusage: plot_ExN50_statistic.Rscript sampleA.ExN50.stats [ sampleB.ExN50.stats ... ] \n\n\n")
}


library(tidyverse)

alldata = NULL

for (i in 1:length(args)) {
    filename = args[i]

    message(sprintf("parsing: %s", filename))
    data = read.table(filename, header=T, row.names=NULL)

    data$sample = filename

    if (is.null(alldata)) {
        alldata <- data
    } else {
        alldata <- rbind(alldata, data)
    }
}


pdf_filename = "ExN50_plot.pdf"
pdf(pdf_filename)

p = alldata %>% ggplot(aes(x=Ex, y=ExN50, color=sample)) + geom_line() + xlim(c(30,100))

plot(p)

write(cat("ExN50 data plotted as:", pdf_filename), stderr())

quit(save = "no", status = 0, runLast = FALSE)