text: user208: I have done some work in R and would like to try a Python tool.
  What is a good way to import the data (and its annotations etc) as a Python object?
  I am particularly interested in converting a Seurat object into an AnnData object. (Either directly or as a Python object which can be converted into an AnnData.)
  
  user208: A simple solution for converting Seurat objects into AnnData, as described in this vignette:
  library(reticulate)
  seuratobject_ad <- Convert(from=seuratobject, to="anndata", filename="seuratobject.h5ad")
  
  
  Alternatively, one can use Loom, "a file format designed to store and work with single-cell RNA-seq data".
  In R, install LoomR:
  devtools::install_github(repo = "mojaveazure/loomR")
  
  Convert from Seurat object to loom:
  pfile <- Convert(from = pbmc_small, to = "loom", filename = "pbmc_small.loom")
  pfile$close() # close loom objects when finished using them.
  
  Then import loom object in Python using loompy, or directly as AnnData:
  scanpy.api.read_loom
  
  Alternatively, see feather.
  
  Or export as some text format (csv, json) then import into Python.
  
original_text: 208: <p>I have done some work in R and would like to try a Python tool.</p>
  
  <p>What is a good way to <strong>import</strong> the data (and its annotations etc) <strong>as a Python object?</strong></p>
  
  <p>I am particularly interested in converting a <code>Seurat</code> object into an <a href="https://scanpy.readthedocs.io/en/latest/api/scanpy.api.AnnData.html#scanpy.api.AnnData" rel="noreferrer">AnnData</a> object. (Either directly or as a Python object which can be converted into an <code>AnnData</code>.)</p>
   208: <p>A simple solution for converting Seurat objects into AnnData, <a href="https://satijalab.org/seurat/conversion_vignette.html" rel="nofollow noreferrer">as described in this vignette</a>:</p>
  
  <pre><code>library(reticulate)
  seuratobject_ad &lt;- Convert(from=seuratobject, to="anndata", filename="seuratobject.h5ad")
  </code></pre>
  
  <hr>
  
  <p>Alternatively, one can use <a href="http://loompy.org/" rel="nofollow noreferrer">Loom</a>, <em>"a file format designed to store and work with single-cell RNA-seq data".</em></p>
  
  <p>In R, install <a href="http://satijalab.org/loomR/loomR_tutorial.html" rel="nofollow noreferrer">LoomR</a>:</p>
  
  <pre><code>devtools::install_github(repo = "mojaveazure/loomR")
  </code></pre>
  
  <p>Convert from Seurat object to loom:</p>
  
  <pre><code>pfile &lt;- Convert(from = pbmc_small, to = "loom", filename = "pbmc_small.loom")
  pfile$close() # close loom objects when finished using them.
  </code></pre>
  
  <p>Then import loom object in Python using <a href="http://linnarssonlab.org/loompy/index.html" rel="nofollow noreferrer">loompy</a>, or directly as AnnData:</p>
  
  <p><a href="http://scanpy.readthedocs.io/en/latest/api/scanpy.api.read_loom.html" rel="nofollow noreferrer"><code>scanpy.api.read_loom</code></a></p>
  
  <hr>
  
  <p>Alternatively, see <a href="https://github.com/wesm/feather" rel="nofollow noreferrer"><code>feather</code></a>.</p>
  
  <hr>
  
  <p><a href="https://stackoverflow.com/questions/46390461/the-best-way-to-import-r-object-into-python">Or export</a> as some text format (csv, json) then import into Python.</p>
  