Skip to content

Commit d67ab4d

Browse files
authored
Merge pull request #202 from lgatto/reshape2
remove reshape2; see #201
2 parents abb1a0f + f1ec84d commit d67ab4d

7 files changed

+14
-13
lines changed

Diff for: DESCRIPTION

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: MSnbase
22
Title: Base Functions and Classes for Mass Spectrometry and Proteomics
3-
Version: 2.1.14
3+
Version: 2.1.15
44
Description: Manipulation, processing and visualisation
55
of mass spectrometry and proteomics data.
66
Authors@R: c(person(given = "Laurent", family = "Gatto",
@@ -52,7 +52,6 @@ Imports:
5252
preprocessCore,
5353
vsn,
5454
grid,
55-
reshape2,
5655
stats4,
5756
affy,
5857
impute,

Diff for: NAMESPACE

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ importFrom(ggplot2, geom_histogram, geom_text, geom_line, geom_point,
3232
scale_x_continuous, scale_x_log10, coord_cartesian,
3333
facet_grid)
3434

35-
import(reshape2) ## try to reduce this
36-
3735
importFrom(MALDIquant, binPeaks, match.closest) ## only using ::: functions
3836
importFrom(S4Vectors, isEmpty, metadata)
3937

Diff for: NEWS.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# MSnbase 2.1
22

3+
## Changes in version 2.1.15
4+
- Remove reshape2 dependency; see #201 <2017-04-06 Thu>
5+
36
## Changes in version 2.1.14
47
- Internal rewrite and speedup of topN; Briefly multiple apply calls are
58
avoided, `getTopIdx` and `subsetById` are replaced by `.topIdx`.

Diff for: R/functions-mzR.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ plotMzDelta_list <- function(object, ## peakLists
6868
}
6969
delta <- unlist(delta)
7070
## could round deltas to speed up?
71-
delta <- melt(delta)
72-
p <- ggplot(delta, aes(x = value)) +
71+
delta <- data.frame(value = delta)
72+
p <- ggplot(delta, aes(x = value)) +
7373
geom_histogram(aes(y = ..density..), stat = "bin", binwidth = bw) +
7474
scale_x_continuous(limits = xlim) +
7575
xlab("m/z delta") + ylab("Density") +

Diff for: R/methods-MSnSet.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,10 @@ setMethod("image", "MSnSet",
451451
## get rid of 'no visible global function definition' note
452452
sample.name <- feature.id <- Expression <- NULL
453453
isFC <- any(exprs(x) < 0, na.rm = TRUE)
454-
xlong <- melt(exprs(x))
455-
colnames(xlong) <- c("feature.id", "sample.name", "Expression")
456-
xlong[['feature.id']] <- as.character(xlong[['feature.id']])
457-
xlong[['sample.name']] <- as.character(xlong[['sample.name']])
454+
xlong <- cbind(expand.grid("feature.id" = featureNames(x),
455+
"sample.name" = sampleNames(x),
456+
stringsAsFactors=FALSE),
457+
"Expression" = as.vector(exprs(x)))
458458
xlong <- merge(xlong, fData(x), by.x = "feature.id", by.y = 0)
459459
xlong <- merge(xlong, pData(x), by.x = "sample.name", by.y = 0)
460460
x <- xlong

Diff for: R/missing-data.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
plotNA_matrix <- function(X, pNA) {
2525
pNA <- pNA[1]
2626
dfr1 <- .preparePlotNAData(X)
27-
dfr2 <- melt(dfr1, measure.vars=c("proteins", "data"))
27+
dfr2 <- data.frame(x = 1:nrow(dfr1),
28+
variable = rep(c("proteins", "data"), each = nrow(dfr1)),
29+
value = c(dfr1$proteins, dfr1$data))
2830
nkeep <- sum(dfr1$proteins >= (1 - pNA))
2931
kkeep <- dfr1$data[nkeep]
3032
x <- y <- z <- value <- variable <- NULL

Diff for: R/plotting-MSnExp.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ plotMzDelta_MSnExp <- function(object, ## MSnExp object
102102
close(pb)
103103
message(" Plotting...\n")
104104
}
105-
delta <- unlist(delta)
106-
delta <- melt(delta)
105+
delta <- data.frame(value = unlist(delta))
107106
p <- ggplot(delta, aes(x = value)) +
108107
geom_histogram(aes(y = ..density..), stat = "bin", binwidth = bw) +
109108
scale_x_continuous(limits = xlim) +

0 commit comments

Comments
 (0)