Mercurial > repos > artbio > small_rna_map
annotate lattice_small_rna_map.r @ 3:2e0dc6032a98 draft
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
author | artbio |
---|---|
date | Tue, 18 Jul 2017 13:34:36 -0400 |
parents | |
children | 6ff925458e05 |
rev | line source |
---|---|
3
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
1 ## Setup R error handling to go to stderr |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
2 #options( show.error.messages=F, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
3 # error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
4 warnings() |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
5 library(RColorBrewer) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
6 library(lattice) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
7 library(latticeExtra) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
8 library(grid) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
9 library(gridExtra) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
10 library(optparse) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
11 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
12 option_list <- list( |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
13 make_option(c("-r", "--output_tab"), type="character", help="path to tabular file"), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
14 make_option("--output_pdf", type = "character", help="path to the pdf file with plot") |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
15 ) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
16 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
17 parser <- OptionParser(usage = "%prog [options] file", option_list = option_list) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
18 args = parse_args(parser) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
19 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
20 # dataset manipulation |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
21 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
22 Table = read.delim(args$output_tab, header=T, row.names=NULL) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
23 Table <- within(Table, Nbr_reads[Polarity=="R"] <- (Nbr_reads[Polarity=="R"]*-1)) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
24 n_samples=length(unique(Table$Dataset)) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
25 genes=unique(levels(Table$Chromosome)) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
26 per_gene_readmap=lapply(genes, function(x) subset(Table, Chromosome==x)) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
27 per_gene_limit=lapply(genes, function(x) c(1, unique(subset(Table, Chromosome==x)$Chrom_length)) ) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
28 n_genes=length(per_gene_readmap) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
29 ## end of data frames implementation |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
30 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
31 ## functions |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
32 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
33 plot_readmap=function(df, ...) { |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
34 combineLimits(xyplot(Nbr_reads~Coordinate|factor(Dataset, levels=unique(Dataset))+factor(Chromosome, levels=unique(Chromosome)), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
35 data=df, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
36 type='h', |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
37 scales= list(relation="free", x=list(rot=0, cex=0.7, axs="i", tck=0.1), y=list(tick.number=4, rot=90, cex=0.7)), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
38 xlab=NULL, main=NULL, ylab=NULL, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
39 as.table=T, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
40 origin = 0, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
41 horizontal=FALSE, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
42 group=Polarity, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
43 col=c("red","blue"), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
44 par.strip.text = list(cex=0.7), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
45 ...)) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
46 } |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
47 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
48 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
49 plot_size=function(df, ...) { |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
50 smR.prepanel=function(x,y,...) {; yscale=c(y*0, max(abs(y)));list(ylim=yscale);} |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
51 sizeplot = xyplot(Median~Coordinate|factor(Dataset, levels=unique(Dataset))+factor(Chromosome, levels=unique(Chromosome)), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
52 data=df, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
53 type='p', |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
54 cex=0.5, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
55 pch=19, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
56 scales= list(relation="free", x=list(rot=0, cex=0, axs="i", tck=0.5), y=list(tick.number=4, rot=90, cex=0.7)), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
57 xlab=NULL, main=NULL, ylab=NULL, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
58 as.table=T, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
59 origin = 0, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
60 horizontal=FALSE, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
61 group=Polarity, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
62 col=c("darkred","darkblue"), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
63 par.strip.text = list(cex=0.7), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
64 ...) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
65 combineLimits(sizeplot) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
66 } |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
67 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
68 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
69 ## end of functions |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
70 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
71 ## function parameters |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
72 par.settings.readmap=list(layout.heights=list(top.padding=0, bottom.padding=0), strip.background = list(col=c("lightblue","lightgreen")) ) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
73 par.settings.size=list(layout.heights=list(top.padding=0, bottom.padding=0)) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
74 ## end of function parameters' |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
75 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
76 ## GRAPHS |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
77 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
78 if (n_genes > 7) {page_height_simple = 11.69; page_height_combi=11.69; rows_per_page=10} else { |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
79 rows_per_page= n_genes; page_height_simple = 2.5*n_genes; page_height_combi=page_height_simple*2 } |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
80 if (n_samples > 4) {page_width = 8.2677*n_samples/4} else {page_width = 8.2677*n_samples/2} # to test |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
81 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
82 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
83 pdf(file=args$output_pdf, paper="special", height=page_height_simple, width=page_width) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
84 if (rows_per_page %% 2 != 0) { rows_per_page = rows_per_page + 1} |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
85 for (i in seq(1,n_genes,rows_per_page/2)) { |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
86 start=i |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
87 end=i+rows_per_page/2-1 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
88 if (end>n_genes) {end=n_genes} |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
89 readmap_plot.list=lapply(per_gene_readmap[start:end], function(x) plot_readmap(x, xlim=c(1, x$Chrom_length[1]), strip=FALSE, par.settings=par.settings.readmap)) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
90 size_plot.list=lapply(per_gene_readmap[start:end], function(x) plot_size(x, xlim=c(1, x$Chrom_length[1]), par.settings=par.settings.size)) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
91 |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
92 plot.list=rbind(size_plot.list, readmap_plot.list) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
93 args_list=c(plot.list, list(nrow=rows_per_page+1, ncol=1, |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
94 top=textGrob("Read Maps and Median sizes", gp=gpar(cex=1), just="top"), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
95 left=textGrob("Read counts / Median size", gp=gpar(cex=1), vjust=1, rot=90), |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
96 sub=textGrob("Nucleotide coordinates", gp=gpar(cex=1), just="bottom") |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
97 ) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
98 ) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
99 do.call(grid.arrange, args_list) |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
100 } |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
101 devname=dev.off() |
2e0dc6032a98
planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit 93f212712d9846c7aaa389de60babb332d38363e
artbio
parents:
diff
changeset
|
102 |