In [1]:
import scpipeline
In [2]:
p =  scpipeline.ProcessPipline();

fly folder contain three files including counts.csv, coords.csv, and mapino.csv for fly midbrain single cell data (see our examples for converting Seurat object or Loom file into three csv files)

In [3]:
p.read_annotated_csv("./fly")
filtered out 20 genes that are detected in less than 1 cells
done
In [4]:
p.data
Out[4]:
AnnData object with n_obs × n_vars = 10286 × 10914 
    obs: 'n_genes', 'percent_mito', 'n_counts', 'cluster'
    var: 'n_cells'
    uns: 'mapinfo'
    obsm: 'X_tsne'

If you set rawDataIsNormalized=False, counts data will be normalized (scanpy function: sc.pp.normalize_per_cell(self.data, counts_per_cell_after=1e4) and loaded in the database; Whehter or not the raw counts data will be desposited is dependant on the saveRawCounts. Set saveRawCounts True to save raw counts data in database; if you only have Normalized data, set rawDataIsNormalized=True, only normalized data will be loaded in database.

In [5]:
p.insertToDB(dbname= 'scDB',dbport= 27017,dbhost='localhost',
                   rawDataIsNormalized=False,
                   saveRawCounts=False,  #if rawDataIsNormalized=True , function will skip this option
              );
start insert to db
success
mapid: 5d1f5834b67cc25c6f480e47

just check if mapinfo (metadata) is correct

In [6]:
p.data.uns["mapinfo"]
Out[6]:
{'study': 'flyBrain',
 'species': 'drosophila',
 'subjectid': '',
 'disease': 'Healthy',
 'source': 'Waddell2018',
 'sample': 'midbrain',
 'comment': 'from loom',
 'author': 'demo',
 'mapType': 'tsne',
 'mapname': 'Waddell_CentralBrain_10k_tSNE',
 'tissue': '',
 'name': ''}