├── .gitignore ├── .travis.yml ├── LICENSE ├── changelog.md ├── doc ├── Makefile ├── _build │ ├── doctrees │ │ ├── autoencoder-integration.doctree │ │ ├── data-normalization.doctree │ │ ├── environment.pickle │ │ ├── filtering-and-merging-latent-factors.doctree │ │ ├── index.doctree │ │ ├── maui.doctree │ │ ├── saving-and-loading-models.doctree │ │ └── utils.doctree │ └── html │ │ ├── .buildinfo │ │ ├── _images │ │ ├── colinearity-merged.png │ │ ├── colinearity.png │ │ ├── hist.png │ │ └── integration-autoencoder.png │ │ ├── _modules │ │ ├── _io.html │ │ ├── builtins.html │ │ ├── index.html │ │ ├── io.html │ │ └── maui │ │ │ ├── model.html │ │ │ └── utils.html │ │ ├── _sources │ │ ├── autoencoder-integration.rst.txt │ │ ├── data-normalization.rst.txt │ │ ├── filtering-and-merging-latent-factors.rst.txt │ │ ├── index.rst.txt │ │ ├── maui.rst.txt │ │ ├── saving-and-loading-models.rst.txt │ │ └── utils.rst.txt │ │ ├── _static │ │ ├── ajax-loader.gif │ │ ├── alabaster.css │ │ ├── basic.css │ │ ├── classic.css │ │ ├── colinearity-merged.png │ │ ├── colinearity.png │ │ ├── comment-bright.png │ │ ├── comment-close.png │ │ ├── comment.png │ │ ├── custom.css │ │ ├── doctools.js │ │ ├── documentation_options.js │ │ ├── down-pressed.png │ │ ├── down.png │ │ ├── file.png │ │ ├── hex-maui-120.png │ │ ├── hex-maui-200.png │ │ ├── hex-maui.png │ │ ├── hist.png │ │ ├── icons8-beach-30.png │ │ ├── integration-autoencoder.png │ │ ├── jquery-3.2.1.js │ │ ├── jquery.js │ │ ├── minus.png │ │ ├── plus.png │ │ ├── pygments.css │ │ ├── searchtools.js │ │ ├── sidebar.js │ │ ├── underscore-1.3.1.js │ │ ├── underscore.js │ │ ├── up-pressed.png │ │ ├── up.png │ │ └── websupport.js │ │ ├── autoencoder-integration.html │ │ ├── data-normalization.html │ │ ├── filtering-and-merging-latent-factors.html │ │ ├── genindex.html │ │ ├── index.html │ │ ├── maui.html │ │ ├── objects.inv │ │ ├── py-modindex.html │ │ ├── saving-and-loading-models.html │ │ ├── search.html │ │ ├── searchindex.js │ │ └── utils.html ├── _static │ ├── colinearity-merged.png │ ├── colinearity.png │ ├── hist.png │ ├── icons8-beach-30.png │ └── integration-autoencoder.png ├── autoencoder-integration.rst ├── conf.py ├── data-normalization.rst ├── filtering-and-merging-latent-factors.rst ├── index.rst ├── maui.rst ├── saving-and-loading-models.rst └── utils.rst ├── hex-maui.png ├── maui ├── __init__.py ├── _version.py ├── autoencoders_architectures.py ├── maui_warnings.py ├── model.py └── utils.py ├── pytest.ini ├── readme.md ├── readthedocs.yml ├── setup.cfg ├── setup.py ├── test ├── __init__.py ├── test_maui.py └── test_utils.py └── vignette └── maui_vignette.ipynb /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.egg-info 3 | build/ 4 | dist/ 5 | **/.ipynb_checkpoints 6 | vignette/data 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "3.6" 4 | # command to install dependencies 5 | install: 6 | - pip install --upgrade setuptools>=41.0.0 7 | - pip install scipy==1.2.1 8 | - pip install lifelines patsy pytest>=3.6.0 pytest-cov>=2.6.1 codecov 9 | - pip install tensorflow==1.* 10 | - pip install keras==2.2.4 11 | - python setup.py install 12 | # command to run tests 13 | script: 14 | - pytest --cov=maui/ 15 | after_success: 16 | - codecov 17 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [unreleased] - ????-??-?? 4 | 5 | ### Fixed 6 | 7 | - Fixed a bug in fine-tuning models that were pre-trained, when the pre-trained model is first deserialized from disk. 8 | 9 | ## [0.1.7] - 2019-10-08 10 | 11 | - `maui_model.transform()` no longer automatically computes feature correlations. Added a method `maui_model.get_feature_correlations()` to use when this is desirable. This is a huge performance enhancement when feature correlations aren't necessary. 12 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SOURCEDIR = . 8 | BUILDDIR = _build 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /doc/_build/doctrees/autoencoder-integration.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/doctrees/autoencoder-integration.doctree -------------------------------------------------------------------------------- /doc/_build/doctrees/data-normalization.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/doctrees/data-normalization.doctree -------------------------------------------------------------------------------- /doc/_build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/doctrees/environment.pickle -------------------------------------------------------------------------------- /doc/_build/doctrees/filtering-and-merging-latent-factors.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/doctrees/filtering-and-merging-latent-factors.doctree -------------------------------------------------------------------------------- /doc/_build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/doctrees/index.doctree -------------------------------------------------------------------------------- /doc/_build/doctrees/maui.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/doctrees/maui.doctree -------------------------------------------------------------------------------- /doc/_build/doctrees/saving-and-loading-models.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/doctrees/saving-and-loading-models.doctree -------------------------------------------------------------------------------- /doc/_build/doctrees/utils.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/doctrees/utils.doctree -------------------------------------------------------------------------------- /doc/_build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: c43a4816b99b5dc9cdac2f6e58de33c9 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /doc/_build/html/_images/colinearity-merged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_images/colinearity-merged.png -------------------------------------------------------------------------------- /doc/_build/html/_images/colinearity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_images/colinearity.png -------------------------------------------------------------------------------- /doc/_build/html/_images/hist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_images/hist.png -------------------------------------------------------------------------------- /doc/_build/html/_images/integration-autoencoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_images/integration-autoencoder.png -------------------------------------------------------------------------------- /doc/_build/html/_modules/_io.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | _io — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 | 32 |
33 | 34 |

Source code for _io

 35 | 
 36 | 
37 | 38 |
39 | 40 |
41 |
42 | 93 |
94 |
95 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /doc/_build/html/_modules/builtins.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | builtins — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 | 32 |
33 | 34 |

Source code for builtins

 35 | 
 36 | 
37 | 38 |
39 | 40 |
41 |
42 | 93 |
94 |
95 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /doc/_build/html/_modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Overview: module code — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
32 | 33 | 34 |
35 | 36 |

All modules for which code is available

37 | 40 | 41 |
42 | 43 |
44 |
45 | 98 |
99 |
100 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /doc/_build/html/_modules/io.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | io — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 | 32 |
33 | 34 |

Source code for io

 35 | """The io module provides the Python interfaces to stream handling. The
 36 | builtin open function is defined in this module.
 37 | 
 38 | At the top of the I/O hierarchy is the abstract base class IOBase. It
 39 | defines the basic interface to a stream. Note, however, that there is no
 40 | separation between reading and writing to streams; implementations are
 41 | allowed to raise an OSError if they do not support a given operation.
 42 | 
 43 | Extending IOBase is RawIOBase which deals simply with the reading and
 44 | writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
 45 | an interface to OS files.
 46 | 
 47 | BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
 48 | subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
 49 | streams that are readable, writable, and both respectively.
 50 | BufferedRandom provides a buffered interface to random access
 51 | streams. BytesIO is a simple stream of in-memory bytes.
 52 | 
 53 | Another IOBase subclass, TextIOBase, deals with the encoding and decoding
 54 | of streams into text. TextIOWrapper, which extends it, is a buffered text
 55 | interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
 56 | is an in-memory stream for text.
 57 | 
 58 | Argument names are not part of the specification, and only the arguments
 59 | of open() are intended to be used as keyword arguments.
 60 | 
 61 | data:
 62 | 
 63 | DEFAULT_BUFFER_SIZE
 64 | 
 65 |    An int containing the default buffer size used by the module's buffered
 66 |    I/O classes. open() uses the file's blksize (as obtained by os.stat) if
 67 |    possible.
 68 | """
 69 | # New I/O library conforming to PEP 3116.
 70 | 
 71 | __author__ = ("Guido van Rossum <guido@python.org>, "
 72 |               "Mike Verdone <mike.verdone@gmail.com>, "
 73 |               "Mark Russell <mark.russell@zen.co.uk>, "
 74 |               "Antoine Pitrou <solipsis@pitrou.net>, "
 75 |               "Amaury Forgeot d'Arc <amauryfa@gmail.com>, "
 76 |               "Benjamin Peterson <benjamin@python.org>")
 77 | 
 78 | __all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO",
 79 |            "BytesIO", "StringIO", "BufferedIOBase",
 80 |            "BufferedReader", "BufferedWriter", "BufferedRWPair",
 81 |            "BufferedRandom", "TextIOBase", "TextIOWrapper",
 82 |            "UnsupportedOperation", "SEEK_SET", "SEEK_CUR", "SEEK_END"]
 83 | 
 84 | 
 85 | import _io
 86 | import abc
 87 | 
 88 | from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, UnsupportedOperation,
 89 |                  open, FileIO, BytesIO, StringIO, BufferedReader,
 90 |                  BufferedWriter, BufferedRWPair, BufferedRandom,
 91 |                  IncrementalNewlineDecoder, TextIOWrapper)
 92 | 
 93 | OpenWrapper = _io.open # for compatibility with _pyio
 94 | 
 95 | # Pretend this exception was created here.
 96 | UnsupportedOperation.__module__ = "io"
 97 | 
 98 | # for seek()
 99 | SEEK_SET = 0
100 | SEEK_CUR = 1
101 | SEEK_END = 2
102 | 
103 | # Declaring ABCs in C is tricky so we do it here.
104 | # Method descriptions and default implementations are inherited from the C
105 | # version however.
106 | 
[docs]class IOBase(_io._IOBase, metaclass=abc.ABCMeta): 107 | __doc__ = _io._IOBase.__doc__
108 | 109 |
[docs]class RawIOBase(_io._RawIOBase, IOBase): 110 | __doc__ = _io._RawIOBase.__doc__
111 | 112 |
[docs]class BufferedIOBase(_io._BufferedIOBase, IOBase): 113 | __doc__ = _io._BufferedIOBase.__doc__
114 | 115 |
[docs]class TextIOBase(_io._TextIOBase, IOBase): 116 | __doc__ = _io._TextIOBase.__doc__
117 | 118 | RawIOBase.register(FileIO) 119 | 120 | for klass in (BytesIO, BufferedReader, BufferedWriter, BufferedRandom, 121 | BufferedRWPair): 122 | BufferedIOBase.register(klass) 123 | 124 | for klass in (StringIO, TextIOWrapper): 125 | TextIOBase.register(klass) 126 | del klass 127 | 128 | try: 129 | from _io import _WindowsConsoleIO 130 | except ImportError: 131 | pass 132 | else: 133 | RawIOBase.register(_WindowsConsoleIO) 134 |
135 | 136 |
137 | 138 |
139 |
140 | 191 |
192 |
193 | 201 | 202 | 203 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/autoencoder-integration.rst.txt: -------------------------------------------------------------------------------- 1 | Multi-modal Autoencoders 2 | ======================== 3 | 4 | Autoencoders are hourglass-shaped neural networks that are trained to reconstruct the input data after passing it through a bottleneck layer. Thereby, autoencoders learn an efficient lower dimension representation of high-dimensional data, a "latent factor" representation of the data. The Multi-modal autoencoders take data from different modalities and learn latent factor representations of the data. In the figure below, the direction of data flow is left to right. The three different-colored matrices on the left represent data from three different modalities. The three matrices on the right represent the reconstruction of the input data, and the mixed-color matrix on the bottom represents the latent factor view of the data. 5 | 6 | .. _fig-integration-autoencoder 7 | .. figure:: _static/integration-autoencoder.png 8 | Integration Autoencoder 9 | 10 | 11 | Variational Autoencoders 12 | ------------------------ 13 | 14 | Maui uses a Variational Autoencoder, which means it learns a bayesian latent variable model. This is achieved by minimizing the following loss function: 15 | 16 | :math:`\mathcal{L} = -\mathbf{E}_{q(z|x)}\big[ log(p(x|z)) \big] + D_{KL}\big( q(z|x)~\|~p(z) \big)` 17 | 18 | The first term represents the cross-entropy reconstruction loss, and the second term is the Kullback-Leibler divergence between the latent factors distribution and a gaussian prior :math:`p(z)`. 19 | 20 | 21 | Stacked Autoencoders 22 | -------------------- 23 | 24 | As the figure above indicates, it is possible to insert extra layers between the input and the bottleneck layers, and between the bottleneck and the output layers. This is sometimes called stacked autoencoders. :doc:`maui` allows this architecture to be varied when instantiating the model, using the ``n_hidden`` parameter. The ``n_latent`` parameter determines the size of the bottleneck layer (latent factor layer). 25 | 26 | .. code-block:: python 27 | 28 | maui_model = maui.Maui(n_hidden=[900], n_latent=70) 29 | 30 | instantiates a Maui model with one hidden layer with 900 units, and 70 units in the bottleneck layer, while 31 | 32 | .. code-block:: python 33 | 34 | maui_model = maui.Maui(n_hidden=[1300, 900], n_latent=60) 35 | 36 | will instantiate a maui model with two hidden layers with 1300 and 900 units, respectively. -------------------------------------------------------------------------------- /doc/_build/html/_sources/data-normalization.rst.txt: -------------------------------------------------------------------------------- 1 | Data and Normalization 2 | ====================== 3 | 4 | All features need to be scaled and centered prior to feeding to the neural network of maui. This limitation comes from the fact that the last layer, where the input data is reconstructed, uses Sigmoid activations. Maui uses Batch Normalization during training, where each input feature is normalized at each minibatch. We still recommend that data be scaled prior to training. We provide a function that does this in the :doc:`utils`. 5 | 6 | .. autofunction:: maui.utils.scale 7 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/filtering-and-merging-latent-factors.rst.txt: -------------------------------------------------------------------------------- 1 | Filtering and Merging latent factors 2 | ==================================== 3 | 4 | We recommend running Maui with a large number of latent factors (e.g. 100), even when we expect the latent space to be of lower dimension. This way we are more likely to capture latent factors which are interesting, and the uninteresting ones can be dropped later before down-stream analysis. Maui comes with some functionality to that end. 5 | 6 | Dropping unexplanatory latent factors 7 | ------------------------------------- 8 | 9 | An unsupervised way to drop latent factors with low explanatory power, is to fit linear models predicting the input `x` from the latent factorz `z`. The :doc:`utils` have a function which does this. For each latent factor, a linear model is fit, predicting all input features from each latent factor. Then, the R-square is computed. Factors with an R-square score below some threshold are dropped. 10 | 11 | .. autofunction:: maui.utils.filter_factors_by_r2 12 | 13 | The functionality is also available directly on a trained Maui model (:doc:`maui`), which exposes a function which drops unexplanatory factors in-place: 14 | 15 | .. autofunction:: maui.Maui.drop_unexplanatory_factors 16 | 17 | 18 | Merging similar latent factors 19 | ------------------------------ 20 | 21 | Some times running Maui with a large number of latent factor can produce embeddings which are similar to one another. For instance, a heatmap of latent factor values may look like this: 22 | 23 | .. _fig-colinear-factors 24 | .. figure:: _static/colinearity.png 25 | Heatmap of latent factors shows many latent factors are very similar. 26 | 27 | The latent factors may be clustered and merged to produce a more succinct, even lower-dimension representation of the data, without losing much information 28 | 29 | .. _fig-colinear-factors-merged 30 | .. figure:: _static/colinearity-merged.png 31 | Heatmap of latent factors after they have been merged by similarity values. 32 | 33 | :doc:`utils` provides functionality to merge latent factors based on arbitrary distance metrics: 34 | 35 | .. autofunction:: maui.utils.merge_factors 36 | 37 | And functionality for the base case where factors are merged by correlation is provided in the Maui model calss: 38 | 39 | .. autofunction:: maui.Maui.merge_similar_latent_factors 40 | 41 | 42 | Supervised filtering of latent factors 43 | -------------------------------------- 44 | 45 | In the case of patient data, latent factors may be assessed for usefulness based on how predictive they are of patient survival. Maui includes functionality to do this in the utilities class: 46 | 47 | .. autofunction:: maui.utils.select_clinical_factors 48 | 49 | For a more comprehensive example, check out `our vignette `_. 50 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | Multi-omics Autoencoder Integration (maui) 2 | ========================================== 3 | 4 | maui is an autoencoder-based framework for multi-omics data analysis. It consists of two main modules, :doc:`maui`, and :doc:`utils`. For an introduction of the use of autoencoders for multi-omics integration, see :doc:`autoencoder-integration`. 5 | 6 | 7 | Table of contents 8 | ----------------- 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | autoencoder-integration 14 | data-normalization 15 | filtering-and-merging-latent-factors 16 | saving-and-loading-models 17 | maui 18 | utils 19 | 20 | 21 | 22 | Quickstart 23 | ---------- 24 | 25 | The ``Maui`` class implements ``scikit-learn``'s ``BaseEstimator``. In order to infer latent factors in multi-omics data, first instantiate a ``Maui`` model with the desired parameters, and then fit it to some data: 26 | 27 | .. code-block:: python 28 | 29 | from maui import Maui 30 | 31 | maui_model = maui.Maui(n_hidden=[900], n_latent=70, epochs=100) 32 | z = maui_model.fit_transform({'mRNA': gex, 'Mutations': mut, 'CNV': cnv}) 33 | 34 | This will instantiate a maui model with one hidden layer of 900 nodes, and a middle layer of 70 nodes, which will be traiend for 100 epochs. It then feeds the multi-omics data in ``gex``, ``mut``, and ``cnv`` to the fitting procedure. The omics data (``gex`` et. al.) are ``pandas.DataFrame`` objects of dimension (n_features, n_samples). The return object ``z`` is a ``pandas.DataFrame`` (n_samples, n_latent), and may be used for further analysis. 35 | 36 | In order to check the model's convergance, the ``hist`` object may be inspected, and plotted: 37 | 38 | .. code-block:: python 39 | 40 | maui_model.hist.plot() 41 | 42 | .. image:: _static/hist.png 43 | 44 | For a more comprehensive example, check out `our vignette `_. 45 | 46 | 47 | Indices and tables 48 | ~~~~~~~~~~~~~~~~~~ 49 | 50 | * :ref:`genindex` 51 | * :ref:`modindex` 52 | * :ref:`search` 53 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/maui.rst.txt: -------------------------------------------------------------------------------- 1 | The Maui Class 2 | ============== 3 | 4 | .. autoclass:: maui.Maui 5 | :members: 6 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/saving-and-loading-models.rst.txt: -------------------------------------------------------------------------------- 1 | Saving and loading models 2 | ========================= 3 | 4 | Maui models may be saved to disk, so that they may be loaded again at a later time. 5 | 6 | Saving a trained model to disk 7 | ------------------------------ 8 | 9 | Saving a model to disk involves saving two files to a target directory. These files store the model weights and the maui parameters (the arguments the maui model was instantiated with). :doc:`maui` implements a the save function 10 | 11 | .. autofunction:: maui.Maui.save 12 | 13 | The function takes one required parameter, the destination directory where the two files will be saved. It is called directly on a maui model, like 14 | 15 | .. code-block:: python 16 | 17 | maui_model.save('/path/to/dir') 18 | 19 | 20 | Loading a model from disk 21 | ------------------------- 22 | 23 | Loading a model involves instantiating a new Maui instance using the parameters that were used on the model that is saved to disk, and then populating the weights of the model to the previously trained weights. Once a model is loaded, it can be used to transform new data to the latent space, or it can be trained further. :doc:`maui` has a static function to load a model from disk 24 | 25 | .. autofunction:: maui.Maui.load 26 | 27 | It is called directly on the Maui class, like 28 | 29 | .. code-block:: sql 30 | 31 | maui.Maui.load('/path/to/dir') 32 | 33 | -------------------------------------------------------------------------------- /doc/_build/html/_sources/utils.rst.txt: -------------------------------------------------------------------------------- 1 | Maui Utilities 2 | ============== 3 | 4 | .. automodule:: maui.utils 5 | :members: 6 | -------------------------------------------------------------------------------- /doc/_build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /doc/_build/html/_static/alabaster.css: -------------------------------------------------------------------------------- 1 | @import url("basic.css"); 2 | 3 | /* -- page layout ----------------------------------------------------------- */ 4 | 5 | body { 6 | font-family: Georgia, serif; 7 | font-size: 17px; 8 | background-color: #fff; 9 | color: #000; 10 | margin: 0; 11 | padding: 0; 12 | } 13 | 14 | 15 | div.document { 16 | width: 940px; 17 | margin: 30px auto 0 auto; 18 | } 19 | 20 | div.documentwrapper { 21 | float: left; 22 | width: 100%; 23 | } 24 | 25 | div.bodywrapper { 26 | margin: 0 0 0 220px; 27 | } 28 | 29 | div.sphinxsidebar { 30 | width: 220px; 31 | font-size: 14px; 32 | line-height: 1.5; 33 | } 34 | 35 | hr { 36 | border: 1px solid #B1B4B6; 37 | } 38 | 39 | div.body { 40 | background-color: #fff; 41 | color: #3E4349; 42 | padding: 0 30px 0 30px; 43 | } 44 | 45 | div.body > .section { 46 | text-align: left; 47 | } 48 | 49 | div.footer { 50 | width: 940px; 51 | margin: 20px auto 30px auto; 52 | font-size: 14px; 53 | color: #888; 54 | text-align: right; 55 | } 56 | 57 | div.footer a { 58 | color: #888; 59 | } 60 | 61 | p.caption { 62 | font-family: inherit; 63 | font-size: inherit; 64 | } 65 | 66 | 67 | div.relations { 68 | display: none; 69 | } 70 | 71 | 72 | div.sphinxsidebar a { 73 | color: #444; 74 | text-decoration: none; 75 | border-bottom: 1px dotted #999; 76 | } 77 | 78 | div.sphinxsidebar a:hover { 79 | border-bottom: 1px solid #999; 80 | } 81 | 82 | div.sphinxsidebarwrapper { 83 | padding: 18px 10px; 84 | } 85 | 86 | div.sphinxsidebarwrapper p.logo { 87 | padding: 0; 88 | margin: -10px 0 0 0px; 89 | text-align: center; 90 | } 91 | 92 | div.sphinxsidebarwrapper h1.logo { 93 | margin-top: -10px; 94 | text-align: center; 95 | margin-bottom: 5px; 96 | text-align: left; 97 | } 98 | 99 | div.sphinxsidebarwrapper h1.logo-name { 100 | margin-top: 0px; 101 | } 102 | 103 | div.sphinxsidebarwrapper p.blurb { 104 | margin-top: 0; 105 | font-style: normal; 106 | } 107 | 108 | div.sphinxsidebar h3, 109 | div.sphinxsidebar h4 { 110 | font-family: Georgia, serif; 111 | color: #444; 112 | font-size: 24px; 113 | font-weight: normal; 114 | margin: 0 0 5px 0; 115 | padding: 0; 116 | } 117 | 118 | div.sphinxsidebar h4 { 119 | font-size: 20px; 120 | } 121 | 122 | div.sphinxsidebar h3 a { 123 | color: #444; 124 | } 125 | 126 | div.sphinxsidebar p.logo a, 127 | div.sphinxsidebar h3 a, 128 | div.sphinxsidebar p.logo a:hover, 129 | div.sphinxsidebar h3 a:hover { 130 | border: none; 131 | } 132 | 133 | div.sphinxsidebar p { 134 | color: #555; 135 | margin: 10px 0; 136 | } 137 | 138 | div.sphinxsidebar ul { 139 | margin: 10px 0; 140 | padding: 0; 141 | color: #000; 142 | } 143 | 144 | div.sphinxsidebar ul li.toctree-l1 > a { 145 | font-size: 120%; 146 | } 147 | 148 | div.sphinxsidebar ul li.toctree-l2 > a { 149 | font-size: 110%; 150 | } 151 | 152 | div.sphinxsidebar input { 153 | border: 1px solid #CCC; 154 | font-family: Georgia, serif; 155 | font-size: 1em; 156 | } 157 | 158 | div.sphinxsidebar hr { 159 | border: none; 160 | height: 1px; 161 | color: #AAA; 162 | background: #AAA; 163 | 164 | text-align: left; 165 | margin-left: 0; 166 | width: 50%; 167 | } 168 | 169 | div.sphinxsidebar .badge { 170 | border-bottom: none; 171 | } 172 | 173 | div.sphinxsidebar .badge:hover { 174 | border-bottom: none; 175 | } 176 | 177 | /* To address an issue with donation coming after search */ 178 | div.sphinxsidebar h3.donation { 179 | margin-top: 10px; 180 | } 181 | 182 | /* -- body styles ----------------------------------------------------------- */ 183 | 184 | a { 185 | color: #004B6B; 186 | text-decoration: underline; 187 | } 188 | 189 | a:hover { 190 | color: #6D4100; 191 | text-decoration: underline; 192 | } 193 | 194 | div.body h1, 195 | div.body h2, 196 | div.body h3, 197 | div.body h4, 198 | div.body h5, 199 | div.body h6 { 200 | font-family: Georgia, serif; 201 | font-weight: normal; 202 | margin: 30px 0px 10px 0px; 203 | padding: 0; 204 | } 205 | 206 | div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } 207 | div.body h2 { font-size: 180%; } 208 | div.body h3 { font-size: 150%; } 209 | div.body h4 { font-size: 130%; } 210 | div.body h5 { font-size: 100%; } 211 | div.body h6 { font-size: 100%; } 212 | 213 | a.headerlink { 214 | color: #DDD; 215 | padding: 0 4px; 216 | text-decoration: none; 217 | } 218 | 219 | a.headerlink:hover { 220 | color: #444; 221 | background: #EAEAEA; 222 | } 223 | 224 | div.body p, div.body dd, div.body li { 225 | line-height: 1.4em; 226 | } 227 | 228 | div.admonition { 229 | margin: 20px 0px; 230 | padding: 10px 30px; 231 | background-color: #EEE; 232 | border: 1px solid #CCC; 233 | } 234 | 235 | div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { 236 | background-color: #FBFBFB; 237 | border-bottom: 1px solid #fafafa; 238 | } 239 | 240 | div.admonition p.admonition-title { 241 | font-family: Georgia, serif; 242 | font-weight: normal; 243 | font-size: 24px; 244 | margin: 0 0 10px 0; 245 | padding: 0; 246 | line-height: 1; 247 | } 248 | 249 | div.admonition p.last { 250 | margin-bottom: 0; 251 | } 252 | 253 | div.highlight { 254 | background-color: #fff; 255 | } 256 | 257 | dt:target, .highlight { 258 | background: #FAF3E8; 259 | } 260 | 261 | div.warning { 262 | background-color: #FCC; 263 | border: 1px solid #FAA; 264 | } 265 | 266 | div.danger { 267 | background-color: #FCC; 268 | border: 1px solid #FAA; 269 | -moz-box-shadow: 2px 2px 4px #D52C2C; 270 | -webkit-box-shadow: 2px 2px 4px #D52C2C; 271 | box-shadow: 2px 2px 4px #D52C2C; 272 | } 273 | 274 | div.error { 275 | background-color: #FCC; 276 | border: 1px solid #FAA; 277 | -moz-box-shadow: 2px 2px 4px #D52C2C; 278 | -webkit-box-shadow: 2px 2px 4px #D52C2C; 279 | box-shadow: 2px 2px 4px #D52C2C; 280 | } 281 | 282 | div.caution { 283 | background-color: #FCC; 284 | border: 1px solid #FAA; 285 | } 286 | 287 | div.attention { 288 | background-color: #FCC; 289 | border: 1px solid #FAA; 290 | } 291 | 292 | div.important { 293 | background-color: #EEE; 294 | border: 1px solid #CCC; 295 | } 296 | 297 | div.note { 298 | background-color: #EEE; 299 | border: 1px solid #CCC; 300 | } 301 | 302 | div.tip { 303 | background-color: #EEE; 304 | border: 1px solid #CCC; 305 | } 306 | 307 | div.hint { 308 | background-color: #EEE; 309 | border: 1px solid #CCC; 310 | } 311 | 312 | div.seealso { 313 | background-color: #EEE; 314 | border: 1px solid #CCC; 315 | } 316 | 317 | div.topic { 318 | background-color: #EEE; 319 | } 320 | 321 | p.admonition-title { 322 | display: inline; 323 | } 324 | 325 | p.admonition-title:after { 326 | content: ":"; 327 | } 328 | 329 | pre, tt, code { 330 | font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; 331 | font-size: 0.9em; 332 | } 333 | 334 | .hll { 335 | background-color: #FFC; 336 | margin: 0 -12px; 337 | padding: 0 12px; 338 | display: block; 339 | } 340 | 341 | img.screenshot { 342 | } 343 | 344 | tt.descname, tt.descclassname, code.descname, code.descclassname { 345 | font-size: 0.95em; 346 | } 347 | 348 | tt.descname, code.descname { 349 | padding-right: 0.08em; 350 | } 351 | 352 | img.screenshot { 353 | -moz-box-shadow: 2px 2px 4px #EEE; 354 | -webkit-box-shadow: 2px 2px 4px #EEE; 355 | box-shadow: 2px 2px 4px #EEE; 356 | } 357 | 358 | table.docutils { 359 | border: 1px solid #888; 360 | -moz-box-shadow: 2px 2px 4px #EEE; 361 | -webkit-box-shadow: 2px 2px 4px #EEE; 362 | box-shadow: 2px 2px 4px #EEE; 363 | } 364 | 365 | table.docutils td, table.docutils th { 366 | border: 1px solid #888; 367 | padding: 0.25em 0.7em; 368 | } 369 | 370 | table.field-list, table.footnote { 371 | border: none; 372 | -moz-box-shadow: none; 373 | -webkit-box-shadow: none; 374 | box-shadow: none; 375 | } 376 | 377 | table.footnote { 378 | margin: 15px 0; 379 | width: 100%; 380 | border: 1px solid #EEE; 381 | background: #FDFDFD; 382 | font-size: 0.9em; 383 | } 384 | 385 | table.footnote + table.footnote { 386 | margin-top: -15px; 387 | border-top: none; 388 | } 389 | 390 | table.field-list th { 391 | padding: 0 0.8em 0 0; 392 | } 393 | 394 | table.field-list td { 395 | padding: 0; 396 | } 397 | 398 | table.field-list p { 399 | margin-bottom: 0.8em; 400 | } 401 | 402 | /* Cloned from 403 | * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68 404 | */ 405 | .field-name { 406 | -moz-hyphens: manual; 407 | -ms-hyphens: manual; 408 | -webkit-hyphens: manual; 409 | hyphens: manual; 410 | } 411 | 412 | table.footnote td.label { 413 | width: .1px; 414 | padding: 0.3em 0 0.3em 0.5em; 415 | } 416 | 417 | table.footnote td { 418 | padding: 0.3em 0.5em; 419 | } 420 | 421 | dl { 422 | margin: 0; 423 | padding: 0; 424 | } 425 | 426 | dl dd { 427 | margin-left: 30px; 428 | } 429 | 430 | blockquote { 431 | margin: 0 0 0 30px; 432 | padding: 0; 433 | } 434 | 435 | ul, ol { 436 | /* Matches the 30px from the narrow-screen "li > ul" selector below */ 437 | margin: 10px 0 10px 30px; 438 | padding: 0; 439 | } 440 | 441 | pre { 442 | background: #EEE; 443 | padding: 7px 30px; 444 | margin: 15px 0px; 445 | line-height: 1.3em; 446 | } 447 | 448 | div.viewcode-block:target { 449 | background: #ffd; 450 | } 451 | 452 | dl pre, blockquote pre, li pre { 453 | margin-left: 0; 454 | padding-left: 30px; 455 | } 456 | 457 | tt, code { 458 | background-color: #ecf0f3; 459 | color: #222; 460 | /* padding: 1px 2px; */ 461 | } 462 | 463 | tt.xref, code.xref, a tt { 464 | background-color: #FBFBFB; 465 | border-bottom: 1px solid #fff; 466 | } 467 | 468 | a.reference { 469 | text-decoration: none; 470 | border-bottom: 1px dotted #004B6B; 471 | } 472 | 473 | /* Don't put an underline on images */ 474 | a.image-reference, a.image-reference:hover { 475 | border-bottom: none; 476 | } 477 | 478 | a.reference:hover { 479 | border-bottom: 1px solid #6D4100; 480 | } 481 | 482 | a.footnote-reference { 483 | text-decoration: none; 484 | font-size: 0.7em; 485 | vertical-align: top; 486 | border-bottom: 1px dotted #004B6B; 487 | } 488 | 489 | a.footnote-reference:hover { 490 | border-bottom: 1px solid #6D4100; 491 | } 492 | 493 | a:hover tt, a:hover code { 494 | background: #EEE; 495 | } 496 | 497 | 498 | @media screen and (max-width: 870px) { 499 | 500 | div.sphinxsidebar { 501 | display: none; 502 | } 503 | 504 | div.document { 505 | width: 100%; 506 | 507 | } 508 | 509 | div.documentwrapper { 510 | margin-left: 0; 511 | margin-top: 0; 512 | margin-right: 0; 513 | margin-bottom: 0; 514 | } 515 | 516 | div.bodywrapper { 517 | margin-top: 0; 518 | margin-right: 0; 519 | margin-bottom: 0; 520 | margin-left: 0; 521 | } 522 | 523 | ul { 524 | margin-left: 0; 525 | } 526 | 527 | li > ul { 528 | /* Matches the 30px from the "ul, ol" selector above */ 529 | margin-left: 30px; 530 | } 531 | 532 | .document { 533 | width: auto; 534 | } 535 | 536 | .footer { 537 | width: auto; 538 | } 539 | 540 | .bodywrapper { 541 | margin: 0; 542 | } 543 | 544 | .footer { 545 | width: auto; 546 | } 547 | 548 | .github { 549 | display: none; 550 | } 551 | 552 | 553 | 554 | } 555 | 556 | 557 | 558 | @media screen and (max-width: 875px) { 559 | 560 | body { 561 | margin: 0; 562 | padding: 20px 30px; 563 | } 564 | 565 | div.documentwrapper { 566 | float: none; 567 | background: #fff; 568 | } 569 | 570 | div.sphinxsidebar { 571 | display: block; 572 | float: none; 573 | width: 102.5%; 574 | margin: 50px -30px -20px -30px; 575 | padding: 10px 20px; 576 | background: #333; 577 | color: #FFF; 578 | } 579 | 580 | div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, 581 | div.sphinxsidebar h3 a { 582 | color: #fff; 583 | } 584 | 585 | div.sphinxsidebar a { 586 | color: #AAA; 587 | } 588 | 589 | div.sphinxsidebar p.logo { 590 | display: none; 591 | } 592 | 593 | div.document { 594 | width: 100%; 595 | margin: 0; 596 | } 597 | 598 | div.footer { 599 | display: none; 600 | } 601 | 602 | div.bodywrapper { 603 | margin: 0; 604 | } 605 | 606 | div.body { 607 | min-height: 0; 608 | padding: 0; 609 | } 610 | 611 | .rtd_doc_footer { 612 | display: none; 613 | } 614 | 615 | .document { 616 | width: auto; 617 | } 618 | 619 | .footer { 620 | width: auto; 621 | } 622 | 623 | .footer { 624 | width: auto; 625 | } 626 | 627 | .github { 628 | display: none; 629 | } 630 | } 631 | 632 | 633 | /* misc. */ 634 | 635 | .revsys-inline { 636 | display: none!important; 637 | } 638 | 639 | /* Make nested-list/multi-paragraph items look better in Releases changelog 640 | * pages. Without this, docutils' magical list fuckery causes inconsistent 641 | * formatting between different release sub-lists. 642 | */ 643 | div#changelog > div.section > ul > li > p:only-child { 644 | margin-bottom: 0; 645 | } 646 | 647 | /* Hide fugly table cell borders in ..bibliography:: directive output */ 648 | table.docutils.citation, table.docutils.citation td, table.docutils.citation th { 649 | border: none; 650 | /* Below needed in some edge cases; if not applied, bottom shadows appear */ 651 | -moz-box-shadow: none; 652 | -webkit-box-shadow: none; 653 | box-shadow: none; 654 | } 655 | 656 | 657 | /* relbar */ 658 | 659 | .related { 660 | line-height: 30px; 661 | width: 100%; 662 | font-size: 0.9rem; 663 | } 664 | 665 | .related.top { 666 | border-bottom: 1px solid #EEE; 667 | margin-bottom: 20px; 668 | } 669 | 670 | .related.bottom { 671 | border-top: 1px solid #EEE; 672 | } 673 | 674 | .related ul { 675 | padding: 0; 676 | margin: 0; 677 | list-style: none; 678 | } 679 | 680 | .related li { 681 | display: inline; 682 | } 683 | 684 | nav#rellinks { 685 | float: right; 686 | } 687 | 688 | nav#rellinks li+li:before { 689 | content: "|"; 690 | } 691 | 692 | nav#breadcrumbs li+li:before { 693 | content: "\00BB"; 694 | } 695 | 696 | /* Hide certain items when printing */ 697 | @media print { 698 | div.related { 699 | display: none; 700 | } 701 | } -------------------------------------------------------------------------------- /doc/_build/html/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | word-wrap: break-word; 56 | overflow-wrap : break-word; 57 | } 58 | 59 | div.sphinxsidebar ul { 60 | list-style: none; 61 | } 62 | 63 | div.sphinxsidebar ul ul, 64 | div.sphinxsidebar ul.want-points { 65 | margin-left: 20px; 66 | list-style: square; 67 | } 68 | 69 | div.sphinxsidebar ul ul { 70 | margin-top: 0; 71 | margin-bottom: 0; 72 | } 73 | 74 | div.sphinxsidebar form { 75 | margin-top: 10px; 76 | } 77 | 78 | div.sphinxsidebar input { 79 | border: 1px solid #98dbcc; 80 | font-family: sans-serif; 81 | font-size: 1em; 82 | } 83 | 84 | div.sphinxsidebar #searchbox form.search { 85 | overflow: hidden; 86 | } 87 | 88 | div.sphinxsidebar #searchbox input[type="text"] { 89 | float: left; 90 | width: 80%; 91 | padding: 0.25em; 92 | box-sizing: border-box; 93 | } 94 | 95 | div.sphinxsidebar #searchbox input[type="submit"] { 96 | float: left; 97 | width: 20%; 98 | border-left: none; 99 | padding: 0.25em; 100 | box-sizing: border-box; 101 | } 102 | 103 | 104 | img { 105 | border: 0; 106 | max-width: 100%; 107 | } 108 | 109 | /* -- search page ----------------------------------------------------------- */ 110 | 111 | ul.search { 112 | margin: 10px 0 0 20px; 113 | padding: 0; 114 | } 115 | 116 | ul.search li { 117 | padding: 5px 0 5px 20px; 118 | background-image: url(file.png); 119 | background-repeat: no-repeat; 120 | background-position: 0 7px; 121 | } 122 | 123 | ul.search li a { 124 | font-weight: bold; 125 | } 126 | 127 | ul.search li div.context { 128 | color: #888; 129 | margin: 2px 0 0 30px; 130 | text-align: left; 131 | } 132 | 133 | ul.keywordmatches li.goodmatch a { 134 | font-weight: bold; 135 | } 136 | 137 | /* -- index page ------------------------------------------------------------ */ 138 | 139 | table.contentstable { 140 | width: 90%; 141 | margin-left: auto; 142 | margin-right: auto; 143 | } 144 | 145 | table.contentstable p.biglink { 146 | line-height: 150%; 147 | } 148 | 149 | a.biglink { 150 | font-size: 1.3em; 151 | } 152 | 153 | span.linkdescr { 154 | font-style: italic; 155 | padding-top: 5px; 156 | font-size: 90%; 157 | } 158 | 159 | /* -- general index --------------------------------------------------------- */ 160 | 161 | table.indextable { 162 | width: 100%; 163 | } 164 | 165 | table.indextable td { 166 | text-align: left; 167 | vertical-align: top; 168 | } 169 | 170 | table.indextable ul { 171 | margin-top: 0; 172 | margin-bottom: 0; 173 | list-style-type: none; 174 | } 175 | 176 | table.indextable > tbody > tr > td > ul { 177 | padding-left: 0em; 178 | } 179 | 180 | table.indextable tr.pcap { 181 | height: 10px; 182 | } 183 | 184 | table.indextable tr.cap { 185 | margin-top: 10px; 186 | background-color: #f2f2f2; 187 | } 188 | 189 | img.toggler { 190 | margin-right: 3px; 191 | margin-top: 3px; 192 | cursor: pointer; 193 | } 194 | 195 | div.modindex-jumpbox { 196 | border-top: 1px solid #ddd; 197 | border-bottom: 1px solid #ddd; 198 | margin: 1em 0 1em 0; 199 | padding: 0.4em; 200 | } 201 | 202 | div.genindex-jumpbox { 203 | border-top: 1px solid #ddd; 204 | border-bottom: 1px solid #ddd; 205 | margin: 1em 0 1em 0; 206 | padding: 0.4em; 207 | } 208 | 209 | /* -- domain module index --------------------------------------------------- */ 210 | 211 | table.modindextable td { 212 | padding: 2px; 213 | border-collapse: collapse; 214 | } 215 | 216 | /* -- general body styles --------------------------------------------------- */ 217 | 218 | div.body { 219 | min-width: 450px; 220 | max-width: 800px; 221 | } 222 | 223 | div.body p, div.body dd, div.body li, div.body blockquote { 224 | -moz-hyphens: auto; 225 | -ms-hyphens: auto; 226 | -webkit-hyphens: auto; 227 | hyphens: auto; 228 | } 229 | 230 | a.headerlink { 231 | visibility: hidden; 232 | } 233 | 234 | h1:hover > a.headerlink, 235 | h2:hover > a.headerlink, 236 | h3:hover > a.headerlink, 237 | h4:hover > a.headerlink, 238 | h5:hover > a.headerlink, 239 | h6:hover > a.headerlink, 240 | dt:hover > a.headerlink, 241 | caption:hover > a.headerlink, 242 | p.caption:hover > a.headerlink, 243 | div.code-block-caption:hover > a.headerlink { 244 | visibility: visible; 245 | } 246 | 247 | div.body p.caption { 248 | text-align: inherit; 249 | } 250 | 251 | div.body td { 252 | text-align: left; 253 | } 254 | 255 | .first { 256 | margin-top: 0 !important; 257 | } 258 | 259 | p.rubric { 260 | margin-top: 30px; 261 | font-weight: bold; 262 | } 263 | 264 | img.align-left, .figure.align-left, object.align-left { 265 | clear: left; 266 | float: left; 267 | margin-right: 1em; 268 | } 269 | 270 | img.align-right, .figure.align-right, object.align-right { 271 | clear: right; 272 | float: right; 273 | margin-left: 1em; 274 | } 275 | 276 | img.align-center, .figure.align-center, object.align-center { 277 | display: block; 278 | margin-left: auto; 279 | margin-right: auto; 280 | } 281 | 282 | .align-left { 283 | text-align: left; 284 | } 285 | 286 | .align-center { 287 | text-align: center; 288 | } 289 | 290 | .align-right { 291 | text-align: right; 292 | } 293 | 294 | /* -- sidebars -------------------------------------------------------------- */ 295 | 296 | div.sidebar { 297 | margin: 0 0 0.5em 1em; 298 | border: 1px solid #ddb; 299 | padding: 7px 7px 0 7px; 300 | background-color: #ffe; 301 | width: 40%; 302 | float: right; 303 | } 304 | 305 | p.sidebar-title { 306 | font-weight: bold; 307 | } 308 | 309 | /* -- topics ---------------------------------------------------------------- */ 310 | 311 | div.topic { 312 | border: 1px solid #ccc; 313 | padding: 7px 7px 0 7px; 314 | margin: 10px 0 10px 0; 315 | } 316 | 317 | p.topic-title { 318 | font-size: 1.1em; 319 | font-weight: bold; 320 | margin-top: 10px; 321 | } 322 | 323 | /* -- admonitions ----------------------------------------------------------- */ 324 | 325 | div.admonition { 326 | margin-top: 10px; 327 | margin-bottom: 10px; 328 | padding: 7px; 329 | } 330 | 331 | div.admonition dt { 332 | font-weight: bold; 333 | } 334 | 335 | div.admonition dl { 336 | margin-bottom: 0; 337 | } 338 | 339 | p.admonition-title { 340 | margin: 0px 10px 5px 0px; 341 | font-weight: bold; 342 | } 343 | 344 | div.body p.centered { 345 | text-align: center; 346 | margin-top: 25px; 347 | } 348 | 349 | /* -- tables ---------------------------------------------------------------- */ 350 | 351 | table.docutils { 352 | border: 0; 353 | border-collapse: collapse; 354 | } 355 | 356 | table.align-center { 357 | margin-left: auto; 358 | margin-right: auto; 359 | } 360 | 361 | table caption span.caption-number { 362 | font-style: italic; 363 | } 364 | 365 | table caption span.caption-text { 366 | } 367 | 368 | table.docutils td, table.docutils th { 369 | padding: 1px 8px 1px 5px; 370 | border-top: 0; 371 | border-left: 0; 372 | border-right: 0; 373 | border-bottom: 1px solid #aaa; 374 | } 375 | 376 | table.footnote td, table.footnote th { 377 | border: 0 !important; 378 | } 379 | 380 | th { 381 | text-align: left; 382 | padding-right: 5px; 383 | } 384 | 385 | table.citation { 386 | border-left: solid 1px gray; 387 | margin-left: 1px; 388 | } 389 | 390 | table.citation td { 391 | border-bottom: none; 392 | } 393 | 394 | /* -- figures --------------------------------------------------------------- */ 395 | 396 | div.figure { 397 | margin: 0.5em; 398 | padding: 0.5em; 399 | } 400 | 401 | div.figure p.caption { 402 | padding: 0.3em; 403 | } 404 | 405 | div.figure p.caption span.caption-number { 406 | font-style: italic; 407 | } 408 | 409 | div.figure p.caption span.caption-text { 410 | } 411 | 412 | /* -- field list styles ----------------------------------------------------- */ 413 | 414 | table.field-list td, table.field-list th { 415 | border: 0 !important; 416 | } 417 | 418 | .field-list ul { 419 | margin: 0; 420 | padding-left: 1em; 421 | } 422 | 423 | .field-list p { 424 | margin: 0; 425 | } 426 | 427 | .field-name { 428 | -moz-hyphens: manual; 429 | -ms-hyphens: manual; 430 | -webkit-hyphens: manual; 431 | hyphens: manual; 432 | } 433 | 434 | /* -- hlist styles ---------------------------------------------------------- */ 435 | 436 | table.hlist td { 437 | vertical-align: top; 438 | } 439 | 440 | 441 | /* -- other body styles ----------------------------------------------------- */ 442 | 443 | ol.arabic { 444 | list-style: decimal; 445 | } 446 | 447 | ol.loweralpha { 448 | list-style: lower-alpha; 449 | } 450 | 451 | ol.upperalpha { 452 | list-style: upper-alpha; 453 | } 454 | 455 | ol.lowerroman { 456 | list-style: lower-roman; 457 | } 458 | 459 | ol.upperroman { 460 | list-style: upper-roman; 461 | } 462 | 463 | dl { 464 | margin-bottom: 15px; 465 | } 466 | 467 | dd p { 468 | margin-top: 0px; 469 | } 470 | 471 | dd ul, dd table { 472 | margin-bottom: 10px; 473 | } 474 | 475 | dd { 476 | margin-top: 3px; 477 | margin-bottom: 10px; 478 | margin-left: 30px; 479 | } 480 | 481 | dt:target, span.highlighted { 482 | background-color: #fbe54e; 483 | } 484 | 485 | rect.highlighted { 486 | fill: #fbe54e; 487 | } 488 | 489 | dl.glossary dt { 490 | font-weight: bold; 491 | font-size: 1.1em; 492 | } 493 | 494 | .optional { 495 | font-size: 1.3em; 496 | } 497 | 498 | .sig-paren { 499 | font-size: larger; 500 | } 501 | 502 | .versionmodified { 503 | font-style: italic; 504 | } 505 | 506 | .system-message { 507 | background-color: #fda; 508 | padding: 5px; 509 | border: 3px solid red; 510 | } 511 | 512 | .footnote:target { 513 | background-color: #ffa; 514 | } 515 | 516 | .line-block { 517 | display: block; 518 | margin-top: 1em; 519 | margin-bottom: 1em; 520 | } 521 | 522 | .line-block .line-block { 523 | margin-top: 0; 524 | margin-bottom: 0; 525 | margin-left: 1.5em; 526 | } 527 | 528 | .guilabel, .menuselection { 529 | font-family: sans-serif; 530 | } 531 | 532 | .accelerator { 533 | text-decoration: underline; 534 | } 535 | 536 | .classifier { 537 | font-style: oblique; 538 | } 539 | 540 | abbr, acronym { 541 | border-bottom: dotted 1px; 542 | cursor: help; 543 | } 544 | 545 | /* -- code displays --------------------------------------------------------- */ 546 | 547 | pre { 548 | overflow: auto; 549 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 550 | } 551 | 552 | span.pre { 553 | -moz-hyphens: none; 554 | -ms-hyphens: none; 555 | -webkit-hyphens: none; 556 | hyphens: none; 557 | } 558 | 559 | td.linenos pre { 560 | padding: 5px 0px; 561 | border: 0; 562 | background-color: transparent; 563 | color: #aaa; 564 | } 565 | 566 | table.highlighttable { 567 | margin-left: 0.5em; 568 | } 569 | 570 | table.highlighttable td { 571 | padding: 0 0.5em 0 0.5em; 572 | } 573 | 574 | div.code-block-caption { 575 | padding: 2px 5px; 576 | font-size: small; 577 | } 578 | 579 | div.code-block-caption code { 580 | background-color: transparent; 581 | } 582 | 583 | div.code-block-caption + div > div.highlight > pre { 584 | margin-top: 0; 585 | } 586 | 587 | div.code-block-caption span.caption-number { 588 | padding: 0.1em 0.3em; 589 | font-style: italic; 590 | } 591 | 592 | div.code-block-caption span.caption-text { 593 | } 594 | 595 | div.literal-block-wrapper { 596 | padding: 1em 1em 0; 597 | } 598 | 599 | div.literal-block-wrapper div.highlight { 600 | margin: 0; 601 | } 602 | 603 | code.descname { 604 | background-color: transparent; 605 | font-weight: bold; 606 | font-size: 1.2em; 607 | } 608 | 609 | code.descclassname { 610 | background-color: transparent; 611 | } 612 | 613 | code.xref, a code { 614 | background-color: transparent; 615 | font-weight: bold; 616 | } 617 | 618 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 619 | background-color: transparent; 620 | } 621 | 622 | .viewcode-link { 623 | float: right; 624 | } 625 | 626 | .viewcode-back { 627 | float: right; 628 | font-family: sans-serif; 629 | } 630 | 631 | div.viewcode-block:target { 632 | margin: -1px -10px; 633 | padding: 0 10px; 634 | } 635 | 636 | /* -- math display ---------------------------------------------------------- */ 637 | 638 | img.math { 639 | vertical-align: middle; 640 | } 641 | 642 | div.body div.math p { 643 | text-align: center; 644 | } 645 | 646 | span.eqno { 647 | float: right; 648 | } 649 | 650 | span.eqno a.headerlink { 651 | position: relative; 652 | left: 0px; 653 | z-index: 1; 654 | } 655 | 656 | div.math:hover a.headerlink { 657 | visibility: visible; 658 | } 659 | 660 | /* -- printout stylesheet --------------------------------------------------- */ 661 | 662 | @media print { 663 | div.document, 664 | div.documentwrapper, 665 | div.bodywrapper { 666 | margin: 0 !important; 667 | width: 100%; 668 | } 669 | 670 | div.sphinxsidebar, 671 | div.related, 672 | div.footer, 673 | #top-link { 674 | display: none; 675 | } 676 | } -------------------------------------------------------------------------------- /doc/_build/html/_static/classic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * classic.css_t 3 | * ~~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- classic theme. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | 14 | /* -- page layout ----------------------------------------------------------- */ 15 | 16 | body { 17 | font-family: sans-serif; 18 | font-size: 100%; 19 | background-color: #11303d; 20 | color: #000; 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | div.document { 26 | background-color: #1c4e63; 27 | } 28 | 29 | div.documentwrapper { 30 | float: left; 31 | width: 100%; 32 | } 33 | 34 | div.bodywrapper { 35 | margin: 0 0 0 230px; 36 | } 37 | 38 | div.body { 39 | background-color: #ffffff; 40 | color: #000000; 41 | padding: 0 20px 30px 20px; 42 | } 43 | 44 | div.footer { 45 | color: #ffffff; 46 | width: 100%; 47 | padding: 9px 0 9px 0; 48 | text-align: center; 49 | font-size: 75%; 50 | } 51 | 52 | div.footer a { 53 | color: #ffffff; 54 | text-decoration: underline; 55 | } 56 | 57 | div.related { 58 | background-color: black; 59 | line-height: 30px; 60 | color: #ffffff; 61 | } 62 | 63 | div.related a { 64 | color: #ffffff; 65 | } 66 | 67 | div.sphinxsidebar { 68 | } 69 | 70 | div.sphinxsidebar h3 { 71 | font-family: 'Trebuchet MS', sans-serif; 72 | color: #ffffff; 73 | font-size: 1.4em; 74 | font-weight: normal; 75 | margin: 0; 76 | padding: 0; 77 | } 78 | 79 | div.sphinxsidebar h3 a { 80 | color: #ffffff; 81 | } 82 | 83 | div.sphinxsidebar h4 { 84 | font-family: 'Trebuchet MS', sans-serif; 85 | color: #ffffff; 86 | font-size: 1.3em; 87 | font-weight: normal; 88 | margin: 5px 0 0 0; 89 | padding: 0; 90 | } 91 | 92 | div.sphinxsidebar p { 93 | color: #ffffff; 94 | } 95 | 96 | div.sphinxsidebar p.topless { 97 | margin: 5px 10px 10px 10px; 98 | } 99 | 100 | div.sphinxsidebar ul { 101 | margin: 10px; 102 | padding: 0; 103 | color: #ffffff; 104 | } 105 | 106 | div.sphinxsidebar a { 107 | color: #98dbcc; 108 | } 109 | 110 | div.sphinxsidebar input { 111 | border: 1px solid #98dbcc; 112 | font-family: sans-serif; 113 | font-size: 1em; 114 | } 115 | 116 | 117 | 118 | /* -- hyperlink styles ------------------------------------------------------ */ 119 | 120 | a { 121 | color: #355f7c; 122 | text-decoration: none; 123 | } 124 | 125 | a:visited { 126 | color: #355f7c; 127 | text-decoration: none; 128 | } 129 | 130 | a:hover { 131 | text-decoration: underline; 132 | } 133 | 134 | 135 | 136 | /* -- body styles ----------------------------------------------------------- */ 137 | 138 | div.body h1, 139 | div.body h2, 140 | div.body h3, 141 | div.body h4, 142 | div.body h5, 143 | div.body h6 { 144 | font-family: 'Trebuchet MS', sans-serif; 145 | background-color: #f2f2f2; 146 | font-weight: normal; 147 | color: #20435c; 148 | border-bottom: 1px solid #ccc; 149 | margin: 20px -20px 10px -20px; 150 | padding: 3px 0 3px 10px; 151 | } 152 | 153 | div.body h1 { margin-top: 0; font-size: 200%; } 154 | div.body h2 { font-size: 160%; } 155 | div.body h3 { font-size: 140%; } 156 | div.body h4 { font-size: 120%; } 157 | div.body h5 { font-size: 110%; } 158 | div.body h6 { font-size: 100%; } 159 | 160 | a.headerlink { 161 | color: #c60f0f; 162 | font-size: 0.8em; 163 | padding: 0 4px 0 4px; 164 | text-decoration: none; 165 | } 166 | 167 | a.headerlink:hover { 168 | background-color: #c60f0f; 169 | color: white; 170 | } 171 | 172 | div.body p, div.body dd, div.body li, div.body blockquote { 173 | text-align: justify; 174 | line-height: 130%; 175 | } 176 | 177 | div.admonition p.admonition-title + p { 178 | display: inline; 179 | } 180 | 181 | div.admonition p { 182 | margin-bottom: 5px; 183 | } 184 | 185 | div.admonition pre { 186 | margin-bottom: 5px; 187 | } 188 | 189 | div.admonition ul, div.admonition ol { 190 | margin-bottom: 5px; 191 | } 192 | 193 | div.note { 194 | background-color: #eee; 195 | border: 1px solid #ccc; 196 | } 197 | 198 | div.seealso { 199 | background-color: #ffc; 200 | border: 1px solid #ff6; 201 | } 202 | 203 | div.topic { 204 | background-color: #eee; 205 | } 206 | 207 | div.warning { 208 | background-color: #ffe4e4; 209 | border: 1px solid #f66; 210 | } 211 | 212 | p.admonition-title { 213 | display: inline; 214 | } 215 | 216 | p.admonition-title:after { 217 | content: ":"; 218 | } 219 | 220 | pre { 221 | padding: 5px; 222 | background-color: #eeffcc; 223 | color: #333333; 224 | line-height: 120%; 225 | border: 1px solid #ac9; 226 | border-left: none; 227 | border-right: none; 228 | } 229 | 230 | code { 231 | background-color: #ecf0f3; 232 | padding: 0 1px 0 1px; 233 | font-size: 0.95em; 234 | } 235 | 236 | th { 237 | background-color: #ede; 238 | } 239 | 240 | .warning code { 241 | background: #efc2c2; 242 | } 243 | 244 | .note code { 245 | background: #d6d6d6; 246 | } 247 | 248 | .viewcode-back { 249 | font-family: sans-serif; 250 | } 251 | 252 | div.viewcode-block:target { 253 | background-color: #f4debf; 254 | border-top: 1px solid #ac9; 255 | border-bottom: 1px solid #ac9; 256 | } 257 | 258 | div.code-block-caption { 259 | color: #efefef; 260 | background-color: #1c4e63; 261 | } -------------------------------------------------------------------------------- /doc/_build/html/_static/colinearity-merged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/colinearity-merged.png -------------------------------------------------------------------------------- /doc/_build/html/_static/colinearity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/colinearity.png -------------------------------------------------------------------------------- /doc/_build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /doc/_build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/comment-close.png -------------------------------------------------------------------------------- /doc/_build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/comment.png -------------------------------------------------------------------------------- /doc/_build/html/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* This file intentionally left blank. */ 2 | -------------------------------------------------------------------------------- /doc/_build/html/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s === 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node, addItems) { 70 | if (node.nodeType === 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && 74 | !jQuery(node.parentNode).hasClass(className) && 75 | !jQuery(node.parentNode).hasClass("nohighlight")) { 76 | var span; 77 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 78 | if (isInSVG) { 79 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 80 | } else { 81 | span = document.createElement("span"); 82 | span.className = className; 83 | } 84 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 85 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 86 | document.createTextNode(val.substr(pos + text.length)), 87 | node.nextSibling)); 88 | node.nodeValue = val.substr(0, pos); 89 | if (isInSVG) { 90 | var bbox = span.getBBox(); 91 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 92 | rect.x.baseVal.value = bbox.x; 93 | rect.y.baseVal.value = bbox.y; 94 | rect.width.baseVal.value = bbox.width; 95 | rect.height.baseVal.value = bbox.height; 96 | rect.setAttribute('class', className); 97 | var parentOfText = node.parentNode.parentNode; 98 | addItems.push({ 99 | "parent": node.parentNode, 100 | "target": rect}); 101 | } 102 | } 103 | } 104 | else if (!jQuery(node).is("button, select, textarea")) { 105 | jQuery.each(node.childNodes, function() { 106 | highlight(this, addItems); 107 | }); 108 | } 109 | } 110 | var addItems = []; 111 | var result = this.each(function() { 112 | highlight(this, addItems); 113 | }); 114 | for (var i = 0; i < addItems.length; ++i) { 115 | jQuery(addItems[i].parent).before(addItems[i].target); 116 | } 117 | return result; 118 | }; 119 | 120 | /* 121 | * backward compatibility for jQuery.browser 122 | * This will be supported until firefox bug is fixed. 123 | */ 124 | if (!jQuery.browser) { 125 | jQuery.uaMatch = function(ua) { 126 | ua = ua.toLowerCase(); 127 | 128 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 129 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 130 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 131 | /(msie) ([\w.]+)/.exec(ua) || 132 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 133 | []; 134 | 135 | return { 136 | browser: match[ 1 ] || "", 137 | version: match[ 2 ] || "0" 138 | }; 139 | }; 140 | jQuery.browser = {}; 141 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 142 | } 143 | 144 | /** 145 | * Small JavaScript module for the documentation. 146 | */ 147 | var Documentation = { 148 | 149 | init : function() { 150 | this.fixFirefoxAnchorBug(); 151 | this.highlightSearchWords(); 152 | this.initIndexTable(); 153 | if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { 154 | this.initOnKeyListeners(); 155 | } 156 | }, 157 | 158 | /** 159 | * i18n support 160 | */ 161 | TRANSLATIONS : {}, 162 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 163 | LOCALE : 'unknown', 164 | 165 | // gettext and ngettext don't access this so that the functions 166 | // can safely bound to a different name (_ = Documentation.gettext) 167 | gettext : function(string) { 168 | var translated = Documentation.TRANSLATIONS[string]; 169 | if (typeof translated === 'undefined') 170 | return string; 171 | return (typeof translated === 'string') ? translated : translated[0]; 172 | }, 173 | 174 | ngettext : function(singular, plural, n) { 175 | var translated = Documentation.TRANSLATIONS[singular]; 176 | if (typeof translated === 'undefined') 177 | return (n == 1) ? singular : plural; 178 | return translated[Documentation.PLURALEXPR(n)]; 179 | }, 180 | 181 | addTranslations : function(catalog) { 182 | for (var key in catalog.messages) 183 | this.TRANSLATIONS[key] = catalog.messages[key]; 184 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 185 | this.LOCALE = catalog.locale; 186 | }, 187 | 188 | /** 189 | * add context elements like header anchor links 190 | */ 191 | addContextElements : function() { 192 | $('div[id] > :header:first').each(function() { 193 | $('\u00B6'). 194 | attr('href', '#' + this.id). 195 | attr('title', _('Permalink to this headline')). 196 | appendTo(this); 197 | }); 198 | $('dt[id]').each(function() { 199 | $('\u00B6'). 200 | attr('href', '#' + this.id). 201 | attr('title', _('Permalink to this definition')). 202 | appendTo(this); 203 | }); 204 | }, 205 | 206 | /** 207 | * workaround a firefox stupidity 208 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 209 | */ 210 | fixFirefoxAnchorBug : function() { 211 | if (document.location.hash && $.browser.mozilla) 212 | window.setTimeout(function() { 213 | document.location.href += ''; 214 | }, 10); 215 | }, 216 | 217 | /** 218 | * highlight the search words provided in the url in the text 219 | */ 220 | highlightSearchWords : function() { 221 | var params = $.getQueryParameters(); 222 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 223 | if (terms.length) { 224 | var body = $('div.body'); 225 | if (!body.length) { 226 | body = $('body'); 227 | } 228 | window.setTimeout(function() { 229 | $.each(terms, function() { 230 | body.highlightText(this.toLowerCase(), 'highlighted'); 231 | }); 232 | }, 10); 233 | $('') 235 | .appendTo($('#searchbox')); 236 | } 237 | }, 238 | 239 | /** 240 | * init the domain index toggle buttons 241 | */ 242 | initIndexTable : function() { 243 | var togglers = $('img.toggler').click(function() { 244 | var src = $(this).attr('src'); 245 | var idnum = $(this).attr('id').substr(7); 246 | $('tr.cg-' + idnum).toggle(); 247 | if (src.substr(-9) === 'minus.png') 248 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 249 | else 250 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 251 | }).css('display', ''); 252 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 253 | togglers.click(); 254 | } 255 | }, 256 | 257 | /** 258 | * helper function to hide the search marks again 259 | */ 260 | hideSearchWords : function() { 261 | $('#searchbox .highlight-link').fadeOut(300); 262 | $('span.highlighted').removeClass('highlighted'); 263 | }, 264 | 265 | /** 266 | * make the url absolute 267 | */ 268 | makeURL : function(relativeURL) { 269 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 270 | }, 271 | 272 | /** 273 | * get the current relative url 274 | */ 275 | getCurrentURL : function() { 276 | var path = document.location.pathname; 277 | var parts = path.split(/\//); 278 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 279 | if (this === '..') 280 | parts.pop(); 281 | }); 282 | var url = parts.join('/'); 283 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 284 | }, 285 | 286 | initOnKeyListeners: function() { 287 | $(document).keyup(function(event) { 288 | var activeElementType = document.activeElement.tagName; 289 | // don't navigate when in search box or textarea 290 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 291 | switch (event.keyCode) { 292 | case 37: // left 293 | var prevHref = $('link[rel="prev"]').prop('href'); 294 | if (prevHref) { 295 | window.location.href = prevHref; 296 | return false; 297 | } 298 | case 39: // right 299 | var nextHref = $('link[rel="next"]').prop('href'); 300 | if (nextHref) { 301 | window.location.href = nextHref; 302 | return false; 303 | } 304 | } 305 | } 306 | }); 307 | } 308 | }; 309 | 310 | // quick alias for translations 311 | _ = Documentation.gettext; 312 | 313 | $(document).ready(function() { 314 | Documentation.init(); 315 | }); 316 | -------------------------------------------------------------------------------- /doc/_build/html/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '0.1', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | FILE_SUFFIX: '.html', 7 | HAS_SOURCE: true, 8 | SOURCELINK_SUFFIX: '.txt', 9 | NAVIGATION_WITH_KEYS: false, 10 | SEARCH_LANGUAGE_STOP_WORDS: ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"] 11 | }; 12 | 13 | 14 | 15 | /* Non-minified version JS is _stemmer.js if file is provided */ 16 | /** 17 | * Porter Stemmer 18 | */ 19 | var Stemmer = function() { 20 | 21 | var step2list = { 22 | ational: 'ate', 23 | tional: 'tion', 24 | enci: 'ence', 25 | anci: 'ance', 26 | izer: 'ize', 27 | bli: 'ble', 28 | alli: 'al', 29 | entli: 'ent', 30 | eli: 'e', 31 | ousli: 'ous', 32 | ization: 'ize', 33 | ation: 'ate', 34 | ator: 'ate', 35 | alism: 'al', 36 | iveness: 'ive', 37 | fulness: 'ful', 38 | ousness: 'ous', 39 | aliti: 'al', 40 | iviti: 'ive', 41 | biliti: 'ble', 42 | logi: 'log' 43 | }; 44 | 45 | var step3list = { 46 | icate: 'ic', 47 | ative: '', 48 | alize: 'al', 49 | iciti: 'ic', 50 | ical: 'ic', 51 | ful: '', 52 | ness: '' 53 | }; 54 | 55 | var c = "[^aeiou]"; // consonant 56 | var v = "[aeiouy]"; // vowel 57 | var C = c + "[^aeiouy]*"; // consonant sequence 58 | var V = v + "[aeiou]*"; // vowel sequence 59 | 60 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 61 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 62 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 63 | var s_v = "^(" + C + ")?" + v; // vowel in stem 64 | 65 | this.stemWord = function (w) { 66 | var stem; 67 | var suffix; 68 | var firstch; 69 | var origword = w; 70 | 71 | if (w.length < 3) 72 | return w; 73 | 74 | var re; 75 | var re2; 76 | var re3; 77 | var re4; 78 | 79 | firstch = w.substr(0,1); 80 | if (firstch == "y") 81 | w = firstch.toUpperCase() + w.substr(1); 82 | 83 | // Step 1a 84 | re = /^(.+?)(ss|i)es$/; 85 | re2 = /^(.+?)([^s])s$/; 86 | 87 | if (re.test(w)) 88 | w = w.replace(re,"$1$2"); 89 | else if (re2.test(w)) 90 | w = w.replace(re2,"$1$2"); 91 | 92 | // Step 1b 93 | re = /^(.+?)eed$/; 94 | re2 = /^(.+?)(ed|ing)$/; 95 | if (re.test(w)) { 96 | var fp = re.exec(w); 97 | re = new RegExp(mgr0); 98 | if (re.test(fp[1])) { 99 | re = /.$/; 100 | w = w.replace(re,""); 101 | } 102 | } 103 | else if (re2.test(w)) { 104 | var fp = re2.exec(w); 105 | stem = fp[1]; 106 | re2 = new RegExp(s_v); 107 | if (re2.test(stem)) { 108 | w = stem; 109 | re2 = /(at|bl|iz)$/; 110 | re3 = new RegExp("([^aeiouylsz])\\1$"); 111 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 112 | if (re2.test(w)) 113 | w = w + "e"; 114 | else if (re3.test(w)) { 115 | re = /.$/; 116 | w = w.replace(re,""); 117 | } 118 | else if (re4.test(w)) 119 | w = w + "e"; 120 | } 121 | } 122 | 123 | // Step 1c 124 | re = /^(.+?)y$/; 125 | if (re.test(w)) { 126 | var fp = re.exec(w); 127 | stem = fp[1]; 128 | re = new RegExp(s_v); 129 | if (re.test(stem)) 130 | w = stem + "i"; 131 | } 132 | 133 | // Step 2 134 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 135 | if (re.test(w)) { 136 | var fp = re.exec(w); 137 | stem = fp[1]; 138 | suffix = fp[2]; 139 | re = new RegExp(mgr0); 140 | if (re.test(stem)) 141 | w = stem + step2list[suffix]; 142 | } 143 | 144 | // Step 3 145 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 146 | if (re.test(w)) { 147 | var fp = re.exec(w); 148 | stem = fp[1]; 149 | suffix = fp[2]; 150 | re = new RegExp(mgr0); 151 | if (re.test(stem)) 152 | w = stem + step3list[suffix]; 153 | } 154 | 155 | // Step 4 156 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 157 | re2 = /^(.+?)(s|t)(ion)$/; 158 | if (re.test(w)) { 159 | var fp = re.exec(w); 160 | stem = fp[1]; 161 | re = new RegExp(mgr1); 162 | if (re.test(stem)) 163 | w = stem; 164 | } 165 | else if (re2.test(w)) { 166 | var fp = re2.exec(w); 167 | stem = fp[1] + fp[2]; 168 | re2 = new RegExp(mgr1); 169 | if (re2.test(stem)) 170 | w = stem; 171 | } 172 | 173 | // Step 5 174 | re = /^(.+?)e$/; 175 | if (re.test(w)) { 176 | var fp = re.exec(w); 177 | stem = fp[1]; 178 | re = new RegExp(mgr1); 179 | re2 = new RegExp(meq1); 180 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 181 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 182 | w = stem; 183 | } 184 | re = /ll$/; 185 | re2 = new RegExp(mgr1); 186 | if (re.test(w) && re2.test(w)) { 187 | re = /.$/; 188 | w = w.replace(re,""); 189 | } 190 | 191 | // and turn initial Y back to y 192 | if (firstch == "y") 193 | w = firstch.toLowerCase() + w.substr(1); 194 | return w; 195 | } 196 | } 197 | 198 | 199 | 200 | 201 | 202 | var splitChars = (function() { 203 | var result = {}; 204 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 205 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 206 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 207 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 208 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 209 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 210 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 211 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 212 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 213 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 214 | var i, j, start, end; 215 | for (i = 0; i < singles.length; i++) { 216 | result[singles[i]] = true; 217 | } 218 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 219 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 220 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 221 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 222 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 223 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 224 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 225 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 226 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 227 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 228 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 229 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 230 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 231 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 232 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 233 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 234 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 235 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 236 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 237 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 238 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 239 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 240 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 241 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 242 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 243 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 244 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 245 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 246 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 247 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 248 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 249 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 250 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 251 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 252 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 253 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 254 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 255 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 256 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 257 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 258 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 259 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 260 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 261 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 262 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 263 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 264 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 265 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 266 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 267 | for (i = 0; i < ranges.length; i++) { 268 | start = ranges[i][0]; 269 | end = ranges[i][1]; 270 | for (j = start; j <= end; j++) { 271 | result[j] = true; 272 | } 273 | } 274 | return result; 275 | })(); 276 | 277 | function splitQuery(query) { 278 | var result = []; 279 | var start = -1; 280 | for (var i = 0; i < query.length; i++) { 281 | if (splitChars[query.charCodeAt(i)]) { 282 | if (start !== -1) { 283 | result.push(query.slice(start, i)); 284 | start = -1; 285 | } 286 | } else if (start === -1) { 287 | start = i; 288 | } 289 | } 290 | if (start !== -1) { 291 | result.push(query.slice(start)); 292 | } 293 | return result; 294 | } 295 | 296 | 297 | -------------------------------------------------------------------------------- /doc/_build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /doc/_build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/down.png -------------------------------------------------------------------------------- /doc/_build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/file.png -------------------------------------------------------------------------------- /doc/_build/html/_static/hex-maui-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/hex-maui-120.png -------------------------------------------------------------------------------- /doc/_build/html/_static/hex-maui-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/hex-maui-200.png -------------------------------------------------------------------------------- /doc/_build/html/_static/hex-maui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/hex-maui.png -------------------------------------------------------------------------------- /doc/_build/html/_static/hist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/hist.png -------------------------------------------------------------------------------- /doc/_build/html/_static/icons8-beach-30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/icons8-beach-30.png -------------------------------------------------------------------------------- /doc/_build/html/_static/integration-autoencoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/integration-autoencoder.png -------------------------------------------------------------------------------- /doc/_build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/minus.png -------------------------------------------------------------------------------- /doc/_build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/plus.png -------------------------------------------------------------------------------- /doc/_build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #f8f8f8; } 3 | .highlight .c { color: #8f5902; font-style: italic } /* Comment */ 4 | .highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ 5 | .highlight .g { color: #000000 } /* Generic */ 6 | .highlight .k { color: #004461; font-weight: bold } /* Keyword */ 7 | .highlight .l { color: #000000 } /* Literal */ 8 | .highlight .n { color: #000000 } /* Name */ 9 | .highlight .o { color: #582800 } /* Operator */ 10 | .highlight .x { color: #000000 } /* Other */ 11 | .highlight .p { color: #000000; font-weight: bold } /* Punctuation */ 12 | .highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */ 13 | .highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ 14 | .highlight .cp { color: #8f5902 } /* Comment.Preproc */ 15 | .highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */ 16 | .highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ 17 | .highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ 18 | .highlight .gd { color: #a40000 } /* Generic.Deleted */ 19 | .highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ 20 | .highlight .gr { color: #ef2929 } /* Generic.Error */ 21 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 22 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 23 | .highlight .go { color: #888888 } /* Generic.Output */ 24 | .highlight .gp { color: #745334 } /* Generic.Prompt */ 25 | .highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */ 26 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 27 | .highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ 28 | .highlight .kc { color: #004461; font-weight: bold } /* Keyword.Constant */ 29 | .highlight .kd { color: #004461; font-weight: bold } /* Keyword.Declaration */ 30 | .highlight .kn { color: #004461; font-weight: bold } /* Keyword.Namespace */ 31 | .highlight .kp { color: #004461; font-weight: bold } /* Keyword.Pseudo */ 32 | .highlight .kr { color: #004461; font-weight: bold } /* Keyword.Reserved */ 33 | .highlight .kt { color: #004461; font-weight: bold } /* Keyword.Type */ 34 | .highlight .ld { color: #000000 } /* Literal.Date */ 35 | .highlight .m { color: #990000 } /* Literal.Number */ 36 | .highlight .s { color: #4e9a06 } /* Literal.String */ 37 | .highlight .na { color: #c4a000 } /* Name.Attribute */ 38 | .highlight .nb { color: #004461 } /* Name.Builtin */ 39 | .highlight .nc { color: #000000 } /* Name.Class */ 40 | .highlight .no { color: #000000 } /* Name.Constant */ 41 | .highlight .nd { color: #888888 } /* Name.Decorator */ 42 | .highlight .ni { color: #ce5c00 } /* Name.Entity */ 43 | .highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ 44 | .highlight .nf { color: #000000 } /* Name.Function */ 45 | .highlight .nl { color: #f57900 } /* Name.Label */ 46 | .highlight .nn { color: #000000 } /* Name.Namespace */ 47 | .highlight .nx { color: #000000 } /* Name.Other */ 48 | .highlight .py { color: #000000 } /* Name.Property */ 49 | .highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */ 50 | .highlight .nv { color: #000000 } /* Name.Variable */ 51 | .highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */ 52 | .highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */ 53 | .highlight .mb { color: #990000 } /* Literal.Number.Bin */ 54 | .highlight .mf { color: #990000 } /* Literal.Number.Float */ 55 | .highlight .mh { color: #990000 } /* Literal.Number.Hex */ 56 | .highlight .mi { color: #990000 } /* Literal.Number.Integer */ 57 | .highlight .mo { color: #990000 } /* Literal.Number.Oct */ 58 | .highlight .sa { color: #4e9a06 } /* Literal.String.Affix */ 59 | .highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */ 60 | .highlight .sc { color: #4e9a06 } /* Literal.String.Char */ 61 | .highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */ 62 | .highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ 63 | .highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ 64 | .highlight .se { color: #4e9a06 } /* Literal.String.Escape */ 65 | .highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ 66 | .highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ 67 | .highlight .sx { color: #4e9a06 } /* Literal.String.Other */ 68 | .highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ 69 | .highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ 70 | .highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ 71 | .highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ 72 | .highlight .fm { color: #000000 } /* Name.Function.Magic */ 73 | .highlight .vc { color: #000000 } /* Name.Variable.Class */ 74 | .highlight .vg { color: #000000 } /* Name.Variable.Global */ 75 | .highlight .vi { color: #000000 } /* Name.Variable.Instance */ 76 | .highlight .vm { color: #000000 } /* Name.Variable.Magic */ 77 | .highlight .il { color: #990000 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /doc/_build/html/_static/sidebar.js: -------------------------------------------------------------------------------- 1 | /* 2 | * sidebar.js 3 | * ~~~~~~~~~~ 4 | * 5 | * This script makes the Sphinx sidebar collapsible. 6 | * 7 | * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds 8 | * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton 9 | * used to collapse and expand the sidebar. 10 | * 11 | * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden 12 | * and the width of the sidebar and the margin-left of the document 13 | * are decreased. When the sidebar is expanded the opposite happens. 14 | * This script saves a per-browser/per-session cookie used to 15 | * remember the position of the sidebar among the pages. 16 | * Once the browser is closed the cookie is deleted and the position 17 | * reset to the default (expanded). 18 | * 19 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 20 | * :license: BSD, see LICENSE for details. 21 | * 22 | */ 23 | 24 | $(function() { 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | // global elements used by the functions. 34 | // the 'sidebarbutton' element is defined as global after its 35 | // creation, in the add_sidebar_button function 36 | var bodywrapper = $('.bodywrapper'); 37 | var sidebar = $('.sphinxsidebar'); 38 | var sidebarwrapper = $('.sphinxsidebarwrapper'); 39 | 40 | // for some reason, the document has no sidebar; do not run into errors 41 | if (!sidebar.length) return; 42 | 43 | // original margin-left of the bodywrapper and width of the sidebar 44 | // with the sidebar expanded 45 | var bw_margin_expanded = bodywrapper.css('margin-left'); 46 | var ssb_width_expanded = sidebar.width(); 47 | 48 | // margin-left of the bodywrapper and width of the sidebar 49 | // with the sidebar collapsed 50 | var bw_margin_collapsed = '.8em'; 51 | var ssb_width_collapsed = '.8em'; 52 | 53 | // colors used by the current theme 54 | var dark_color = $('.related').css('background-color'); 55 | var light_color = $('.document').css('background-color'); 56 | 57 | function sidebar_is_collapsed() { 58 | return sidebarwrapper.is(':not(:visible)'); 59 | } 60 | 61 | function toggle_sidebar() { 62 | if (sidebar_is_collapsed()) 63 | expand_sidebar(); 64 | else 65 | collapse_sidebar(); 66 | } 67 | 68 | function collapse_sidebar() { 69 | sidebarwrapper.hide(); 70 | sidebar.css('width', ssb_width_collapsed); 71 | bodywrapper.css('margin-left', bw_margin_collapsed); 72 | sidebarbutton.css({ 73 | 'margin-left': '0', 74 | 'height': bodywrapper.height() 75 | }); 76 | sidebarbutton.find('span').text('»'); 77 | sidebarbutton.attr('title', _('Expand sidebar')); 78 | document.cookie = 'sidebar=collapsed'; 79 | } 80 | 81 | function expand_sidebar() { 82 | bodywrapper.css('margin-left', bw_margin_expanded); 83 | sidebar.css('width', ssb_width_expanded); 84 | sidebarwrapper.show(); 85 | sidebarbutton.css({ 86 | 'margin-left': ssb_width_expanded-12, 87 | 'height': bodywrapper.height() 88 | }); 89 | sidebarbutton.find('span').text('«'); 90 | sidebarbutton.attr('title', _('Collapse sidebar')); 91 | document.cookie = 'sidebar=expanded'; 92 | } 93 | 94 | function add_sidebar_button() { 95 | sidebarwrapper.css({ 96 | 'float': 'left', 97 | 'margin-right': '0', 98 | 'width': ssb_width_expanded - 28 99 | }); 100 | // create the button 101 | sidebar.append( 102 | '
«
' 103 | ); 104 | var sidebarbutton = $('#sidebarbutton'); 105 | light_color = sidebarbutton.css('background-color'); 106 | // find the height of the viewport to center the '<<' in the page 107 | var viewport_height; 108 | if (window.innerHeight) 109 | viewport_height = window.innerHeight; 110 | else 111 | viewport_height = $(window).height(); 112 | sidebarbutton.find('span').css({ 113 | 'display': 'block', 114 | 'margin-top': (viewport_height - sidebar.position().top - 20) / 2 115 | }); 116 | 117 | sidebarbutton.click(toggle_sidebar); 118 | sidebarbutton.attr('title', _('Collapse sidebar')); 119 | sidebarbutton.css({ 120 | 'color': '#FFFFFF', 121 | 'border-left': '1px solid ' + dark_color, 122 | 'font-size': '1.2em', 123 | 'cursor': 'pointer', 124 | 'height': bodywrapper.height(), 125 | 'padding-top': '1px', 126 | 'margin-left': ssb_width_expanded - 12 127 | }); 128 | 129 | sidebarbutton.hover( 130 | function () { 131 | $(this).css('background-color', dark_color); 132 | }, 133 | function () { 134 | $(this).css('background-color', light_color); 135 | } 136 | ); 137 | } 138 | 139 | function set_position_from_cookie() { 140 | if (!document.cookie) 141 | return; 142 | var items = document.cookie.split(';'); 143 | for(var k=0; k2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /doc/_build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /doc/_build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/_static/up.png -------------------------------------------------------------------------------- /doc/_build/html/autoencoder-integration.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Multi-modal Autoencoders — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 |
33 |
34 | 35 | 36 |
37 | 38 |
39 |

Multi-modal Autoencoders

40 |

Autoencoders are hourglass-shaped neural networks that are trained to reconstruct the input data after passing it through a bottleneck layer. Thereby, autoencoders learn an efficient lower dimension representation of high-dimensional data, a “latent factor” representation of the data. The Multi-modal autoencoders take data from different modalities and learn latent factor representations of the data. In the figure below, the direction of data flow is left to right. The three different-colored matrices on the left represent data from three different modalities. The three matrices on the right represent the reconstruction of the input data, and the mixed-color matrix on the bottom represents the latent factor view of the data.

41 |
42 | _images/integration-autoencoder.png 43 |
44 |

Integration Autoencoder

45 |
46 |

Variational Autoencoders

47 |

Maui uses a Variational Autoencoder, which means it learns a bayesian latent variable model. This is achieved by minimizing the following loss function:

48 |

\(\mathcal{L} = -\mathbf{E}_{q(z|x)}\big[ log(p(x|z)) \big] + D_{KL}\big( q(z|x)~\|~p(z) \big)\)

49 |

The first term represents the cross-entropy reconstruction loss, and the second term is the Kullback-Leibler divergence between the latent factors distribution and a gaussian prior \(p(z)\).

50 |
51 |
52 |

Stacked Autoencoders

53 |

As the figure above indicates, it is possible to insert extra layers between the input and the bottleneck layers, and between the bottleneck and the output layers. This is sometimes called stacked autoencoders. The Maui Class allows this architecture to be varied when instantiating the model, using the n_hidden parameter. The n_latent parameter determines the size of the bottleneck layer (latent factor layer).

54 |
maui_model = maui.Maui(n_hidden=[900], n_latent=70)
 55 | 
56 |
57 |

instantiates a Maui model with one hidden layer with 900 units, and 70 units in the bottleneck layer, while

58 |
maui_model = maui.Maui(n_hidden=[1300, 900], n_latent=60)
 59 | 
60 |
61 |

will instantiate a maui model with two hidden layers with 1300 and 900 units, respectively.

62 |
63 |
64 | 65 | 66 |
67 | 68 |
69 |
70 | 128 |
129 |
130 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /doc/_build/html/data-normalization.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Data and Normalization — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 |
33 |
34 | 35 | 36 |
37 | 38 |
39 |

Data and Normalization

40 |

All features need to be scaled and centered prior to feeding to the neural network of maui. This limitation comes from the fact that the last layer, where the input data is reconstructed, uses Sigmoid activations. Maui uses Batch Normalization during training, where each input feature is normalized at each minibatch. We still recommend that data be scaled prior to training. We provide a function that does this in the Maui Utilities.

41 |
42 |
43 | maui.utils.scale(df)[source]
44 |

Scale and center data

45 |

df: pd.DataFrame (n_features, n_samples) non-scaled data

46 |

scaled: pd.DataFrame (n_features, n_samples) scaled data

47 |
48 | 49 |
50 | 51 | 52 |
53 | 54 |
55 |
56 | 110 |
111 |
112 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /doc/_build/html/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | Index — 0.1 documentation 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |
33 | 34 | 35 |
36 | 37 | 38 |

Index

39 | 40 |
41 | C 42 | | D 43 | | E 44 | | F 45 | | G 46 | | L 47 | | M 48 | | S 49 | | T 50 | 51 |
52 |

C

53 | 54 | 62 | 74 |
75 | 76 |

D

77 | 78 | 86 |
87 | 88 |

E

89 | 90 | 94 |
95 | 96 |

F

97 | 98 | 102 | 108 |
109 | 110 |

G

111 | 112 | 116 |
117 | 118 |

L

119 | 120 | 128 |
129 | 130 |

M

131 | 132 | 140 | 152 |
153 | 154 |

S

155 | 156 | 164 | 174 |
175 | 176 |

T

177 | 178 | 182 |
183 | 184 | 185 | 186 |
187 | 188 |
189 |
190 | 243 |
244 |
245 | 253 | 254 | 255 | 256 | 257 | 258 | -------------------------------------------------------------------------------- /doc/_build/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Multi-omics Autoencoder Integration (maui) — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |
33 | 34 | 35 |
36 | 37 |
38 |

Multi-omics Autoencoder Integration (maui)

39 |

maui is an autoencoder-based framework for multi-omics data analysis. It consists of two main modules, The Maui Class, and Maui Utilities. For an introduction of the use of autoencoders for multi-omics integration, see Multi-modal Autoencoders.

40 | 66 |
67 |

Quickstart

68 |

The Maui class implements scikit-learn’s BaseEstimator. In order to infer latent factors in multi-omics data, first instantiate a Maui model with the desired parameters, and then fit it to some data:

69 |
from maui import Maui
 70 | 
 71 | maui_model = maui.Maui(n_hidden=[900], n_latent=70, epochs=100)
 72 | z = maui_model.fit_transform({'mRNA': gex, 'Mutations': mut, 'CNV': cnv})
 73 | 
74 |
75 |

This will instantiate a maui model with one hidden layer of 900 nodes, and a middle layer of 70 nodes, which will be traiend for 100 epochs. It then feeds the multi-omics data in gex, mut, and cnv to the fitting procedure. The omics data (gex et. al.) are pandas.DataFrame objects of dimension (n_features, n_samples). The return object z is a pandas.DataFrame (n_samples, n_latent), and may be used for further analysis.

76 |

In order to check the model’s convergance, the hist object may be inspected, and plotted:

77 |
maui_model.hist.plot()
 78 | 
79 |
80 | _images/hist.png 81 |

For a more comprehensive example, check out our vignette.

82 |
83 |

Indices and tables

84 | 89 |
90 |
91 |
92 | 93 | 94 |
95 | 96 |
97 |
98 | 152 |
153 |
154 | 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /doc/_build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_build/html/objects.inv -------------------------------------------------------------------------------- /doc/_build/html/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Python Module Index — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 | 37 |
38 | 39 | 40 |

Python Module Index

41 | 42 |
43 | m 44 |
45 | 46 | 47 | 48 | 50 | 51 | 53 | 56 | 57 | 58 | 61 |
 
49 | m
54 | maui 55 |
    59 | maui.utils 60 |
62 | 63 | 64 |
65 | 66 |
67 |
68 | 121 |
122 |
123 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /doc/_build/html/saving-and-loading-models.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Saving and loading models — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 |
33 |
34 | 35 | 36 |
37 | 38 |
39 |

Saving and loading models

40 |

Maui models may be saved to disk, so that they may be loaded again at a later time.

41 |
42 |

Saving a trained model to disk

43 |

Saving a model to disk involves saving two files to a target directory. These files store the model weights and the maui parameters (the arguments the maui model was instantiated with). The Maui Class implements a the save function

44 |
45 |
46 | maui.Maui.save(self, destdir)
47 |

Save a maui model to disk, so that it may be reloaded later using load()

48 |

destdir: destination directory in which to save model files

49 |
50 | 51 |

The function takes one required parameter, the destination directory where the two files will be saved. It is called directly on a maui model, like

52 |
maui_model.save('/path/to/dir')
 53 | 
54 |
55 |
56 |
57 |

Loading a model from disk

58 |

Loading a model involves instantiating a new Maui instance using the parameters that were used on the model that is saved to disk, and then populating the weights of the model to the previously trained weights. Once a model is loaded, it can be used to transform new data to the latent space, or it can be trained further. The Maui Class has a static function to load a model from disk

59 |
60 |
61 | maui.Maui.load(dir)
62 |

Load a maui model from disk, which was previously saved using save()

63 |

dir: The directory from which to load the maui model

64 |

maui_model: a maui model that was previously saved to disk

65 |
66 | 67 |

It is called directly on the Maui class, like

68 |
maui.Maui.load('/path/to/dir')
 69 | 
70 |
71 |
72 |
73 | 74 | 75 |
76 | 77 |
78 |
79 | 138 |
139 |
140 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /doc/_build/html/search.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | Search — 0.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 |
40 |
41 | 42 | 43 |
44 | 45 |

Search

46 |
47 | 48 |

49 | Please activate JavaScript to enable the search 50 | functionality. 51 |

52 |
53 |

54 | From here you can search these documents. Enter your search 55 | words into the box below and click "search". Note that the search 56 | function will automatically search for all of the words. Pages 57 | containing fewer words won't appear in the result list. 58 |

59 |
60 | 61 | 62 | 63 |
64 | 65 |
66 | 67 |
68 | 69 |
70 | 71 |
72 |
73 | 114 |
115 |
116 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /doc/_build/html/searchindex.js: -------------------------------------------------------------------------------- 1 | Search.setIndex({docnames:["autoencoder-integration","data-normalization","filtering-and-merging-latent-factors","index","maui","saving-and-loading-models","utils"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,"sphinx.ext.viewcode":1,sphinx:55},filenames:["autoencoder-integration.rst","data-normalization.rst","filtering-and-merging-latent-factors.rst","index.rst","maui.rst","saving-and-loading-models.rst","utils.rst"],objects:{"maui.Maui":{c_index:[4,1,1,""],cluster:[4,1,1,""],compute_auc:[4,1,1,""],compute_roc:[4,1,1,""],fit:[4,1,1,""],fit_transform:[4,1,1,""],get_linear_weights:[4,1,1,""],load:[5,2,1,""],save:[5,2,1,""],select_clinical_factors:[4,1,1,""],transform:[4,1,1,""]},"maui.utils":{compute_harrells_c:[6,2,1,""],compute_roc:[6,2,1,""],correlate_factors_and_features:[6,2,1,""],estimate_kaplan_meier:[6,2,1,""],filter_factors_by_r2:[6,2,1,""],map_factors_to_feaures_using_linear_models:[6,2,1,""],multivariate_logrank_test:[6,2,1,""],scale:[6,2,1,""]},maui:{Maui:[4,0,1,""],utils:[6,3,0,"-"]}},objnames:{"0":["py","class","Python class"],"1":["py","method","Python method"],"2":["py","function","Python function"],"3":["py","module","Python module"]},objtypes:{"0":"py:class","1":"py:method","2":"py:function","3":"py:module"},terms:{"abstract":[],"boolean":[2,4,6],"byte":[],"case":2,"class":[0,2,3,5,6],"default":[2,4,6],"final":[],"function":[0,1,2,4,5,6],"import":3,"int":4,"long":[],"new":5,"null":6,"public":[],"return":[3,4,6],"short":[],"static":[4,5],"switch":[],"true":[2,4,6],"try":[4,6],"while":[0,2,4,6],And:2,But:[],For:[2,3],Its:[],Not:4,One:[2,4],The:[0,2,3,5,6],Then:2,There:[],These:5,Use:[],Used:[2,4],_static:[],abov:[0,2,4,6],absolut:[],accept:[],access:[],accomplish:[2,4,6],accuraci:[4,6],achiev:0,act:[],activ:1,actual:[],add:[],added:[],addit:[],adjust:[2,4,6],after:[0,2],again:5,against:4,age:[2,4,6],all:[1,2,6],allow:0,alpha:[2,4,6],alreadi:[],also:[2,4],altern:[2,6],although:[],alwai:[],ami:4,ami_i:4,among:[4,6],analysi:[2,3,6],ani:[2,6],anoth:[2,6],append:[],appli:[],applic:[],approxim:[],arbitrari:2,architectur:[0,4],area:4,argument:[4,5],arrai:[4,6],assess:2,associ:[4,6],attempt:4,auc:[4,6],auroc:4,autoencod:4,avail:2,averag:4,axi:[2,4,6],back:[],base:[2,3,4,6],baseestim:3,basic:[],batch:[1,4],batch_normalize_embed:4,batch_normalize_input:4,batch_normalize_intermediari:4,batch_siz:4,bayesian:0,becaus:[],been:[2,4,6],befor:2,behav:[],being:[],below:[0,2,4,6],best:[4,6],between:[0,2,4,6],beyond:[],big:0,binari:[],blksize:[],block:[],blockingioerror:[],both:4,bottleneck:0,bottom:0,bound:[],buffer:[],buffer_s:[],bufferediobas:[],bufferedrandom:[],bufferedread:[],bufferedrwpair:[],bufferedwrit:[],builtin:[],bytearrai:[],bytesio:[],c_index:4,call:[0,2,4,5,6],callabl:4,caller:[],calss:2,can:[2,5],cannot:[],captur:2,center:[1,6],certain:[2,4],chang:[],charact:[],characterist:4,check:[2,3],chi:6,choic:[2,6],chosen:[],chunk:[],class_weight:6,classifi:6,client:[],clinic:[2,4,6],clinical_onli:4,close:[],closefd:[],cluster:[2,4,6],cnv:3,codec:[],coeffici:[2,4,6],color:0,column:[2,4,6],come:[1,2],common:[],complet:[2,4],comprehens:[2,3],comput:[2,4,6],compute_auc:4,compute_harrells_c:6,compute_roc:[4,6],concaten:[2,6],concatenated_data:6,connect:[],consid:4,consist:3,constructor:[],contain:[2,4,6],content:[],control:[2,4,6],converg:3,correl:[2,4,6],correlate_factors_and_featur:6,count:[],counterpart:[],covari:[2,4,6],cox:[2,4,6],cox_pen:[2,4,6],cox_penalti:[4,6],coxphfitt:[2,4,6],cph:[2,4,6],creat:[],creation:[],cross:[0,4,6],current:[],curv:[4,6],custom:[],cut:[2,6],cv_fold:[4,6],data:[0,2,3,4,5,6],datafram:[1,2,3,4,6],deal:[],death:[2,4,6],declar:[],decod:[],deep:4,def:[],default_buffer_s:[],defer:[],defin:[2,4,6],dendrogram:[2,4,6],depend:[],deprec:[],deriv:[],describ:[],descriptor:[],desir:3,destdir:[4,5],destin:[4,5],detach:[],determin:[0,2,4,6],devic:[],df1:4,df2:4,df_scale:[],diagnosi:[2,4,6],dict:[4,6],differ:[0,4,6],differenti:6,dimens:[0,2,3],dimension:0,dir:[4,5],direct:0,directli:[2,5],directori:[4,5],disabl:[],disconnect:[],disk:[3,4],distanc:[2,4,6],distance_in:[2,4],distance_metr:[2,4],distance_threshold:[2,4],distinguish:[],distribut:[0,4],diverg:0,document:[],doe:[1,2],doesn:[],down:[2,4],drop:[3,4],drop_unexplanatory_factor:[2,4],dual:6,dummi:[],durat:[2,4,6],duration_column:[2,4,6],dure:1,each:[1,2,4,6],effect:[],effici:0,egg:[],either:[],element:4,embed:[2,4],empti:[],enabl:[],encod:4,end:2,entir:[],entropi:0,eof:[],epoch:[3,4],epsilon_std:4,equal:[],equival:[],error:[],estim:[4,6],estimate_kaplan_mei:6,etc:4,even:2,exampl:[2,3],except:[],exclus:[],exist:[],expect:2,explanatori:2,expos:2,extend:[],extern:4,extra:0,facat:[2,6],fact:1,factor:[0,3,4,6],factorz:[2,4],failur:[],falc:[4,6],fall:[],fals:6,far:[],favtor:[2,4],featur:[1,2,4,6],feature_:6,feed:[1,3],figur:0,file:[4,5],fileexistserror:[],fileio:[],fileno:[],filter:[3,6],filter_factors_by_r2:[2,6],find:4,first:[0,3],fit:[2,3,4,6],fit_intercept:6,fit_transform:[3,4],fix:[],flag:[],flow:0,flush:[],fold:[4,6],follow:0,followup:[2,4,6],form:[2,6],fpr:[4,6],framework:3,from:[0,1,2,3,4,6],full:[],further:[3,5],futur:[],gaussian:0,gener:[],get:[4,6],get_linear_weight:[2,4],getbuff:[],getpreferredencod:[],getvalu:[],gex:3,give:4,given:[4,6],ground:[4,6],group:6,handl:[],harrel:[4,6],has:[2,5,6],have:[2,4,6],hazard:[2,4,6],heatmap:2,hello:[],help:[],here:[2,6],heurist:[],hidden:[0,3,4],hierarch:[2,6],hierarchi:[2,4,6],high:0,hist:3,histori:[],hit:[],hourglass:0,how:2,howev:[],hypothesi:6,ignor:[],imag:[],immedi:[],immin:[],immut:[],implement:[3,5],impli:[],includ:2,incomplet:[],index:[3,4,6],indic:[0,2,4,6],individu:[2,4,6],infer:[3,4],inform:[2,4,6],inherit:[],initi:4,initial_beta_v:4,initial_valu:[],input:[0,1,2,4,6],input_dim:4,insert:0,inspect:3,instanc:[2,5],instanti:[0,3,5],integ:[],integr:[0,4],intend:[],interact:[],intercept_sc:6,interest:2,interfac:[2,6],intermedi:4,interpret:[],introduct:3,involv:5,iobas:[],ioerror:[],isatti:[],isn:[],issu:[],iter:[],its:[],kaplan:6,kappa:4,keep:[2,4,6],kei:[4,6],kept:[],keyword:[],kind:[2,6],km_estim:6,kmean:4,kmeans_kwarg:4,known:[2,4,6],kullback:0,kwarg:4,label:[4,6],larg:2,last:[1,2,4,6],latent:[0,3,4,5,6],later:[2,4,5],layer:[0,1,3,4],lead:[],learn:[0,3,4],learning_r:4,least:6,leav:[],left:0,legal:[],leibler:0,length:[],less:[],level:4,lifelin:[2,4,6],like:[2,4,5,6],limit:1,line:[],line_buff:[],linear:[2,4,6],linearsvc:6,linesep:[],linkag:[2,4,6],linkage_method:[2,4],list:[],load:[3,4],local:[],log:[0,6],look:2,lose:2,loss:[0,4,6],low:[2,4],lower:[0,2],mai:[2,3,4,5],main:3,make:[],mani:[2,4],map:6,map_factors_to_featur:[],map_factors_to_feaures_using_linear_model:6,match:4,mathbf:0,mathcal:0,matplotlib:[2,4],matric:0,matrix:[0,2,4,6],maui:[0,1,2,5],maui_model:[0,3,4,5],max_beta_v:4,max_it:6,maximum:[],mean:[0,2,4,6],meier:6,memori:[],merg:[3,4,6],merge_factor:[2,6],merge_fn:[2,4,6],merge_similar_latent_factor:[2,4],method:[2,4],metric:[2,4,6],middl:[3,4],mini:4,minibatch:1,minim:0,mix:0,modal:[3,4],mode:4,model:[0,2,3,4,6],modul:3,moment:[],more:[2,3],most:[],move:[],mrna:[3,4],much:2,multi:[2,4,6],multi_class:6,multipl:[],multivari:6,multivariate_logrank_test:6,must:4,mut:3,mutat:3,mutual:4,mytabl:[],n_factor:[2,4,6],n_featur:[1,2,3,4,6],n_hidden:[0,3,4],n_init:4,n_job:4,n_latent:[0,3,4,6],n_latent_factor:[4,6],n_sampl:[1,2,3,4,6],name:[2,4,6],need:[1,4],neg:4,network:[0,1,4],neural:[0,1],never:[],newli:[2,6],newlin:[],next:[],node:[3,4],non:[1,4,6],none:[2,4,6],nonzero:[2,4,6],normal:3,note:[],noth:[],number:[2,4,6],numpi:[2,4,6],object:[2,3,4,6],observ:[2,4,6],observed_column:[2,4,6],obtain:4,off:[],offset:[],omic:[2,4,6],omit:[],onc:5,one:[0,2,3,4,5,6],ones:[2,6],onli:[2,4,6],open:[],oper:4,optim:4,optimal_k_method:4,optimal_k_rang:4,option:[2,4],order:[3,6],oserror:[],other:[2,4],otherwis:4,our:[2,3],out:[2,3],output:[0,2,6],over:[],overrid:[],ovr:6,own:[2,6],p_valu:6,page:3,panda:[3,4],paramet:[0,3,5],part:[],pass:0,path:5,patient:[2,6],pdist:[2,4,6],pearson:6,penal:4,penalti:[2,4,6],per:[4,6],perform:[],permit:[],pick:4,pipe:[],place:2,platform:[],plot:[2,3,4,6],plot_dendro:[2,6],plot_dendro_ax:[2,4,6],plot_dendrogram:[2,4],png:[],pointer:[],polici:[],popul:5,pos:[],posit:[4,6],possibl:0,power:2,pre:[2,6],predict:[2,4,6],preprocess:[],previous:[4,5],prior:[0,1],procedur:3,produc:2,proport:[2,4,6],protocol:[],provid:[1,2],put:[],pval_threshold:6,python:[],rais:[],random:[],random_st:6,rang:4,rank:6,rate:[4,6],raw:[],rawio:[],rawiobas:[],reach:[],read1:[],read:[],readabl:[],readal:[],reader:[],readi:[],readinto:[],readlin:[],receiv:4,recogn:[],recommend:[1,2],reconstruct:[0,1],regardless:[],regist:[],regress:[4,6],regular:4,rel:[],relev:[2,4,6],reload:[4,5],relu:4,relu_embed:4,relu_intermediari:4,repeatedli:[],report:[],repres:0,represent:[0,2,4,6],reproduc:4,request:[],requir:5,respect:0,result:4,retain:[],retriev:[],right:0,roc:[4,6],roc_curv:[4,6],run:[2,6],same:[2,6],sampl:[4,6],satisfi:[],save:[3,4],scalar:4,scale:[1,6],scikit:3,scipi:[2,4,6],score:[2,4],scorer:4,search:3,second:0,see:[2,3,4,6],seek:[],seek_cur:[],seek_end:[],seek_set:[],seekabl:[],sel_clin_alpha:4,sel_clin_penalti:4,select:[2,4,6],select_clinical_factor:[2,4,6],self:[2,4,5],sensor:6,separ:[],sequenti:[],seri:[4,6],set:[2,6],sex:[2,4,6],shape:0,should:4,show:[2,4,6],sigmoid:1,signatur:4,signific:4,silhouett:4,similar:[3,6],simpl:[],simpli:[],simultan:[],singl:[2,6],size:[0,4],sklearn:4,snp:4,socket:[],solver:[2,4,6],some:[2,3,4],sometim:0,sourc:[1,2,4,6],space:[2,4,5],spam:[],spatial:[2,4,6],specif:[],specifi:4,sql:[],squar:[2,6],squared_hing:6,squeez:[2,4],stack:[3,4],stage:[2,4,6],standard:[],standardscal:[],start:[],stat:[],state:[],statement:[],statist:6,still:1,store:[4,5],str:[],stream:2,strict:[],string:[],stringio:[],subclass:[],subset:[2,4,6],subtyp:6,success:4,succinct:2,suit:[],supervis:3,suppli:[2,6],support:[2,4,6],surviv:[2,4,6],svm:4,system:[],take:[0,2,5,6],target:5,tell:[],term:0,termin:[],test:6,test_statist:6,text:[],textio:[],textiobas:[],textiowrapp:[],than:[],thei:[2,5],therebi:0,thi:[0,1,2,3,4,6],those:[2,4,6],though:[],three:0,threshold:[2,4,6],through:0,time:[2,4,5,6],timelin:6,togeth:[],tol:6,too:[],top:[],total:[],tpr:[4,6],traiend:3,train:[0,1,2,3,4],transform:[4,5],translat:[],truncat:[],truth:[4,6],tty:[],tumor:[2,4,6],two:[0,3,5],txt:[],type:[],typic:[],unchang:[],under:[4,6],underli:[],unexplanatori:3,uninterest:2,unit:[0,4],univari:[2,4,6],univers:[],unix:[],unless:[],unlik:[],unspecifi:[],unsupervis:2,unsupportedoper:[],until:[],untransl:[],unus:[],updat:[],upon:[],usabl:[],use:[3,4,6],used:[2,3,4,5,6],usefulness:2,uses:[0,1,4],using:[0,2,4,5,6],usual:[],util:[1,2,3,4],vae:4,valid:[4,6],valu:[2,4,6],valueerror:[],vari:0,variabl:0,variat:[3,4],verbos:6,veri:2,version:[],view:0,vignett:[2,3],wai:2,weight:[5,6],well:[4,6],were:5,when:[0,2,4,6],whenc:[],where:[1,2,4,5,6],whether:[2,4,6],which:[0,2,3,4,5,6],whose:[2,4,6],without:2,work:[],would:[],wrap:[],writabl:[],write:[],writeabl:[],writelin:[],writer:[],written:[],x_valid:4,yhat:4,yield:[],your:[2,6],z_clinic:[2,4,6],z_filt:[2,4],z_filter:[2,6],zero:[]},titles:["Multi-modal Autoencoders","Data and Normalization","Filtering and Merging latent factors","Multi-omics Autoencoder Integration (maui)","The Maui Class","Saving and loading models","Maui Utilities"],titleterms:{"class":4,The:4,autoencod:[0,3],content:3,data:1,disk:5,document:[],drop:2,factor:2,filter:2,from:5,indic:3,integr:3,latent:2,load:5,maui:[3,4,6],merg:2,modal:0,model:5,multi:[0,3],normal:1,omic:3,quickstart:3,save:5,similar:2,stack:0,supervis:2,tabl:3,train:5,unexplanatori:2,util:6,variat:0,welcom:[]}}) -------------------------------------------------------------------------------- /doc/_static/colinearity-merged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_static/colinearity-merged.png -------------------------------------------------------------------------------- /doc/_static/colinearity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_static/colinearity.png -------------------------------------------------------------------------------- /doc/_static/hist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_static/hist.png -------------------------------------------------------------------------------- /doc/_static/icons8-beach-30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_static/icons8-beach-30.png -------------------------------------------------------------------------------- /doc/_static/integration-autoencoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/doc/_static/integration-autoencoder.png -------------------------------------------------------------------------------- /doc/autoencoder-integration.rst: -------------------------------------------------------------------------------- 1 | Multi-modal Autoencoders 2 | ======================== 3 | 4 | Autoencoders are hourglass-shaped neural networks that are trained to reconstruct the input data after passing it through a bottleneck layer. Thereby, autoencoders learn an efficient lower dimension representation of high-dimensional data, a "latent factor" representation of the data. The Multi-modal autoencoders take data from different modalities and learn latent factor representations of the data. In the figure below, the direction of data flow is left to right. The three different-colored matrices on the left represent data from three different modalities. The three matrices on the right represent the reconstruction of the input data, and the mixed-color matrix on the bottom represents the latent factor view of the data. 5 | 6 | .. _fig-integration-autoencoder 7 | .. figure:: _static/integration-autoencoder.png 8 | Integration Autoencoder 9 | 10 | 11 | Variational Autoencoders 12 | ------------------------ 13 | 14 | Maui uses a Variational Autoencoder, which means it learns a bayesian latent variable model. This is achieved by minimizing the following loss function: 15 | 16 | :math:`\mathcal{L} = -\mathbf{E}_{q(z|x)}\big[ log(p(x|z)) \big] + D_{KL}\big( q(z|x)~\|~p(z) \big)` 17 | 18 | The first term represents the cross-entropy reconstruction loss, and the second term is the Kullback-Leibler divergence between the latent factors distribution and a gaussian prior :math:`p(z)`. 19 | 20 | 21 | Stacked Autoencoders 22 | -------------------- 23 | 24 | As the figure above indicates, it is possible to insert extra layers between the input and the bottleneck layers, and between the bottleneck and the output layers. This is sometimes called stacked autoencoders. :doc:`maui` allows this architecture to be varied when instantiating the model, using the ``n_hidden`` parameter. The ``n_latent`` parameter determines the size of the bottleneck layer (latent factor layer). 25 | 26 | .. code-block:: python 27 | 28 | maui_model = maui.Maui(n_hidden=[900], n_latent=70) 29 | 30 | instantiates a Maui model with one hidden layer with 900 units, and 70 units in the bottleneck layer, while 31 | 32 | .. code-block:: python 33 | 34 | maui_model = maui.Maui(n_hidden=[1300, 900], n_latent=60) 35 | 36 | will instantiate a maui model with two hidden layers with 1300 and 900 units, respectively. -------------------------------------------------------------------------------- /doc/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Configuration file for the Sphinx documentation builder. 4 | # 5 | # This file does only contain a selection of the most common options. For a 6 | # full list see the documentation: 7 | # http://www.sphinx-doc.org/en/master/config 8 | 9 | # -- Path setup -------------------------------------------------------------- 10 | 11 | # If extensions (or modules to document with autodoc) are in another directory, 12 | # add these directories to sys.path here. If the directory is relative to the 13 | # documentation root, use os.path.abspath to make it absolute, like shown here. 14 | # 15 | # import os 16 | # import sys 17 | # sys.path.insert(0, os.path.abspath('.')) 18 | 19 | 20 | # -- Project information ----------------------------------------------------- 21 | 22 | project = "" 23 | copyright = "2018, Jonathan Ronen, Altuna Akalin" 24 | author = "Jonathan Ronen, Altuna Akalin" 25 | 26 | # The short X.Y version 27 | version = "" 28 | # The full version, including alpha/beta/rc tags 29 | release = "0.1" 30 | 31 | 32 | # -- General configuration --------------------------------------------------- 33 | 34 | # If your documentation needs a minimal Sphinx version, state it here. 35 | # 36 | # needs_sphinx = '1.0' 37 | 38 | # Add any Sphinx extension module names here, as strings. They can be 39 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 40 | # ones. 41 | extensions = [ 42 | "sphinx.ext.autodoc", 43 | "sphinx.ext.doctest", 44 | "sphinx.ext.intersphinx", 45 | "sphinx.ext.coverage", 46 | "sphinx.ext.mathjax", 47 | "sphinx.ext.viewcode", 48 | ] 49 | 50 | # Add any paths that contain templates here, relative to this directory. 51 | templates_path = ["_templates"] 52 | 53 | # The suffix(es) of source filenames. 54 | # You can specify multiple suffix as a list of string: 55 | # 56 | # source_suffix = ['.rst', '.md'] 57 | source_suffix = ".rst" 58 | 59 | # The master toctree document. 60 | master_doc = "index" 61 | 62 | # The language for content autogenerated by Sphinx. Refer to documentation 63 | # for a list of supported languages. 64 | # 65 | # This is also used if you do content translation via gettext catalogs. 66 | # Usually you set "language" from the command line for these cases. 67 | language = None 68 | 69 | # List of patterns, relative to source directory, that match files and 70 | # directories to ignore when looking for source files. 71 | # This pattern also affects html_static_path and html_extra_path. 72 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] 73 | 74 | # The name of the Pygments (syntax highlighting) style to use. 75 | pygments_style = None 76 | 77 | 78 | # -- Options for HTML output ------------------------------------------------- 79 | 80 | # The theme to use for HTML and HTML Help pages. See the documentation for 81 | # a list of builtin themes. 82 | # 83 | # html_theme = 'alabaster' 84 | 85 | html_theme = "alabaster" 86 | html_theme_options = {"leftsidebar": "true", "relbarbgcolor": "black"} 87 | 88 | html_logo = "../hex-maui.png" 89 | html_favicon = "_static/icons8-beach-30.png" 90 | 91 | # Theme options are theme-specific and customize the look and feel of a theme 92 | # further. For a list of options available for each theme, see the 93 | # documentation. 94 | # 95 | # html_theme_options = {} 96 | 97 | # Add any paths that contain custom static files (such as style sheets) here, 98 | # relative to this directory. They are copied after the builtin static files, 99 | # so a file named "default.css" will overwrite the builtin "default.css". 100 | html_static_path = ["_static"] 101 | 102 | # Custom sidebar templates, must be a dictionary that maps document names 103 | # to template names. 104 | # 105 | # The default sidebars (for documents that don't match any pattern) are 106 | # defined by theme itself. Builtin themes are using these templates by 107 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', 108 | # 'searchbox.html']``. 109 | # 110 | # html_sidebars = {} 111 | 112 | 113 | # -- Options for HTMLHelp output --------------------------------------------- 114 | 115 | # Output file base name for HTML help builder. 116 | htmlhelp_basename = "mauidoc" 117 | 118 | 119 | # -- Options for LaTeX output ------------------------------------------------ 120 | 121 | latex_elements = { 122 | # The paper size ('letterpaper' or 'a4paper'). 123 | # 124 | # 'papersize': 'letterpaper', 125 | # The font size ('10pt', '11pt' or '12pt'). 126 | # 127 | # 'pointsize': '10pt', 128 | # Additional stuff for the LaTeX preamble. 129 | # 130 | # 'preamble': '', 131 | # Latex figure (float) alignment 132 | # 133 | # 'figure_align': 'htbp', 134 | } 135 | 136 | # Grouping the document tree into LaTeX files. List of tuples 137 | # (source start file, target name, title, 138 | # author, documentclass [howto, manual, or own class]). 139 | latex_documents = [ 140 | ( 141 | master_doc, 142 | "maui.tex", 143 | "maui Documentation", 144 | "Jonathan Ronen, Altuna Akalin", 145 | "manual", 146 | ) 147 | ] 148 | 149 | 150 | # -- Options for manual page output ------------------------------------------ 151 | 152 | # One entry per manual page. List of tuples 153 | # (source start file, name, description, authors, manual section). 154 | man_pages = [(master_doc, "maui", "maui Documentation", [author], 1)] 155 | 156 | 157 | # -- Options for Texinfo output ---------------------------------------------- 158 | 159 | # Grouping the document tree into Texinfo files. List of tuples 160 | # (source start file, target name, title, author, 161 | # dir menu entry, description, category) 162 | texinfo_documents = [ 163 | ( 164 | master_doc, 165 | "maui", 166 | "maui Documentation", 167 | author, 168 | "maui", 169 | "One line description of project.", 170 | "Miscellaneous", 171 | ) 172 | ] 173 | 174 | 175 | # -- Options for Epub output ------------------------------------------------- 176 | 177 | # Bibliographic Dublin Core info. 178 | epub_title = project 179 | 180 | # The unique identifier of the text. This can be a ISBN number 181 | # or the project homepage. 182 | # 183 | # epub_identifier = '' 184 | 185 | # A unique identification for the text. 186 | # 187 | # epub_uid = '' 188 | 189 | # A list of files that should not be packed into the epub file. 190 | epub_exclude_files = ["search.html"] 191 | 192 | 193 | # -- Extension configuration ------------------------------------------------- 194 | 195 | # -- Options for intersphinx extension --------------------------------------- 196 | 197 | # Example configuration for intersphinx: refer to the Python standard library. 198 | intersphinx_mapping = {"https://docs.python.org/": None} 199 | -------------------------------------------------------------------------------- /doc/data-normalization.rst: -------------------------------------------------------------------------------- 1 | Data and Normalization 2 | ====================== 3 | 4 | All features need to be scaled and centered prior to feeding to the neural network of maui. This limitation comes from the fact that the last layer, where the input data is reconstructed, uses Sigmoid activations. Maui uses Batch Normalization during training, where each input feature is normalized at each minibatch. We still recommend that data be scaled prior to training. We provide a function that does this in the :doc:`utils`. 5 | 6 | .. autofunction:: maui.utils.scale 7 | -------------------------------------------------------------------------------- /doc/filtering-and-merging-latent-factors.rst: -------------------------------------------------------------------------------- 1 | Filtering and Merging latent factors 2 | ==================================== 3 | 4 | We recommend running Maui with a large number of latent factors (e.g. 100), even when we expect the latent space to be of lower dimension. This way we are more likely to capture latent factors which are interesting, and the uninteresting ones can be dropped later before down-stream analysis. Maui comes with some functionality to that end. 5 | 6 | Dropping unexplanatory latent factors 7 | ------------------------------------- 8 | 9 | An unsupervised way to drop latent factors with low explanatory power, is to fit linear models predicting the input `x` from the latent factorz `z`. The :doc:`utils` have a function which does this. For each latent factor, a linear model is fit, predicting all input features from each latent factor. Then, the R-square is computed. Factors with an R-square score below some threshold are dropped. 10 | 11 | .. autofunction:: maui.utils.filter_factors_by_r2 12 | 13 | The functionality is also available directly on a trained Maui model (:doc:`maui`), which exposes a function which drops unexplanatory factors in-place: 14 | 15 | .. autofunction:: maui.Maui.drop_unexplanatory_factors 16 | 17 | 18 | Merging similar latent factors 19 | ------------------------------ 20 | 21 | Some times running Maui with a large number of latent factor can produce embeddings which are similar to one another. For instance, a heatmap of latent factor values may look like this: 22 | 23 | .. _fig-colinear-factors 24 | .. figure:: _static/colinearity.png 25 | Heatmap of latent factors shows many latent factors are very similar. 26 | 27 | The latent factors may be clustered and merged to produce a more succinct, even lower-dimension representation of the data, without losing much information 28 | 29 | .. _fig-colinear-factors-merged 30 | .. figure:: _static/colinearity-merged.png 31 | Heatmap of latent factors after they have been merged by similarity values. 32 | 33 | :doc:`utils` provides functionality to merge latent factors based on arbitrary distance metrics: 34 | 35 | .. autofunction:: maui.utils.merge_factors 36 | 37 | And functionality for the base case where factors are merged by correlation is provided in the Maui model calss: 38 | 39 | .. autofunction:: maui.Maui.merge_similar_latent_factors 40 | 41 | 42 | Supervised filtering of latent factors 43 | -------------------------------------- 44 | 45 | In the case of patient data, latent factors may be assessed for usefulness based on how predictive they are of patient survival. Maui includes functionality to do this in the utilities class: 46 | 47 | .. autofunction:: maui.utils.select_clinical_factors 48 | 49 | For a more comprehensive example, check out `our vignette `_. 50 | -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | Multi-omics Autoencoder Integration (maui) 2 | ========================================== 3 | 4 | maui is an autoencoder-based framework for multi-omics data analysis. It consists of two main modules, :doc:`maui`, and :doc:`utils`. For an introduction of the use of autoencoders for multi-omics integration, see :doc:`autoencoder-integration`. 5 | 6 | 7 | Table of contents 8 | ----------------- 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | autoencoder-integration 14 | data-normalization 15 | filtering-and-merging-latent-factors 16 | saving-and-loading-models 17 | maui 18 | utils 19 | 20 | 21 | 22 | Quickstart 23 | ---------- 24 | 25 | The ``Maui`` class implements ``scikit-learn``'s ``BaseEstimator``. In order to infer latent factors in multi-omics data, first instantiate a ``Maui`` model with the desired parameters, and then fit it to some data: 26 | 27 | .. code-block:: python 28 | 29 | from maui import Maui 30 | 31 | maui_model = maui.Maui(n_hidden=[900], n_latent=70, epochs=100) 32 | z = maui_model.fit_transform({'mRNA': gex, 'Mutations': mut, 'CNV': cnv}) 33 | 34 | This will instantiate a maui model with one hidden layer of 900 nodes, and a middle layer of 70 nodes, which will be traiend for 100 epochs. It then feeds the multi-omics data in ``gex``, ``mut``, and ``cnv`` to the fitting procedure. The omics data (``gex`` et. al.) are ``pandas.DataFrame`` objects of dimension (n_features, n_samples). The return object ``z`` is a ``pandas.DataFrame`` (n_samples, n_latent), and may be used for further analysis. 35 | 36 | In order to check the model's convergance, the ``hist`` object may be inspected, and plotted: 37 | 38 | .. code-block:: python 39 | 40 | maui_model.hist.plot() 41 | 42 | .. image:: _static/hist.png 43 | 44 | For a more comprehensive example, check out `our vignette `_. 45 | 46 | 47 | Indices and tables 48 | ~~~~~~~~~~~~~~~~~~ 49 | 50 | * :ref:`genindex` 51 | * :ref:`modindex` 52 | * :ref:`search` 53 | -------------------------------------------------------------------------------- /doc/maui.rst: -------------------------------------------------------------------------------- 1 | The Maui Class 2 | ============== 3 | 4 | .. autoclass:: maui.Maui 5 | :members: 6 | -------------------------------------------------------------------------------- /doc/saving-and-loading-models.rst: -------------------------------------------------------------------------------- 1 | Saving and loading models 2 | ========================= 3 | 4 | Maui models may be saved to disk, so that they may be loaded again at a later time. 5 | 6 | Saving a trained model to disk 7 | ------------------------------ 8 | 9 | Saving a model to disk involves saving two files to a target directory. These files store the model weights and the maui parameters (the arguments the maui model was instantiated with). :doc:`maui` implements a the save function 10 | 11 | .. autofunction:: maui.Maui.save 12 | 13 | The function takes one required parameter, the destination directory where the two files will be saved. It is called directly on a maui model, like 14 | 15 | .. code-block:: python 16 | 17 | maui_model.save('/path/to/dir') 18 | 19 | 20 | Loading a model from disk 21 | ------------------------- 22 | 23 | Loading a model involves instantiating a new Maui instance using the parameters that were used on the model that is saved to disk, and then populating the weights of the model to the previously trained weights. Once a model is loaded, it can be used to transform new data to the latent space, or it can be trained further. :doc:`maui` has a static function to load a model from disk 24 | 25 | .. autofunction:: maui.Maui.load 26 | 27 | It is called directly on the Maui class, like 28 | 29 | .. code-block:: python 30 | 31 | maui.Maui.load('/path/to/dir') 32 | 33 | -------------------------------------------------------------------------------- /doc/utils.rst: -------------------------------------------------------------------------------- 1 | Maui Utilities 2 | ============== 3 | 4 | .. automodule:: maui.utils 5 | :members: 6 | -------------------------------------------------------------------------------- /hex-maui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/hex-maui.png -------------------------------------------------------------------------------- /maui/__init__.py: -------------------------------------------------------------------------------- 1 | from .model import Maui 2 | from ._version import __version__ 3 | 4 | name = "maui" 5 | -------------------------------------------------------------------------------- /maui/_version.py: -------------------------------------------------------------------------------- 1 | __version__ = "0.1.95" 2 | -------------------------------------------------------------------------------- /maui/maui_warnings.py: -------------------------------------------------------------------------------- 1 | """Module contains custom warning object. 2 | 3 | @jonathanronen 2020/7 4 | """ 5 | 6 | class MauiWarning(UserWarning): 7 | pass -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | filterwarnings= 3 | ignore::DeprecationWarning 4 | ignore::PendingDeprecationWarning 5 | ignore::FutureWarning 6 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |
2 | maui 3 |
4 | 5 | # maui 6 | 7 | [![Downloads](https://pepy.tech/badge/maui-tools)](https://pepy.tech/project/maui-tools) [![codecov](https://codecov.io/gh/bimsbbioinfo/maui/branch/master/graph/badge.svg)](https://codecov.io/gh/bimsbbioinfo/maui) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/36c1f3f252b543139fd930ba5f674535)](https://www.codacy.com/app/jonathanronen/maui?utm_source=github.com&utm_medium=referral&utm_content=BIMSBbioinfo/maui&utm_campaign=Badge_Grade) [![PyPI version](https://badge.fury.io/py/maui-tools.svg)](https://badge.fury.io/py/maui-tools) [![Documentation Status](https://readthedocs.org/projects/maui/badge/?version=latest)](https://maui.readthedocs.io/en/latest/?badge=latest) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black) 8 | 9 | 10 | 11 | 12 | 13 | 14 | Multi-omics Autoencoder Integration (**maui**) is a python package for multi-omics data analysis. It is based on a bayesian latent factor model, with inference done using artificial neural networks. For details, check out our LSA paper: https://www.life-science-alliance.org/content/2/6/e201900517 15 | 16 | ## Installation 17 | 18 | maui works with Python 3.6 and TensorFlow 1.1 (does not yet support the yet unreleased TensorFlow 2.0). The easiest way to install is from pypi: 19 | 20 | pip install -U maui-tools 21 | 22 | This will install all necessary dependencies including keras an tensorflow. The default tensorflow (cpu) will be installed. If tensorflow GPU is needed, please install it prior to installation of maui. 23 | 24 | The development version may be installed by cloning this repo and running `python setup.py install`, or, using `pip` directly from github: 25 | 26 | pip install -e git+https://github.com/BIMSBbioinfo/maui.git#egg=maui 27 | 28 | 29 | #### Optional dependencies 30 | 31 | Survival analysis functionality supplied by lifelines [1]. It may be installed directly from pip using `pip install lifelines`. 32 | 33 | ## Usage 34 | 35 | See [the vignette](vignette/maui_vignette.ipynb), and check out [the documentation](https://maui.readthedocs.io/en/latest/). 36 | 37 | 38 | ## Citation 39 | 40 | > Evaluation of colorectal cancer subtypes and cell lines using deep learning. Jonathan Ronen, Sikander Hayat, Altuna Akalin. Life Science Alliance Dec 2019, 2 (6) e201900517; DOI: 10.26508/lsa.201900517 41 | 42 | ## Contributing 43 | 44 | Open an issue, send us a pull request, or shoot us an e-mail. 45 | 46 | ## License 47 | 48 | maui is released under the [GNU General Public License v3.0](LICENSE) or later. 49 | 50 | --------------------- 51 | @jonathanronen, BIMSBbioinfo, 2018 52 | 53 | 54 | [1]: https://github.com/CamDavidsonPilon/lifelines 55 | -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | build: 2 | image: latest 3 | 4 | python: 5 | version: 3.6 6 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [build_sphinx] 2 | source-dir = doc/ 3 | build-dir = doc/_build 4 | all_files = 1 5 | 6 | [upload_sphinx] 7 | upload-dir = doc/build/html -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | with open("readme.md", "r") as fh: 4 | long_description = fh.read() 5 | 6 | with open("maui/_version.py") as versionfile: 7 | exec(versionfile.read()) 8 | 9 | setup( 10 | name="maui-tools", 11 | version=__version__, 12 | description="Multi-omics Autoencoder Integration", 13 | author="Jonathan Ronen", 14 | license="GPLv3", 15 | author_email="yablee@gmail.com", 16 | url="https://github.com/BIMSBbioinfo/maui", 17 | packages=["maui"], 18 | long_description=long_description, 19 | long_description_content_type="text/markdown", 20 | install_requires=[ 21 | "pytest", 22 | "numpy>=1.18.2", 23 | "pandas>=1.0.3", 24 | "scipy==1.2.1", 25 | "scikit-learn", 26 | "keras", 27 | "tensorflow<2.0", 28 | "pytest>=3.6.0", 29 | ], 30 | ) 31 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIMSBbioinfo/maui/7d329c736b681216093fd725b134a68e6e914c8e/test/__init__.py -------------------------------------------------------------------------------- /test/test_utils.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import numpy as np 3 | import pandas as pd 4 | from scipy import spatial, cluster 5 | 6 | from maui import utils 7 | 8 | 9 | def test_merge_factors(): 10 | z = pd.DataFrame( 11 | [ 12 | [1, 1, 1, 0, 0, 0, 1, 0, 0], 13 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 14 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 15 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 16 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 17 | [1, 1, 1, 1, 1, 0, 0, 1, 0], 18 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 19 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 20 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 21 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 22 | [0, 0, 0, 1, 0, 1, 1, 1, 0], 23 | ], 24 | index=[f"sample {i}" for i in range(11)], 25 | columns=[f"LF{i}" for i in range(9)], 26 | dtype=float, 27 | ) # expect 0,1,2 to be merged, and 3,7 to be merged 28 | 29 | z_merged = utils.merge_factors(z, metric="euclidean", plot_dendro=False) 30 | 31 | assert z_merged.shape[1] == 6 32 | assert "0_1_2" in z_merged.columns 33 | assert "3_7" in z_merged.columns 34 | 35 | 36 | def test_merge_factors_with_custom_linkage(): 37 | z = pd.DataFrame( 38 | [ 39 | [1, 1, 1, 0, 0, 0, 1, 0, 0], 40 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 41 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 42 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 43 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 44 | [1, 1, 1, 1, 1, 0, 0, 1, 0], 45 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 46 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 47 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 48 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 49 | [0, 0, 0, 1, 0, 1, 1, 1, 0], 50 | ], 51 | index=[f"sample {i}" for i in range(11)], 52 | columns=[f"LF{i}" for i in range(9)], 53 | dtype=float, 54 | ) # expect 0,1,2 to be merged, and 3,7 to be merged 55 | 56 | l = cluster.hierarchy.linkage(spatial.distance.pdist(z.T, "minkowski"), "average") 57 | 58 | z_merged = utils.merge_factors(z, l=l, plot_dendro=False) 59 | 60 | assert z_merged.shape[1] == 6 61 | assert "0_1_2" in z_merged.columns 62 | assert "3_7" in z_merged.columns 63 | 64 | 65 | def test_filter_factors_by_r2(): 66 | dummy_z = pd.DataFrame( 67 | [[0, 1, 2], [1, 0, 2]], 68 | index=["sample 1", "sample 2"], 69 | columns=["LF1", "LF2", "LF3"], 70 | ) 71 | 72 | dummy_x = pd.DataFrame( 73 | [[1.0, 1.0, 1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 1.0, 1.0, 1.0]], 74 | columns=[f"feature{i}" for i in range(6)], 75 | index=["sample 1", "sample 2"], 76 | ).T 77 | 78 | z_filt = utils.filter_factors_by_r2(dummy_z, dummy_x) 79 | assert z_filt.columns.tolist() == ["LF1", "LF2"] 80 | 81 | def test_map_factors_to_feaures_using_linear_models(): 82 | dummy_z = pd.DataFrame( 83 | [[0, 1], [1, 0]], index=["sample 1", "sample 2"], columns=["LF1", "LF2"] 84 | ) 85 | 86 | dummy_x = pd.DataFrame( 87 | [[1.0, 1.0, 1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 1.0, 1.0, 1.0]], 88 | columns=[f"feature{i}" for i in range(6)], 89 | index=["sample 1", "sample 2"], 90 | ).T 91 | 92 | expected_w = np.array( 93 | [[-2.0, 2.0], [-2.0, 2.0], [-2.0, 2.0], [2.0, -2.0], [2.0, -2.0], [2.0, -2.0]] 94 | ) 95 | 96 | w = utils.map_factors_to_feaures_using_linear_models(dummy_z, dummy_x) 97 | 98 | assert np.allclose(w, expected_w) 99 | 100 | 101 | def test_correlate_factors_and_features(): 102 | dummy_z = pd.DataFrame( 103 | [[0, 1], [1, 0]], index=["sample 1", "sample 2"], columns=["LF1", "LF2"] 104 | ) 105 | 106 | dummy_x = pd.DataFrame( 107 | [[1, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1]], 108 | columns=[f"feature{i}" for i in range(6)], 109 | index=["sample 1", "sample 2"], 110 | ) 111 | 112 | expected_corrs = np.array( 113 | [[-1.0, 1.0], [-1.0, 1.0], [-1.0, 1.0], [1.0, -1.0], [1.0, -1.0], [1.0, -1.0]] 114 | ) 115 | 116 | corrs = utils.correlate_factors_and_features(dummy_z, dummy_x) 117 | 118 | assert np.allclose(corrs, expected_corrs) 119 | 120 | 121 | def test_compute_roc(): 122 | np.random.seed(0) 123 | dummy_z = pd.DataFrame( 124 | [ 125 | [0, 1, 1, 1, 0, 1, 1, 0, 0], 126 | [1, 0, 0, 0, 0, 0, 1, 1, 0], 127 | [1, 0, 1, 0, 0, 0, 1, 1, 0], 128 | [1, 0, 0, 1, 0, 0, 1, 1, 0], 129 | [1, 0, 0, 0, 1, 1, 1, 1, 0], 130 | [1, 1, 1, 0, 0, 0, 1, 1, 1], 131 | ], 132 | index=[f"sample {i}" for i in range(6)], 133 | columns=[f"LF{i}" for i in range(9)], 134 | ) 135 | dummy_y = pd.Series(["a", "b", "a", "c", "b", "c"], index=dummy_z.index) 136 | 137 | roc_curves = utils.compute_roc(dummy_z, dummy_y, cv_folds=2) 138 | assert np.allclose(roc_curves["a"].FPR, [0.0, 0.5, 0.5, 0.75, 1.0]) 139 | 140 | 141 | def test_compute_auc(): 142 | fpr = [0.0, 0.0, 0.5, 0.5, 1.0] 143 | tpr = [0.0, 0.5, 0.5, 1.0, 1.0] 144 | roc = utils.auc(fpr, tpr) 145 | assert roc - 0.75 < 1e-6 146 | 147 | 148 | def test_estimate_km(): 149 | yhat = pd.Series( 150 | ["a", "a", "a", "b", "b", "b"], index=[f"Sample {i}" for i in range(6)] 151 | ) 152 | durations = np.random.poisson(6, 6) 153 | observed = np.random.randn(6) > 0.1 154 | survival = pd.DataFrame( 155 | dict(duration=durations, observed=observed), 156 | index=[f"Sample {i}" for i in range(6)], 157 | ) 158 | km = utils.estimate_kaplan_meier(yhat, survival) 159 | 160 | assert "a" in km.columns 161 | assert "b" in km.columns 162 | 163 | 164 | def test_multivariate_logrank_test(): 165 | yhat = pd.Series( 166 | ["a", "a", "a", "b", "b", "b"], index=[f"Sample {i}" for i in range(6)] 167 | ) 168 | durations = np.random.poisson(6, 6) 169 | observed = np.random.randn(6) > 0.1 170 | survival = pd.DataFrame( 171 | dict(duration=durations, observed=observed), 172 | index=[f"Sample {i}" for i in range(6)], 173 | ) 174 | test_stat, p_val = utils.multivariate_logrank_test(yhat, survival) 175 | assert p_val <= 1.0 176 | 177 | 178 | def test_select_clinical_factors(): 179 | dummy_z = pd.DataFrame( 180 | [ 181 | [1, 1, 1, 0, 0, 0, 1, 0, 1], 182 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 183 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 184 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 185 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 186 | [1, 1, 1, 1, 1, 0, 0, 1, 0], 187 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 188 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 189 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 190 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 191 | [0, 0, 0, 1, 0, 1, 1, 1, 1], 192 | ], 193 | index=[f"sample {i}" for i in range(11)], 194 | columns=[f"LF{i}" for i in range(9)], 195 | ) # here the first 3 factors separate the groups and the last 6 do not 196 | 197 | durations = [ 198 | 1, 199 | 2, 200 | 3, 201 | 4, 202 | 5, 203 | 6, 204 | 1000, 205 | 2000, 206 | 3000, 207 | 4000, 208 | 5000, 209 | ] # here the first 3 have short durations, the last 3 longer ones 210 | observed = [True] * 11 # all events observed 211 | survival = pd.DataFrame( 212 | dict(duration=durations, observed=observed), 213 | index=[f"sample {i}" for i in range(11)], 214 | ) 215 | 216 | z_clinical = utils.select_clinical_factors(dummy_z, survival, cox_penalizer=1, alpha=.1) 217 | assert "LF0" in z_clinical.columns 218 | assert "LF1" in z_clinical.columns 219 | assert "LF2" in z_clinical.columns 220 | 221 | assert "LF3" not in z_clinical.columns 222 | assert "LF4" not in z_clinical.columns 223 | assert "LF5" not in z_clinical.columns 224 | 225 | 226 | def test_compute_harrells_c(): 227 | dummy_z = pd.DataFrame( 228 | [ 229 | [1, 1, 1, 0, 0, 0, 1, 0, 1], 230 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 231 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 232 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 233 | [1, 1, 1, 1, 0, 1, 1, 1, 0], 234 | [1, 1, 1, 1, 1, 0, 0, 1, 0], 235 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 236 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 237 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 238 | [0, 0, 0, 1, 0, 0, 1, 1, 0], 239 | [0, 0, 0, 1, 0, 1, 1, 1, 1], 240 | ], 241 | index=[f"sample {i}" for i in range(11)], 242 | columns=[f"LF{i}" for i in range(9)], 243 | ) # here the first 3 factors separate the groups and the last 6 do not 244 | 245 | durations = [ 246 | 1, 247 | 2, 248 | 3, 249 | 4, 250 | 5, 251 | 6, 252 | 1000, 253 | 2000, 254 | 3000, 255 | 4000, 256 | 5000, 257 | ] # here the first 3 have short durations, the last 3 longer ones 258 | observed = [True] * 11 # all events observed 259 | survival = pd.DataFrame( 260 | dict(duration=durations, observed=observed), 261 | index=[f"sample {i}" for i in range(11)], 262 | ) 263 | z_clinical = utils.select_clinical_factors(dummy_z, survival, cox_penalizer=1, alpha=.1) 264 | 265 | np.random.seed(0) 266 | c = utils.compute_harrells_c(z_clinical, survival, cv_folds=3) 267 | assert np.allclose(c, [0.5, 0.8, 0.5], atol=.05) 268 | --------------------------------------------------------------------------------