waldronlab / MultiAssayExperiment

Bioconductor package for management of multi-assay data
https://waldronlab.io/MultiAssayExperiment/
69 stars 32 forks source link

Error in proxy[i, ..., drop = FALSE] : incorrect number of dimensions #277

Closed swvanderlaan closed 4 years ago

swvanderlaan commented 4 years ago

Hi,

First of all: thank you for this awesome package.

I am trying to combine to assays in one MultiAssayExperiment. When I use the try function it seems to be alright. See below. But when I try to actually combine them, it doesn't (see below). I don't get why not. What I am I missing/overlooking?

Thanks!

Sander

My try code:

cat("*Prepping and checking out the potential for a MultiAssayExperiment dataset ...\n")
objlist
dfmap
dim(AEDB_all)
try(prepMultiAssay(ExperimentList = objlist, colData = AEDB_all, sampleMap = dfmap)$experiments,
    outFile = stdout())

The try output:

*Prepping and checking out the potential for a MultiAssayExperiment dataset ...
$`AEMS450K1 blood (B-values)`
class: SummarizedExperiment 
dim: 276373 93 
metadata(4): creationDate author BBMRIomicsVersion note
assays(1): ''
rownames(276373): cg01707559 cg03244189 ... ch.22.46830341F ch.22.1008279F
rowData names(27): addressA addressB ... Regulatory_Feature_Group DHS
colnames(93): 8918692001_R01C02 8918692001_R05C01 ... 9221198164_R04C02 9221198164_R05C02
colData names(27): STUDY_NUMBER AEMS450K ... Basename ID

$`AEMS450K1 blood (M-values)`
class: SummarizedExperiment 
dim: 276373 93 
metadata(4): creationDate author BBMRIomicsVersion note
assays(1): ''
rownames(276373): cg01707559 cg03244189 ... ch.22.46830341F ch.22.1008279F
rowData names(27): addressA addressB ... Regulatory_Feature_Group DHS
colnames(93): 8918692001_R01C02 8918692001_R05C01 ... 9221198164_R04C02 9221198164_R05C02
colData names(27): STUDY_NUMBER AEMS450K ... Basename ID

DataFrame with 186 rows and 3 columns
                         assay   primary           colname
                      <factor> <numeric>       <character>
1   AEMS450K1 blood (B-values)       622 8918692001_R01C02
2   AEMS450K1 blood (B-values)      1409 8918692001_R05C01
3   AEMS450K1 blood (B-values)      1203 8918692002_R03C02
4   AEMS450K1 blood (B-values)       172 8918692002_R04C01
5   AEMS450K1 blood (B-values)        13 8918692004_R06C02
...                        ...       ...               ...
182 AEMS450K1 blood (M-values)      1324 9221197166_R04C02
183 AEMS450K1 blood (M-values)      1334 9221197166_R05C02
184 AEMS450K1 blood (M-values)       987 9221198164_R01C01
185 AEMS450K1 blood (M-values)      1230 9221198164_R04C02
186 AEMS450K1 blood (M-values)      1550 9221198164_R05C02
[1] 3727 1037
ExperimentList class object of length 2: 
 [1] AEMS450K1 blood (B-values): SummarizedExperiment with 276373 rows and 93 columns 
 [2] AEMS450K1 blood (M-values): SummarizedExperiment with 276373 rows and 93 columns 

My MultiAssayExperiment code:

AEMS450K.MultiAssay <- MultiAssayExperiment(experiments = objlist,
                                      colData = AEDB_all,
                                      sampleMap = dfmap)

The error message:

Error in proxy[i, ..., drop = FALSE] : incorrect number of dimensions
LiNk-NY commented 4 years ago

Hi Sander, @swvanderlaan It is difficult to reproduce your error without an small reproducible example.

You can use prepMultiAssay in the following way:

complist <- prepMultiAssay(ExperimentList, colData, sampleMap)

MultiAssayExperiment(
    experiments = complist[["experiments"]],
    colData = complist[["colData"]],
    sampleMap = complist[["sampleMap"]]
)

I hope this helps. Best, Marcel

swvanderlaan commented 4 years ago

Yes, sorry about not having the data. This https://github.com/waldronlab/MultiAssayExperiment/issues/277#issuecomment-634213625 option doesn't work. I get the same error.

Here is the traceback:

15. vec_index(x, i, ...) 
14. `[.vctrs_vctr`(structure(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 3, NA, NA, 3, NA, 5, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ... 
13. .Primitive("[")(structure(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 3, NA, NA, 3, NA, 5, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ... 
12. do.call(`[`, args) 
11. do.call(`[`, args) 
10. FUN(X[[i]], ...) 
9. FUN(X[[i]], ...) 
8. lapply(as.list(x), extractROWS, i) 
7. lapply(as.list(x), extractROWS, i) 
6. extractROWS(x, i) 5. extractROWS(x, i) 
4. colData[keep_colData, , drop = FALSE] 
3. colData[keep_colData, , drop = FALSE] 
2. .harmonize(experiments, colData, sampleMap) 
1. MultiAssayExperiment(experiments = objlist, colData = AEDB_all, sampleMap = dfmap)

I don't see what I am doing wrong:

This is the correct mapping, right?

And I have colData rows summing up to 186, which equals 2 assays of each 93 samples...

So what am I missing?

LiNk-NY commented 4 years ago

Hi Sander, @swvanderlaan

Unfortunately, I am unable to reproduce the issue with the examples that you provided. If you'd like further assistance, please provide a minimally reproducible example. https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Best, Marcel

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you for your contributions.