gabrielodom / pathwayPCA

integrative pathway analysis with modern PCA methodology and gene selection
https://gabrielodom.github.io/pathwayPCA/
11 stars 2 forks source link

Add error to TransposeAssay() if a matrix object is supplied #87

Open gabrielodom opened 4 years ago

gabrielodom commented 4 years ago

When we call the TransposeAssay() function on a matrix object, we gen an unintuitive error:

> TransposeAssay(some_matrix)
Error in data.frame(..., check.names = FALSE) : 
  arguments imply differing number of rows: 0, 82
> TransposeAssay(some_matrix, omeNames = "rowNames")
Error in class(transpose_df) <- class(assay_df) : 
  invalid to set the class to matrix unless the dimension attribute is of length 2 (was 0)

We need a better error to tell the user to turn the object into a data frame or tibble first.