import scanpy.api as sc
sc.settings.set_figure_params(dpi=70)  # dots (pixels) per inch determine size of inline figures

"""
Explanation: Plotting 1.3M cells
End of explanation
"""


filename = './write/subsampled.h5ad'

"""
Explanation: We illustrate the concept using the subsampled data, simply replace the filename... An indepth analysis with 1.3M cells will follow in the first half of 2018.
End of explanation
"""


adata = sc.read(filename, backed='r')  # open file in backed mode for reading ('r')
sc.pl.tsne(adata, color='louvain_groups')

sc.logging.print_memory_usage()

"""
Explanation: Opening an '.h5ad' file in "backed" mode does not load the data into memory.
End of explanation
"""


adata = sc.read(filename, backed=False)  # backed=False is the default of sc.read(...)

sc.logging.print_memory_usage()

"""
Explanation: Loading the data in "memory" mode needs 100 MB for the subsampled data.
End of explanation
"""


