title: Running DESeq2 from rpy2
body: <p>I am trying to run DESeq2 through rpy2 for the first time and am having some difficulties.</p>
  <pre class="lang-py prettyprint-override"><code>class py_DESeq2:
      
      def __init__(self, count_matrix):
          
          self.dds = None
          self.normalized_count_matrix = None
          self.vsd = None
          self.count_matrix = robjects.conversion.py2rpy(count_matrix)
          self.design_matrix = robjects.conversion.py2rpy(pd.DataFrame({'treatment':['ctrl' for i in range(count_matrix.shape[1])]}))
          self.design_formula = Formula('~ 1')
          
      def norm_counts(self, **kwargs):
          self.dds = deseq.DESeqDataSetFromMatrix(countData=self.count_matrix, colData=self.design_matrix, design=self.design_formula)
          self.vsd = deseq.varianceStabilizingTransformation(self.dds, blind=True)
          self.normed_count_matrix = deseq.assay(self.vsd)
          self.normed_count_matrix = to_dataframe(self.normed_count_matrix)
          self.normed_count_matrix = robjects.conversion.rpy2py(self.normed_count_matrix)
  </code></pre>
  <p>I get the following error at <code>self.normed_count_matrix = deseq.assay(self.vsd)</code>:</p>
  <pre class="lang-py prettyprint-override"><code>module 'DESeq2' has no attribute 'assay'
  </code></pre>
  <p>The below code in R runs fine:</p>
  <pre><code>library(DESeq2)
  countData &lt;- read.delim(&quot;0.333404867983521.R.data.in.txt&quot;)
  colData &lt;- read.delim(&quot;0.333404867983521.R.groups.in.txt&quot;)
  
  dds &lt;- DESeqDataSetFromMatrix(countData, colData,design=~Treatment,tidy=TRUE)
  norm &lt;- varianceStabilizingTransformation(dds,blind=TRUE)
  norm_matrix &lt;- assay(norm)
  norm_df &lt;- data.frame(Gene=rownames(norm_matrix), norm_matrix)
  write.table(norm_df, &quot;0.333404867983521.R.data.out.txt&quot;, row.names = FALSE,sep=&quot;\t&quot;)
  </code></pre>
  <p>The norm object is a <code>&lt;class 'rpy2.robjects.methods.RS4'&gt;</code>.</p>
  <p>There must be something I am missing here and a point in the right direction would be appreciated!</p>