I have a range of analysed microarray datasets (stored as limma:MArrayLM objects in an R list, fits) and want to make summaries for specific genes across all of the datasets. The hierarchical modelling for the cross-dataset analysis will be done with jags.
I'm currently setting up the dataset to pass to jags; this will look like:
dataset : gene : probeCoef 1 : 1 : 0.234 1 : 1 : 0.345 # multiple probes for each gene 1 : 1 : 0.789 # within a dataset 1 : 2 : -0.1 2 : 1 : 0.33 # A given gene can have different 2 : 1 : 0.79 # numbers of probes between datasets 2 : 2 : 0.3 2 : 2 : -0.5 ....
Datasets are numbered from 1 to D, Genes are numbered from 1 to G; only genes that are present in every dataset are considered.
The MArrayLM objects, fits[] to fits[[D]], each have a $coefficients table (from where the probeCoef is pulled out) and an entry in $genes giving the entrez.gene id for each row (these are mapped into 1..G so jags can use them as an index).
A function to pull out the probe coefficients and map the entrez-ids to gene indices should be pretty straightforward to write but I can't quite work out how to test it. To do this I'd need to be able to create MArrayLM objects containing specific values (preferably without creating an eset and passing this through lmFit, for the sake of speed).