File: view_manager.rst

package info (click to toggle)
python-loompy 3.0.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,316 kB
  • sloc: python: 3,152; sh: 63; makefile: 16
file content (24 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ViewManager (class)
===================

The ViewManager is used by the LoomConnection.view attribute to return an in-memory :class:`.LoomView` of a slice through the dataset. Examples:

.. highlight:: python
.. code-block:: python

    with loompy.connect("mydataset.loom") as ds:
        myview = ds.view[:100, :100]  # Top-left 100x100 corner of the dataset
        print(myview.ra.Gene)  # Will print the 100 genes that are in the view

Views can also be created manually:

.. highlight:: python
.. code-block:: python

    with loompy.connect("mydataset.loom") as ds:
        vm = loompy.ViewManager(ds)  # Create a view manager (this does not load any data)
        myview = vm[:100, :100]  # This returns a view of the top-left 100x100 corner

.. autoclass:: loompy.ViewManager
    :members:
    :undoc-members: