Dear Mario,
I'm not sure I understand your question yet. It sounds like you have already stored these two SummarizedExperiment objects in a MultiAssayExperiment? Are you unable to access or manipulate the data in the way you want in the way you've constructed your MultiAssayExperiment, and if so, what do you want to do that you aren't able to do?
One comment of yours:
In some cases i have different data from two lesions of the same patient.
As a general principle, we designed the MultiAssayExperiment interface under the assumption that its colData should contain one row per biological unit. If you thought of your multiple lesions as simple technical replicates that you wanted to merge using the mean measurement, for example, then you could have one patient per row in the MultiAssayExperiment colData, associated to multiple columns of the SummarizedExperiments. You then have tools to identify and merge these replicates (?MultiAssayExperiment-helpers
).
However it seems more likely that multiple lesions within a patient are distinct biological units, that you might want to model with random effects or something that explicitly models within-patient, across-patient within-group, and across-group variability. In this case you would want to represent each lesion as a row in the MultiAssayExperiment colData, with a "patient" column indicating which patient the lesion is from. When extracting using e.g. wideFormat(), you could maintain this "patient" column while keeping one row per lesion in the resulting wide-format DataFrame.
By the way, from what you've described, I see nothing unusual about your SummarizedExperiment and MultiAssayExperiment setup.
Could you please provide an example of how to encode the following SummarizedExperiments in the MultiAssayExperiment colData.
SE1:
SE2:
This would be your MultiAssayExperiment colData (where HCA and HCB in the rownames would be replaced by unique identifiers if you repeat HCA and HCB as lesion identifiers in multiple biopsies.
And the MultiAssayExperiment sampleMap would look like this, although it can be auto-generated by the constructor in this simple example and in any case where the colnames of your SummarizedExperiments each map to a single row of the MultiAssayExperiment colData - you only have to specify the sampleMap yourself when that isn't the case:
Giving up on Markdown, here is the text colData:
Ok, I'll try it next time. I wasn't sure it was possible to encode this. Mainly the biological unit can be interpreted differently: a biological unit is the type of lesion or the patient or the biopsy; depending on the question it can be either of them. Many thanks for resolving the issue.
PS: I didn't thought to use the code formatting... but I edited the question to make clearer the phenoData of each SE.