Skip to content

Commit

Permalink
cex.legend arg plotTargetAnnotation;faster ScoreMatrixBin
Browse files Browse the repository at this point in the history
plotTargetAnnotation
- add new argument cex.legend to plotTargetAnnotation() to specify the size of the legend.

ScoreMatrixBin:
  - changed ScoreMatrixBin() to run faster when noCovNA=TRUE
  • Loading branch information
katwre committed Aug 21, 2015
1 parent f5f5256 commit 9a2dbac
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,7 +1,7 @@
Package: genomation
Type: Package
Title: Summary, annotation and visualization of genomic data
Version: 1.1.12
Version: 1.1.13
Author: Altuna Akalin [aut, cre], Vedran Franke [aut, cre], Katarzyna Wreczycka [aut], Liz Ing-Simmons [ctb]
Maintainer: Altuna Akalin <aakalin@gmail.com>, Vedran Franke <vedran.franke@gmail.com>
Description: A package for summary and annotation of genomic intervals. Users can visualize and
Expand Down
8 changes: 8 additions & 0 deletions NEWS
@@ -1,3 +1,11 @@
genomation 1.1.13
--------------

IMPROVEMENTS AND BUG FIXES

* add new argument cex.legend to plotTargetAnnotation() to specify the size of the legend.
* changed ScoreMatrixBin() to run faster when noCovNA=TRUE

genomation 1.1.12
--------------

Expand Down
10 changes: 5 additions & 5 deletions R/readAnnotate.R
Expand Up @@ -957,11 +957,10 @@ setMethod("getAssociationWithTSS",
#' This option is only valid when x is a
#' \code{AnnotationByGeneParts} object
#' @param col a vector of colors for piechart or the bar plot
#' @param cex.legend a numeric value of length 1 to specify the size of the legend. By default 1.
#' @param ... graphical parameters to be passed to \code{pie}
#' or \code{barplot} functions
#'
#' @usage plotTargetAnnotation(x,precedence=TRUE,col,...)
#'
#'
#' @examples
#' data(cage)
Expand All @@ -981,15 +980,16 @@ setMethod("getAssociationWithTSS",
setGeneric("plotTargetAnnotation",
function(x,
precedence=TRUE,
col=getColors(length(x@annotation)),...)
col=getColors(length(x@annotation)),
cex.legend=1,...)
standardGeneric("plotTargetAnnotation"))

#' @rdname plotTargetAnnotation-methods
#' @docType methods
#' @aliases plotTargetAnnotation,AnnotationByFeature-method
setMethod("plotTargetAnnotation",
signature(x = "AnnotationByFeature"),
function(x,precedence,col,...){
function(x,precedence,col,cex.legend,...){

props=getTargetAnnotationStats(x,precedence)

Expand All @@ -999,7 +999,7 @@ setMethod("plotTargetAnnotation",
names(props)=paste( paste(round(props),"%"),sep=" ")

pie(props,cex=0.9,col=col,...)
legend("topright",legend=slice.names,fill=col )
legend("topright",legend=slice.names,fill=col, cex=cex.legend)

}else{

Expand Down
5 changes: 2 additions & 3 deletions R/scoreMatrixBin.R
Expand Up @@ -232,9 +232,8 @@ setMethod("ScoreMatrixBin",signature("GRanges","GRanges"),
# figure out which ones are real 0 score
# which ones has no coverage
# put NAs for no coverage bases
target.rle= endoapply( target.rle,function(x){ x=x-1
x[x<0]=NA
x})
runValue(target.rle)=runValue(target.rle)-1
runValue(target.rle)[runValue(target.rle)<0]=NA

}else{
# get coverage with weights
Expand Down
12 changes: 1 addition & 11 deletions man/gffToGRanges.Rd
Expand Up @@ -6,24 +6,14 @@
\title{Converts a gff formated data.frame into a GenomicRanges object.
The GenomicRanges object needs to be properly formated for the function to work.}
\usage{
gffToGRanges(gff.file, track.line = FALSE, split.group = FALSE,
split.char = ";", filter = NULL, zero.based = FALSE, ensembl = FALSE)
gffToGRanges(gff.file, filter = NULL, zero.based = FALSE, ensembl = FALSE)
}
\arguments{
\item{gff.file}{path to a gff formatted file.
The file can end in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip}
and/or start with \code{http://} or \code{ftp://}. If the file is not compressed
it can also start with \code{https://} or \code{ftps://}.}

\item{track.line}{Can be an integer specifying the number of track lines to skip,
"auto" to detect the header lines automatically
or FALSE(default) if the bed file doesn't have track lines.
"auto" detects both UCSC header lines and lines starting with #}
\item{split.group}{boolean, whether to split the 9th column of the file}
\item{split.char}{character that is used as a separator of the 9th column. ';' by default}
\item{filter}{a character designating which elements to retain from the gff file (e.g. exon, CDS, ...)}

\item{zero.based}{\code{boolean} whether the coordinates are 0 or 1 based. 0 is the default}
Expand Down
7 changes: 5 additions & 2 deletions man/plotTargetAnnotation-methods.Rd
Expand Up @@ -6,10 +6,11 @@
\alias{plotTargetAnnotation,AnnotationByFeature-method}
\title{Plot annotation categories from AnnotationByGeneParts or AnnotationByFeature}
\usage{
plotTargetAnnotation(x,precedence=TRUE,col,...)
plotTargetAnnotation(x, precedence = TRUE,
col = getColors(length(x@annotation)), cex.legend = 1, ...)

\S4method{plotTargetAnnotation}{AnnotationByFeature}(x, precedence = TRUE,
col = getColors(length(x@annotation)), ...)
col = getColors(length(x@annotation)), cex.legend = 1, ...)
}
\arguments{
\item{x}{a \code{AnnotationByFeature} or
Expand All @@ -23,6 +24,8 @@ This option is only valid when x is a

\item{col}{a vector of colors for piechart or the bar plot}

\item{cex.legend}{a numeric value of length 1 to specify the size of the legend. By default 1.}

\item{...}{graphical parameters to be passed to \code{pie}
or \code{barplot} functions}
}
Expand Down

0 comments on commit 9a2dbac

Please sign in to comment.