Dear Bioconductor Supporters,
I am new to R. The solution might be proper understanding of the nature of object classes, data structures and 'wrangling' the same.
I have a custom Nimblegen microarray dataset with clear batch effects that I want to address with the package sva (surrogate variables analysis). I have successfully found the data quality result by using 'arrayQualityMetrics' run on the RGList object, so it seems that there is a solution, since arrayQualityMetrics also needs to convert the RGList object to other classes.
The specific problem is with an NChannelSet ‘convert’ed from an RGList (pair files read in by Ringo 'readNimblegen' with a targets file that has covariates of interest).
To run 'sva' going forward I need to get the NChannelSet, made from an RGList object using 'convert' function 'as(RGListobj, "NChannel")] into an ExpressionSet class object. On p. 57 of the Biobase manual there is an example for NChannelSet-class:
## G channel as ExpressionSet
channel(obj, "G")
I did this and it worked:
> testG <- channel(NChan_object, “G”) where ‘NChan_object’ has 15 columns of data-dimension green “G” and red “R” channel elements of interest.
So I got half the data. But when I repeat the function with “R” character in the 'channel' function of Biobase, instead of getting the other half in another object 'testR' (that I plan I would next bind with the G object [will this strategy work?]), I get the error:
> testR <- channel(Sb750raw_Nchan,"R")
Error in validObject(.Object) :
invalid class “NChannelSet” object: sampleNames differ between phenoData and protocolData.
Here is a link to load the RGList class data at issue [can easily be made into NChannelSet object using 'as(RGListobj, "NChannel") described above]:
http://apps.biol.ttu.edu/shared/Sb750rawnewRG.zip
I have omitted the last part of the 'traceback()' output to fit the post, and below that the sessionInfo().
Thank you for your kind consideration and support!
Chris Rock, Assoc Prof, Biological Sciences, Texas Tech University
________________________________
Error in validObject(.Object) :
invalid class “NChannelSet” object: sampleNames differ between phenoData and protocolData
> traceback()
24: stop(msg, ": ", errors, domain = NA)
23: validObject(.Object)
22: .nextMethod(.Object, ...)
21: eval(expr, envir, enclos)
20: eval(call, callEnv)
19: callNextMethod(.Object, ...)
18: .local(.Object, ...)
17: .nextMethod(.Object, assayData = assayData, phenoData = phenoData,
featureData = featureData, experimentData = experimentData,
annotation = annotation, protocolData = protocolData)
16: eval(expr, envir, enclos)
15: eval(call, callEnv)
14: callNextMethod(.Object, assayData = assayData, phenoData = phenoData,
featureData = featureData, experimentData = experimentData,
annotation = annotation, protocolData = protocolData)
13: .local(.Object, ...)
12: .nextMethod(<S4 object of class "NChannelSet">, assayData = <environment>,
phenoData = <S4 object of class "AnnotatedDataFrame">, featureData = <S4 object of class "AnnotatedDataFrame">,
experimentData = <S4 object of class "MIAME">, annotation = character(0),
protocolData = <S4 object of class "AnnotatedDataFrame">)
11: eval(expr, envir, enclos)
10: eval(call, callEnv)
9: (function (...)
{
method <- nextMethod <- NULL
dotNextMethod <- as.name(".nextMethod")
parent <- sys.parent(1)
maybeMethod <- sys.function(parent)
if
[many lines deleted]
8: do.call(callNextMethod, c(.Object, assayData = assayData, phenoData = phenoData,
dotArgs[isSlot]))
7: .local(.Object, ...)
6: initialize(object, assayData = assayData, phenoData = phenoData,
featureData = featureData(object), experimentData = experimentData(object),
annotation = annotation(object), protocolData = protocolData(object),
...)
5: initialize(object, assayData = assayData, phenoData = phenoData,
featureData = featureData(object), experimentData = experimentData(object),
annotation = annotation(object), protocolData = protocolData(object),
...)
4: selectChannels(object, name)
3: selectChannels(object, name)
2: channel(Sb750raw_Nchan, "R")
1: channel(Sb750raw_Nchan, "R")
__________________________________
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] convert_1.46.0 marray_1.48.0 limma_3.26.8
[4] Biobase_2.30.0 BiocGenerics_0.16.1