# Pre-processing and filtering CITE-Seq data

**URL:** <https://discourse.scverse.org/t/pre-processing-and-filtering-cite-seq-data/164>\
**Category:** scvi-tools\
**Created:** [August 12, 2021, 3:30am UTC](https://discourse.scverse.org/t/pre-processing-and-filtering-cite-seq-data/164 "2021-08-12T03:30:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milcah](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Milcah](https://discourse.scverse.org/u/Milcah)\
**Post date:** [August 12, 2021, 3:30am UTC](https://discourse.scverse.org/t/pre-processing-and-filtering-cite-seq-data/164/1 "2021-08-12T03:30:32Z")

</div>

The scvi-tools tutorials datasets are pre filtered to eliminate doublets and low-quality cells and genes as detailed in the [TotalVI paper](https://www.biorxiv.org/content/10.1101/2020.05.08.083337v1.full.pdf). Can scvi-tools can be used to filter data sets?

I used Seurat in RStudio to clean up my data set to get rid of doublets, cells with \< 200 genes, and cells with high mitochondrial and ribosomal RNA. I tried to convert the Seurat object into a h5ad file that I can open in Spyder (Python 3.8) but this file was not recognizable by scvi-tools.

What is the best way to filter the data easily (I find Seurat easy to use) and then use scvi-tools for analyses and figures?

##Export and use python tools  
library(Seurat)  
library(SeuratData)  
library(SeuratDisk)

SaveH5Seurat(data, filename = “filtered-data.h5ad”)  
Convert(“filtered-data.h5ad”, dest = “h5ad”)

---

<div class="post-metadata">

**Author:** ![adamgayoso](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/adamgayoso/32/100_2.png) [@adamgayoso](https://discourse.scverse.org/u/adamgayoso)\
**Post date:** [August 12, 2021, 11:40pm UTC](https://discourse.scverse.org/t/pre-processing-and-filtering-cite-seq-data/164/2 "2021-08-12T23:40:21Z")

</div>

Conversion can indeed be tricky, especially in the CITE-seq case. I believe the code shared here might have a bug and need to be as follows:

```auto
SaveH5Seurat(data, filename = “filtered-data.h5seurat”)
Convert(“filtered-data.h5seurat”, dest = “h5ad”)

```

But you can always also save everything in csv format and load into python separately.
