QFeatures
QFeatures copied to clipboard
Create QFeatures from multiple files
There is a need for a constructor or an example that creates a QFeatures from multiple input files where each produces an assay. One way to do this would be to lapply over the csv files, importing each one with readSummarizedExperiment() to get a list and then use that one to manually construct the QFeatures object.
@cvanderaa - any input from your scp data experience?
I would draw your attention on the following aspects:
- The
ecolshould be constant for all files supplied toreadSummarizedExperimentunless we usemapply. - If the
ecols are constant across files, we need to rename the column names because column names in eachSummarizedExperimentshould be different between assays, otherwise this will break theSampleMapandcolData. - The
colDataof theQFeaturesobject needs to be supplied separately.
In order to automate this process, I let the user supply a metadata table. Each row holds information about a single sample (or tag in case of multiplexing). The information that the rows contain are:
- File name to extract the quantitative data from
- Name of the
ecolthat contains the quantitative data for that sample (or tag) - (optional) batch- and sample-specific variables to use to build the
colData
From this table, we can easily extract the required information to set up an mapply call (or a for loop) that automatically extracts the SummarizedExperiments and automatically builds the colData.
I think the easiest here would be to:
- iterate over all files and use
readSummarizedExperiment() - Then create the final object with
QFeatures(list(...))