setting up MArrayLM objects for use in RUnit tests
0
0
Entering edit mode
9.0 years ago
russhh 5.7k

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[[1]] 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).

RUnit limma • 2.1k views
ADD COMMENT
0
Entering edit mode

Please disregard this query. I was able to set up everything I needed using

test.input <- new(Class = 'MArrayLM')
test.input$coefficients <- matrix(...)
test.input$genes <- data.frame(...)
ADD REPLY

Login before adding your answer.

Traffic: 2162 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6