Answers.Body: <p>DESeqDataSetFrom<strong>Matrix</strong> but a SummarizedExperiment is not a matrix. Use the function <code>DESeqDataSet()</code> instead and make sure the <code>design</code> argument is followed by a <code>=</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-26T21:20:00.910Z
Answers.LastActivityDate: 2023-01-26T21:20:00.910Z
Answers.UserDisplayName: ATpoint
Body: <p>I'm tryig to perform RKM normalization on raw counts for RNA-Seq Data:</p>
  <pre><code>counts_data &lt;- exprs181517[,-1]
  #Setting title col to rownames for pheno data 
  rownames(pheno.data181517) &lt;- NULL
  rownames(counts_data) &lt;- exprs181517[,1]
  phenoColData &lt;- tibble::column_to_rownames(pheno.data181517, &quot;title&quot;)
  colnames(counts_data) &lt;- rownames(phenoColData)
  #Defining the design column
  designCol &lt;- as.data.frame(phenoColData$characteristics_ch1)
  rownames(designCol) &lt;- rownames(phenoColData)
  
  #Creating a summarized experiment
  se &lt;- SummarizedExperiment(list(counts=counts_data), colData=phenoColData)
  
  DESeqDataSetFromMatrix(se, design ~ designCol)
  </code></pre>
  <p>but I keep getting this error:</p>
  <pre><code>Error in h(simpleError(msg, call)) :
    error in evaluating the argument 'x' in selecting a method for function 'as.matrix':
      no method for coercing this S4 class to a vector
  </code></pre>
  
Tags: <rna-seq><bioconductor><normalization>
Title: Error while using SummarizedExperiment() in R
ThreadText: # Error while using SummarizedExperiment() in R
  
  (Asked by: username_0 on 2023-01-26)
  
  I'm tryig to perform RKM normalization on raw counts for RNA-Seq Data:
  
  ```
  counts_data <- exprs181517[,-1]
  #Setting title col to rownames for pheno data 
  rownames(pheno.data181517) <- NULL
  rownames(counts_data) <- exprs181517[,1]
  phenoColData <- tibble::column_to_rownames(pheno.data181517, "title")
  colnames(counts_data) <- rownames(phenoColData)
  #Defining the design column
  designCol <- as.data.frame(phenoColData$characteristics_ch1)
  rownames(designCol) <- rownames(phenoColData)
  
  #Creating a summarized experiment
  se <- SummarizedExperiment(list(counts=counts_data), colData=phenoColData)
  
  DESeqDataSetFromMatrix(se, design ~ designCol)
  
  ```
  
  but I keep getting this error:
  
  ```
  Error in h(simpleError(msg, call)) :
    error in evaluating the argument 'x' in selecting a method for function 'as.matrix':
      no method for coercing this S4 class to a vector
  
  ```
  
  **Tags:** rna-seq, bioconductor, normalization
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-01-26. Score: 2
  
  DESeqDataSetFrom**Matrix** but a SummarizedExperiment is not a matrix. Use the function `DESeqDataSet()` instead and make sure the `design` argument is followed by a `=`.
  
  
  ---
  
  