Bioconductor / RaggedExperiment

Matrix-like representations of mutation and CN data
https://bioconductor.org/packages/RaggedExperiment
4 stars 3 forks source link

Error: isTRUEorFALSE(na.rm) is not TRUE #4

Closed lwaldron closed 7 years ago

lwaldron commented 7 years ago

Is this an expected error (RaggedExperiment_1.1.1 and 1.1.2)?

> qreduceAssay(ra, query = gistic,
+                     simplify = mean,
+                     i = "score",
+                     background = 0)
Each of the 2 combined objects has sequence levels not in the other:
  - in 'x': X
  - in 'y': 9, 13, 16, 21, 23
  Make sure to always combine/compare objects based on the same reference
  genome (use suppressWarnings() to suppress this warning).Error: isTRUEorFALSE(na.rm) is not TRUE
> 

Since GH doesn't allow .rda: re.rda.zip

lwaldron commented 7 years ago

Actually here's a much simpler dataset to reproduce the error:

> library(RaggedExperiment)
> example("RaggedExperiment")
> re <- RaggedExperiment(sample1=sample1, sample2=sample2)
> qreduceAssay(re, query = sample1, simplify=mean)
Error: isTRUEorFALSE(na.rm) is not TRUE
> qreduceAssay(re, query = sample1, simplify=function(x, y, z, ...) max(x, y, z, ...), i="x")
Error in .local(x, ..., na.rm) : 
  unused arguments (<S4 object of class "GRanges">, na.rm)
> 
mtmorgan commented 7 years ago

from the docs ?qreduceAssay, describing the argument simplify

          qreduceAssay: A 'function' accepting arguments 'score',
          'range', and 'qrange':

            • 'score' A '*List', where each list element corresponds to
              a cell in the matrix to be returned by 'qreduceAssay'.
              Vector elements correspond to ranges overlapping query.
              The '*List' objects support many vectorized mathematical
              operations, so 'simplify' can be implemented efficiently.

            • 'range' A 'GRangesList' instance, 'parallel' to 'score'.
              Each element of the list corresponds to a cell in the
              matrix to be returned by 'qreduceAssay'. Each range in
              the element corresponds to the range for which the
              'score' element applies.

            • 'qrange' A 'GRanges' instance with the same length as
              'score', providing the query range to which the
              corresponding scores apply.

and mean and the lambda don't satisfy this.

lgeistlinger commented 7 years ago

That has been clarified by distinguishing between simplifyDisjoin and simplifyReduce. When accordingly applying it with a suitable simplifyReduce function, the error no longer occurs.

I guess, the issue can thus be closed.

LiNk-NY commented 7 years ago

Thanks Ludwig @lgeistlinger