comparison small_rna_maps.r @ 27:fe1a9cfaf5c3 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit d234ef45deb84f70c85b3372b8e0137df0be4e29
author artbio
date Wed, 24 Apr 2019 11:18:24 -0400
parents b585cb347a26
children 183bf49fe77c
comparison
equal deleted inserted replaced
26:376fae7c9f32 27:fe1a9cfaf5c3
26 args = parse_args(parser) 26 args = parse_args(parser)
27 27
28 # data frames implementation 28 # data frames implementation
29 ## first table 29 ## first table
30 Table = read.delim(args$first_dataframe, header=T, row.names=NULL) 30 Table = read.delim(args$first_dataframe, header=T, row.names=NULL)
31 colnames(Table)[1] <- "Dataset"
31 if (args$first_plot_method == "Counts" | args$first_plot_method == "Size") { 32 if (args$first_plot_method == "Counts" | args$first_plot_method == "Size") {
32 Table <- within(Table, Counts[Polarity=="R"] <- (Counts[Polarity=="R"]*-1)) 33 Table <- within(Table, Counts[Polarity=="R"] <- (Counts[Polarity=="R"]*-1))
33 } 34 }
34 n_samples=length(unique(Table$Dataset)) 35 n_samples=length(unique(Table$Dataset))
35 samples = unique(Table$Dataset) 36 samples = unique(Table$Dataset)
50 per_gene_limit=lapply(genes, function(x) c(1, unique(subset(Table, Chromosome==x)$Chrom_length)) ) 51 per_gene_limit=lapply(genes, function(x) c(1, unique(subset(Table, Chromosome==x)$Chrom_length)) )
51 n_genes=length(per_gene_readmap) 52 n_genes=length(per_gene_readmap)
52 # second table 53 # second table
53 if (args$extra_plot_method != '') { 54 if (args$extra_plot_method != '') {
54 ExtraTable=read.delim(args$extra_dataframe, header=T, row.names=NULL) 55 ExtraTable=read.delim(args$extra_dataframe, header=T, row.names=NULL)
56 colnames(ExtraTable)[1] <- "Dataset"
55 if (args$extra_plot_method == "Counts" | args$extra_plot_method=='Size') { 57 if (args$extra_plot_method == "Counts" | args$extra_plot_method=='Size') {
56 ExtraTable <- within(ExtraTable, Counts[Polarity=="R"] <- (Counts[Polarity=="R"]*-1)) 58 ExtraTable <- within(ExtraTable, Counts[Polarity=="R"] <- (Counts[Polarity=="R"]*-1))
57 } 59 }
58 if (args$extra_plot_method == "Counts" | args$extra_plot_method == "Size" | args$extra_plot_method == "Coverage") { 60 if (args$extra_plot_method == "Counts" | args$extra_plot_method == "Size" | args$extra_plot_method == "Coverage") {
59 i = 1 61 i = 1