# HG changeset patch # User drosofff # Date 1457625600 18000 # Node ID a95419680ce4c60e2700970b6d940ba0da018dbc # Parent 00852209fd9fa67b7679cc9c3626dc552c0cecdd planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/msp_sr_size_histograms commit 89caea4594db1ae6d6bb9c651bc6019bb6dd3ce6 diff -r 00852209fd9f -r a95419680ce4 size_histogram.xml --- a/size_histogram.xml Wed Oct 21 11:50:42 2015 -0400 +++ b/size_histogram.xml Thu Mar 10 11:00:00 2016 -0500 @@ -1,99 +1,99 @@ - - from sRbowtie aligment - + + from sRbowtie aligment + bowtie pysam R biocbasics numpy - - - size_histogram.py - #if $refGenomeSource.genomeSource == "history": - --reference_fasta ## sys.argv[2] - $refGenomeSource.ownFile ## index source - #else: - #silent reference= filter( lambda x: str( x[0] ) == str( $refGenomeSource.series[0].input.dbkey ), $__app__.tool_data_tables[ 'bowtie_indexes' ].get_fields() )[0][-1] - --reference_bowtie_index - $reference - #end if - --rcode - $plotCode - --output_size_distribution - $size_distribution_dataframe - --minquery - $minquery - --maxquery - $maxquery - --input - #for $i in $refGenomeSource.series - $i.input - #end for - --ext - #for $i in $refGenomeSource.series - $i.input.ext - #end for - --label - #for $i in $refGenomeSource.series - "$i.input.name" - #end for - --normalization_factor - #for $i in $refGenomeSource.series - $i.norm - #end for - #if $gff: - --gff - $gff - #end if - #if $global.value == 'yes': - --global_size - #end if - #if $collapsestrands.value == 'yes': - --collapse - #end if + + + size_histogram.py + #if $refGenomeSource.genomeSource == "history": + --reference_fasta ## sys.argv[2] + $refGenomeSource.ownFile ## index source + #else: + #silent reference= filter( lambda x: str( x[0] ) == str( $refGenomeSource.series[0].input.dbkey ), $__app__.tool_data_tables[ 'bowtie_indexes' ].get_fields() )[0][-1] + --reference_bowtie_index + $reference + #end if + --rcode + $plotCode + --output_size_distribution + $size_distribution_dataframe + --minquery + $minquery + --maxquery + $maxquery + --input + #for $i in $refGenomeSource.series + $i.input + #end for + --ext + #for $i in $refGenomeSource.series + $i.input.ext + #end for + --label + #for $i in $refGenomeSource.series + "$i.input.name" + #end for + --normalization_factor + #for $i in $refGenomeSource.series + $i.norm + #end for + #if $gff: + --gff $gff + #end if + #if $global.value == 'yes': + --global_size + #end if + #if $collapsestrands.value == 'yes': + --collapse + #end if - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## Setup R error handling to go to stderr @@ -110,6 +110,11 @@ n_samples = length(unique (size\$sample)) n_genes = length (unique (levels(size\$gene))) + if (${yrange} != 0) { + # This is used for specifying the y-axis limits + ylim=c(-${yrange}, ${yrange}) + } else { ylim="" } + par.settings.size=list(layout.heights=list(top.padding=1, bottom.padding=1), strip.background = list(col = c("lightblue", "lightgreen")) ) @@ -132,7 +137,7 @@ newpage = T, ...) - combineLimits(update(useOuterStrips(bc, + combineLimits(update(useOuterStrips(bc, strip.left = strip.custom(par.strip.text = list(cex=0.5)) ), layout=c(n_samples,${rows_per_page})), @@ -147,44 +152,61 @@ #end if if (global=="no") { + width = 8.2677*n_samples/4 + } else { width = 8.2677 } options(warn=-1) - pdf(file="${size_PDF}", paper="special", height=11.69, width=8.2677*n_samples/4) - plot_size_distribution(size, par.settings=par.settings.size) # removed , prepanel=smR.prepanel - - } else { + pdf(file="${size_PDF}", paper="special", height=11.69, width=width) - pdf(file="${size_PDF}", paper="special", height=11.69, width=8.2677) - bc= barchart(count~as.factor(size)|factor(sample, levels=unique(sample)), data = size, origin = 0, - horizontal=FALSE, - group=polarity, - stack=TRUE, - col=c('red', 'blue'), -# par.settings=list(fontsize = list(text=8, points=8)), - scales=list(y=list(tick.number=4, rot=90, relation="same"), cex=1), - xlab = "readsize in nucleotides", - ylab = "${ylabel}", - main="${title}" , as.table=TRUE, newpage = T, - aspect=0.5, - strip = strip.custom(par.strip.text = list(cex = 1), which.given=1, bg="lightblue") - ) - bc - } + if (ylim == "" && global=="no") { + plot_size_distribution(size, par.settings=par.settings.size) + } + if (ylim != "" && global=="no") { plot_size_distribution(size, par.settings=par.settings.size, ylim=ylim) + } + if (ylim == "" && global=="yes") { bc= barchart(count~as.factor(size)|factor(sample, levels=unique(sample)), data = size, origin = 0, + horizontal=FALSE, + group=polarity, + stack=TRUE, + col=c('red', 'blue'), + scales=list(y=list(tick.number=4, rot=90, relation="same"), cex=1), + xlab = "readsize in nucleotides", + ylab = "${ylabel}", + main="${title}" , as.table=TRUE, newpage = T, + aspect=0.5, + strip = strip.custom(par.strip.text = list(cex = 1), which.given=1, bg="lightblue") + ) + bc + } + if (ylim != "" && global=="yes") { bc= barchart(count~as.factor(size)|factor(sample, levels=unique(sample)), data = size, origin = 0, + horizontal=FALSE, + group=polarity, + stack=TRUE, + col=c('red', 'blue'), + scales=list(y=list(tick.number=4, rot=90, relation="same"), cex=1), + xlab = "readsize in nucleotides", + ylab = "${ylabel}", + ylim = ylim, + main="${title}" , as.table=TRUE, newpage = T, + aspect=0.5, + strip = strip.custom(par.strip.text = list(cex = 1), which.given=1, bg="lightblue") + ) + bc + } + devname=dev.off() - - - - - + + + + **What it does** -Takes one or more alignment files (BAM, SAM or tabular bowtie output) as input and produces a histogram of read sizes, -where by default for each "chromosome" a histogram of read sizes is drawn. +Takes one or more alignment files (BAM, SAM or tabular bowtie output) as input and produces a histogram of read sizes, +where by default for each "chromosome" a histogram of read sizes is drawn. Reads that map in sense are on the top (red), reads that map antisense are on the bottom (blue). @@ -209,32 +231,32 @@ ---- -.. image:: static/images/size_histogram.png - :height: 800 +.. image:: static/images/size_histogram.png + :height: 800 :width: 500 - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff -r 00852209fd9f -r a95419680ce4 tool_dependencies.xml --- a/tool_dependencies.xml Wed Oct 21 11:50:42 2015 -0400 +++ b/tool_dependencies.xml Thu Mar 10 11:00:00 2016 -0500 @@ -7,10 +7,10 @@ - + - +