Skip to content

Commit

Permalink
Merge pull request #36 from transmart/SmartR-1.0
Browse files Browse the repository at this point in the history
fixed probe aggregation error message
  • Loading branch information
sherzinger authored Jun 28, 2016
2 parents d656f30 + b011a08 commit 11fe376
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -925,17 +925,12 @@ writeDataForZip <- function(df, zScores, pidCols) {
## and sample measurements. Probes are merged according to maxMean, this means the row with highest mean
## intensity for same biomarker will be retained.
aggregate.probes <- function(df) {

if(nrow(df)<2){
stop("Cannot aggregate probes: there only is data for a single probe (ie. only one row of data) or
there is insufficient bio.marker information for the selected probes to be able to match the probes to
biomarkers for aggregation (e.g. in case of micro-array data to match probe ID to gene symbol).
Suggestion: skip probe aggregation.")
if (ncol(df) <= 3) {
stop("Cannot aggregate probes with single sample.")
}

measurements <- df[,3:ncol(df)]


row.names(measurements) <- df[,1]
collapsed <- collapseRows(measurements, df[,2], df[,1], "MaxMean",
connectivityBasedCollapsing = FALSE, #in Rmodules = TRUE. In our spec, not required
Expand Down
4 changes: 0 additions & 4 deletions web-app/HeimScripts/heatmap/preprocess.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ main <- function(aggregate=FALSE) {

df <- loaded_variables[grep("highDimensional", names(loaded_variables))]

if (aggregate && is.null(dim(df))) {
stop("Cannot aggregate probes: there only is data for a single probe (ie. only one row of data) or there is insufficient bio.marker information for the selected probes to be able to match the probes to biomarkers for aggregation (e.g. in case of micro-array data to match probe ID to gene symbol). Suggestion: skip probe aggregation.")
}

## High dimensional data
df <- mergeFetchedData(loaded_variables[grep("highDimensional", names(loaded_variables))])
## Low dimensional data
Expand Down

0 comments on commit 11fe376

Please sign in to comment.