Skip to content

Commit

Permalink
Merge branch 'master' into devel
Browse files Browse the repository at this point in the history
* master: (30 commits)
  increase visualTest threshold
  pass other r check arg
  pass r check arg
  fix link to dendrogram
  New mrkHClust function to plot a dendrogram of subcellular markers
  unit test for knntl logging and none
  private ThetaRegRes nologging function
  Parametrise logging in knntlOptimisation to reduce object size
  add plot3D fig
  remove using animate
  set visualTest threshold for different hosts
  fix link to coc
  code of conduct
  depend on MangoTheCat/visualTest
  suggest rmarkdown
  rmarkdown pack in travis
  add travis file
  remove unexported fun's rd
  fix testing errors
  fix rd warnings
  ...

From: Laurent <lg390@cam.ac.uk>

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/pRoloc@120773 bc3139a8-67e5-0310-9ffc-ced21a209358
  • Loading branch information
Laurent Gatto committed Sep 6, 2016
1 parent b95ac24 commit 3c0892f
Show file tree
Hide file tree
Showing 30 changed files with 1,412 additions and 889 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ vignettes/figure/
README.md
vignettes/pRoloc-tutorial.pdf
sandbox
.travis.yml
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
language: r
r: bioc-devel
cache: packages
sudo: true

before_install:
- tlmgr install bera nowidow parnotes marginfix etoolbox titlesec sectsty framed enumitem parskip soul placeins footmisc changepage xstring caption mathtools

apt_packages:
- libnetcdf-dev
- texlive-full

r_packages:
- covr

r_github_packages:
- MangoTheCat/visualTest

r_check_args:
--no-vignettes
--no-build-vignettes

after_success:
- Rscript -e 'covr::codecov()'

# print timings (of examples) and sysinfo
after_script:
- dump_logs_by_extension "timings"
- dump_sysinfo

notifications:
email:
on_success: lg390@cam.ac.uk
on_failure: lg390@cam.ac.uk

30 changes: 30 additions & 0 deletions CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect
all people who contribute through reporting issues, posting feature
requests, updating documentation, submitting pull requests or patches,
and other activities.

We are committed to making participation in this project a
harassment-free experience for everyone, regardless of level of
experience, gender, gender identity and expression, sexual
orientation, disability, personal appearance, body size, race,
ethnicity, age, or religion.

Examples of unacceptable behavior by participants include the use of
sexual language or imagery, derogatory comments or personal attacks,
trolling, public or private harassment, insults, or other
unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit,
or reject comments, commits, code, wiki edits, issues, and other
contributions that are not aligned to this Code of Conduct. Project
maintainers who do not follow the Code of Conduct may be removed from
the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior
may be reported by opening an issue or contacting one or more of the
project maintainers.

This Code of Conduct is adapted from the Contributor Covenant, version
1.0.0, available from http://contributor-covenant.org/version/1/0/0/
10 changes: 8 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pRoloc
Type: Package
Title: A unifying bioinformatics framework for spatial proteomics
Version: 1.13.12
Version: 1.13.13
Authors@R: c(person(given = "Laurent", family = "Gatto",
email = "lg390@cam.ac.uk",
role = c("aut","cre")),
Expand Down Expand Up @@ -38,7 +38,8 @@ Imports:
proxy,
FNN,
BiocGenerics,
stats,
stats,
dendextend,
RColorBrewer,
scales,
MASS,
Expand All @@ -53,12 +54,15 @@ Imports:
graphics
Suggests:
testthat,
rmarkdown,
visualTest,
pRolocdata (>= 1.9.4),
roxygen2,
synapter,
xtable,
tsne,
hexbin,
rgl,
BiocStyle,
hpar,
dplyr,
Expand Down Expand Up @@ -99,6 +103,8 @@ Collate:
phenodisco.R
plotting.R
plotting2.R
plotting3.R
hclust.R
environment.R
utils.R
lopims.R
Expand Down
10 changes: 8 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ importFrom("graphics", "abline", "axis", "grid", "legend", "matlines",
"text", "par", "mtext", "barplot")
importFrom("stats", "as.formula", "cmdscale", "cov", "dist", "kmeans",
"mahalanobis", "median", "prcomp", "qchisq", "quantile",
"update", "var", "rmultinom", "na.omit")
"update", "var", "rmultinom", "na.omit", "hclust",
"as.dendrogram")
importFrom("utils", "combn", "head", "menu", "packageDescription",
"packageVersion", "read.csv", "setTxtProgressBar",
"txtProgressBar")

importFrom("dendextend", "set")

importMethodsFrom(MLInterfaces, MLearn,
predScore, predScores,
predictions)
Expand All @@ -34,7 +37,7 @@ importFrom(biomaRt, getBM,
listAttributes)

importFrom(ggplot2, ggplot, geom_point, theme, scale_size_continuous,
xlab, ylab, scale_y_discrete, geom_text,
xlab, ylab, scale_y_discrete, geom_text, aes,
scale_color_manual, element_text, scale_x_discrete)

## Importing to avoid 'no visible global function definition for' NOTES
Expand Down Expand Up @@ -81,6 +84,7 @@ exportMethods(chi2,
f1Count,
levelPlot,
plot,
plot3D,
## clustering
## kmeansClustering,
## kmeansOptimisation, kmeansOptimization,
Expand Down Expand Up @@ -116,7 +120,9 @@ export(## MSnSet manipulation
move2Ds,
addLegend,
plotDist,
mrkHClust,
highlightOnPlot,
highlightOnPlot3D,
SpatProtVis,
orgQuants,
## -- data checks
Expand Down
9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
CHANGES IN VERSION 1.13.13
--------------------------
o Added plot3D, equivalent to plot2D, but using rgl in 3 dimensions
<2016-09-03 Sat>
o Parametrise logging in knntlOptimisation to reduce object size
<2016-09-06 Tue>
o New mrkHClust function to plot a dendrogram of subcellular markers
<2016-09-06 Tue>

CHANGES IN VERSION 1.13.12
--------------------------
o Remove verbose argument from getMarkerClasses function
Expand Down
54 changes: 54 additions & 0 deletions R/hclust.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
##' This functions calculates an average protein profile for each
##' marker class (proteins of unknown localisation are ignored) and
##' then generates a dendrogram representing the relation between
##' marker classes. The colours used for the dendrogram labels are
##' taken from the default colours (see \code{\link{getStockcol}}) so
##' as to match the colours with other spatial proteomics
##' visualisations such as \code{\link{plot2D}}.
##'
##' @title Draw a dendrogram of subcellular clusters
##' @param object An instance of class \code{MSnSet}.
##' @param fcol Feature meta-data label (fData column name) defining
##' the groups to be differentiated using different
##' colours. Default is \code{markers}.
##' @param distargs A \code{list} of arguments to be passed to the
##' \code{\link[stats]{dist}} function.
##' @param hclustargs A \code{list} of arguments to be passed to the
##' \code{\link[stats]{hclust}} function.
##' @param plot A \code{logical} defining whether the dendrogram
##' should be plotted. Default is \code{TRUE}.
##' @param ... Additional parameters passed when plotting the
##' \code{\link[stats]{dendrogram}}.
##' @return Invisibly returns a matrix of average occupancy profiles
##' for all marker classes defined in \code{fcol}.
##' @author Laurent Gatto
##' @examples
##' library("pRolocdata")
##' data(dunkley2006)
##' mrkHClust(dunkley2006)
mrkHClust <- function(object, fcol = "markers",
distargs, hclustargs,
plot = TRUE,
...) {
object <- markerMSnSet(object)
mm <- getMarkers(object, fcol = fcol, verbose = FALSE)
umm <- levels(factor(mm))
fmat <- matrix(NA, nrow = length(umm), ncol = ncol(object))
rownames(fmat) <- umm
colnames(fmat) <- sampleNames(object)
for (m in umm)
fmat[m, ] <- colMeans(exprs(object[mm == m, ]), na.rm = TRUE)
## handling additional dist args
if (missing(distargs)) distargs <- list(x = fmat)
else distargs <- c(list(x = fmat), distargs)
d <- do.call(dist, distargs)
## handling additional hclust args
if (missing(hclustargs)) hclustargs <- list(d = d)
else hclustargs <- c(list(d = d), hclustargs)
hc <- do.call(hclust, hclustargs)
hc <- as.dendrogram(hc)
i <- match(labels(hc), umm)
hc <- set(hc, "labels_colors", getStockcol()[i])
if (plot) plot(hc, ...)
invisible(fmat)
}
6 changes: 4 additions & 2 deletions R/machinelearning-framework-theta.R
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,10 @@ combineThetaRegRes <- function(object) {
.predictions <- do.call(c, lapply(object, function(z) z@predictions))
.cmMatrices <- do.call(c, lapply(object, function(z) z@cmMatrices))
.f1Matrices <- do.call(c, lapply(object, function(z) z@f1Matrices))
.names <- paste("times", 1:.times, sep="")
names(.f1Matrices) <- .names
if (length(.f1Matrices) > 0) {
.names <- paste("times", 1:.times, sep = "")
names(.f1Matrices) <- .names
}
.otherWeights <- do.call(c, lapply(object, function(z) z@otherWeights))
.ds <- object[[1]]@datasize
.test.partitions <- vector("list", 2)
Expand Down
Loading

0 comments on commit 3c0892f

Please sign in to comment.