Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The correct place for this question is on the <a href="https://support.bioconductor.org" rel="nofollow noreferrer">Bioconductor</a> support site. It's better to provide a reproducible example that captures the essence of the problem; creating the reproducible example often helps to identify the reason for the problem.</p> <pre><code>library(Biobase) exprs &lt;- matrix(0, nrow=5, ncol=3, dimnames=list(letters[1:5], LETTERS[1:3])) pData &lt;- data.frame(id=c("foo", "bar", "baz"), row.names=c("x", "y", "z")) phenoData &lt;- AnnotatedDataFrame(data=pData) </code></pre> <p>leading to</p> <pre><code>&gt; ExpressionSet(exprs, phenoData=phenoData) Error in validObject(.Object) : invalid class "ExpressionSet" object: sampleNames differ between assayData and phenoData </code></pre> <p>The problem is that the <code>colname</code> of <code>exprs</code> (i.e., the names of the samples in the experiment) differ frrom the <code>row.names</code> of <code>pData</code> (i.e., the description of the samples)</p> <pre><code>&gt; row.names(pData) [1] "x" "y" "z" &gt; colnames(exprs) [1] "A" "B" "C" </code></pre> <p>and the solution is to make them the same</p> <pre><code>&gt; colnames(exprs) &lt;- row.names(pData) &gt; eset &lt;- ExpressionSet(exprs, phenoData=phenoData) &gt; eset ExpressionSet (storageMode: lockedEnvironment) assayData: 5 features, 3 samples element names: exprs protocolData: none phenoData sampleNames: x y z varLabels: id varMetadata: labelDescription featureData: none experimentData: use 'experimentData(object)' Annotation: </code></pre> <p>Additional elements can be added to an existing ExpressionSet using <code>assayDataReplace()</code>, e.g.,</p> <pre><code>&gt; assayDataElement(eset, "foo") &lt;- sqrt(exprs) &gt; eset ExpressionSet (storageMode: lockedEnvironment) assayData: 5 features, 3 samples element names: exprs, foo protocolData: none phenoData sampleNames: x y z varLabels: id varMetadata: labelDescription featureData: none experimentData: use 'experimentData(object)' Annotation: </code></pre> <p>or from the start</p> <pre><code>&gt; env = new.env() &gt; env$exprs = exprs &gt; env$sqrt = sqrt(exprs) &gt; lockEnvironment(env) &gt; ExpressionSet(env, pData=pData) ExpressionSet (storageMode: environment) assayData: 5 features, 3 samples element names: exprs, sqrt protocolData: none phenoData: none featureData: none experimentData: use 'experimentData(object)' Annotation: </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload