Commit de8cecbe authored by Steffen Möller's avatar Steffen Möller
Browse files

New upstream version 3.0.6+dfsg

parent 9220d620
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -76,8 +76,8 @@ docs/_build/
target/

# IPython Notebook
.ipynb_checkpoints
*.ipynb
.ipynb_checkpoints/
#*.ipynb

# pyenv
.python-version
+3 −16
Original line number Diff line number Diff line
language: python - "3.6"
language: python - "3.7"

# Maybe everything shoulb be packed in a `job` that states `include:` `if:` with some condition
before_install:
@@ -13,27 +13,14 @@ before_install:
  - sudo ln -s /run/shm /dev/shm

install:
  - conda install --yes python="3.6" numpy scipy cython h5py typing pandas
  - pip install sphinx_bootstrap_theme
  # Install the dev version (1.7) of sphinx that has solved a problem with f-strings
  - git clone https://github.com/sphinx-doc/sphinx.git
  - cd sphinx; pip install .;cd ..
  - conda install --yes python="3.7" numpy scipy cython h5py typing numba
  - pip install Sphinx sphinxcontrib-websupport sphinx_bootstrap_theme numpy-groupies

script:
  # Build documentation
  - cd doc
  - make html
  - cd ..
  # Additionally we could run some tests and.or the following commented code

# Possibility to autotag upon change of the name of the version
#after_success:
#  - git config --global user.email "builds@travis-ci.com"
#  - git config --global user.name "Travis CI" # Not sure if here it would be my username and oass
## Here I would put a python script that makes something like GIT_TAG=open("_version.py").read()
#  - export GIT_TAG=build-$TRAVIS_BRANCH-$(date -u "+%Y-%m-%d-%H-%M-%S")-$TRAVIS_BUILD_NUMBER
#  - git tag $GIT_TAG -a -m "Generated tag from TravisCI"
#  - git push --tags

deploy:
  # Automatically upload docs to github pages for master commits
+3 −19
Original line number Diff line number Diff line


# loompy 2
# loompy v3.0

⭐ Loompy v2.0 was released Dec. 24, 2017! ([what's new](https://github.com/linnarsson-lab/loompy/releases/tag/v2.0)?)
⭐ Loompy v3.0 was released Sep. 24, 2019!

`.loom` is an efficient file format for very large omics datasets, 
consisting of a main matrix, optional additional layers, a variable number of row and column 
annotations. Loom also supports sparse graphs. We use loom files to store single-cell gene expression 
data: the main matrix contains the actual expression values (one 
column per cell, one row per gene); row and column annotations 
contain metadata for genes and cells, such as `Name`, `Chromosome`, 
`Position` (for genes), and `Strain`, `Sex`, `Age` (for cells).

![Illustration of Loom format structure](/doc/Loom-images.png)

Loom files (`.loom`) are created in the [HDF5](https://en.wikipedia.org/wiki/Hierarchical_Data_Format) file format, which 
supports an internal collection of numerical multidimensional datasets.
HDF5 is supported by many computer languages, including Java, MATLAB, 
Mathematica, Python, R, and Julia. `.loom` files are accessible from 
any language that supports HDF5.

To get started, head over to [the documentation](http://linnarssonlab.org/loompy/)!
To get started, head over to [the documentation](http://loompy.org)!

Loom, loompy, and the [loom-viewer](https://github.com/linnarsson-lab/loom-viewer) are being developed by members of the [Linnarsson Lab](http://linnarssonlab.org).

assets/LoomR_logo.ai

deleted100644 → 0
−627 KiB

File deleted.

Preview size limit exceeded, changes collapsed.

+49 −22
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ Loom file format specs
Versions
--------

This specification defines the Loom file format version ``2.0.1``.
This specification defines the Loom file format version ``3.0.0``.


.. _formatinfo:
@@ -61,7 +61,7 @@ standard for storing large numerical datasets. Quoting from h5py.org:
    dictionaries, and datasets work like NumPy arrays*.

A valid Loom file is simply an HDF5 file that contains specific
*groups* representing the main matrix as well as row and column
*groups* containing the main matrix as well as row and column
attributes. Because of this, Loom files can be created and read by
any language that supports HDF5, including `Python <http://h5py.org>`__,
`R <http://bioconductor.org/packages/release/bioc/html/rhdf5.html>`__,
@@ -74,6 +74,19 @@ any language that supports HDF5, including `Python <http://h5py.org>`__,

.. _specifications:


Standards
---------

The official MIME media type for a loom file is ``application/vnd.loom``, `approved by IANA <https://www.iana.org/assignments/media-types/application/vnd.loom>`_.
You should use this media type when requesting a file using HTTP, or if you create a server that offers Loom files for download.

See the `IANA record for application/vnd.loom <https://www.iana.org/assignments/media-types/application/vnd.loom>`_ for important security considerations.

The Loom file format is designated as a standard format for gene expression matrices by the `Global Alliance for Genomics and Health (GA4GH) <https://www.ga4gh.org>`_ standards body, as part of the `rnaget API <https://github.com/ga4gh-rnaseq/schema/blob/master/rnaget.md>`_.
The rnaget API documentation contains good examples of how to use the media type specification.


Specification
-------------

@@ -91,15 +104,20 @@ Main matrix and layers
Global attributes
^^^^^^^^^^^^^^^^^

-  There can OPTIONALLY be at least one `HDF5
   attribute <https://www.hdfgroup.org/HDF5/Tutor/crtatt.html>`__ on the
   root ``/`` group, which can be any valid scalar or multidimensional datatype and should be
   interpreted as attributes of the whole Loom file. 
-  There can OPTIONALLY be an `HDF5
   attribute <https://www.hdfgroup.org/HDF5/Tutor/crtatt.html>`__ on the
   root ``/`` group named ``LOOM_SPEC_VERSION``, a string value giving the
   loom file spec version that was followed in creating the file. See top of this
   document for the current version of the spec.
-  There MUST be an HDF5 group ``/attrs`` containing global attributes.
-  There MUST be a HDF5 dataset ``/attrs/LOOM_SPEC_VERSION`` with the value ``v3.0.0``.

Global attributes apply semantically to the whole file, not any specific part of it. 
Such attributes are stored in the HDF5 group ``/attrs`` and can be any valid scalar
or multidimensional datatype.

As of Loom file format v3.0.0, only one global attribute is mandatory: the ``LOOM_SPEC_VERSION``
attribute, which is a string value giving the loom file spec version that was followed in creating
the file. See top of this document for the current version of the spec.

Note: previous versions of the loom file format stored global attributes as `HDF5 attributes <https://www.hdfgroup.org/HDF5/Tutor/crtatt.html>`__
on the root ``/`` group. However, such attributes are size-limited, which caused problems for some 
applications. 


Row and column attributes
@@ -144,6 +162,8 @@ Row and column sparse graphs
   format. The lengths of the three datasets MUST be equal, which defines the number 
   of edges in the graph. Note that the number of rows in the dataset defines 
   the vertices, so an unconnected vertex is one that has no entry in ``a`` or ``b``.
-  Vertex indexing is zero-based. When an entry in ``a`` or ``b`` is zero, this denotes the first column 
   in the matrix. If there are N columns, then vertices are numbered from 0 to N - 1. 

Datatypes
---------
@@ -154,19 +174,12 @@ Row and column attributes are multidimensional arrays whose first dimension matc

Global attributes are scalars or multidimensional arrays of any shape, whose elements are any of the numeric datatypes ``int8``, ``int16``, ``int32``, ``int64``, ``uint8``, ``uint16``, ``uint32``, ``uint64``, ``float16``, ``float32`` and ``float64`` or fixed-length ASCII strings.

All strings in Loom files are stored as fixed-length null-padded 7-bit ASCII. ``h5dump`` should report something like this:

.. code::

  DATATYPE  H5T_STRING {
    STRSIZE 24;
    STRPAD H5T_STR_NULLPAD;
    CSET H5T_CSET_ASCII;
    CTYPE H5T_C_S1;
  }
Starting with v3.0.0 of the spec, all strings are stored as variable-length UTF-8 encoded. 

Note: in previous version, strings were stored as fixed-length null-padded 7-bit ASCII. Unicode characters outside 7-bit ASCII were stored using
`XML entity encoding <https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references>`_, to ensure maximum compatibility. Strings
were decoded when read and encoded when written.

Unicode characters outside 7-bit ASCII are stored using `XML entity encoding <https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references>`_, to ensure maximum compatibility. Strings SHOULD be decoded when read and encoded when written. A compatible implementation may choose to encode/decode or not, but MUST decode on reading if it encodes on writing.

.. _loomexample:

@@ -178,6 +191,10 @@ Here's an example of the structure of a valid Loom file:
+----------------------+-------------------------------+---------------------------------------------+
| Group                | Type                          | Description                                 |
+======================+===============================+=============================================+
| /attrs/              | (subgroup)                    | Global attribbutes                          |
+----------------------+-------------------------------+---------------------------------------------+
| /attrs/Species       | string                        | Row attribute "Species" of type string      |
+----------------------+-------------------------------+---------------------------------------------+
| /matrix              | float32[N,M] or uint16[N,M]   | Main matrix of N rows and M columns         |
+----------------------+-------------------------------+---------------------------------------------+
| /layers/             | (subgroup)                    | Subgroup of additional matrix layers        |
@@ -205,3 +222,13 @@ Here's an example of the structure of a valid Loom file:



Backwards compatibility
^^^^^^^^^^^^^^^^^^^^^^^

Loom v3.0.0 introduces two major backwards-incompatible changes (global attributes and variable-length strings; see above).

A compliant Loom reader MUST check the LOOM_SPEC_VERSION and treat files consistently with their spec. For example, 
when writing a global attribute, the writer MUST write only to the ``/attrs`` group if ``LOOM_SPEC_VERSION`` is
``3.0.0`` or higher. The writer MUST write the HDF5 attributes on the root ``/``
group if ``LOOM_SPEC_VERSION`` is lower than ``3.0.0`` or if it does not exist. This is to preserve a consistent
format for legacy files.
Loading