You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor documentation updates ahead of 0.5.0 release (#171)
* add CLI script back
* fix URL on homepage
* bug in master for the dev version and setup.py mismatch
* update links in overview docs
* add RELEASE_NOTES file
* wording change
* test .rst bullet points change
This is a document describing new functionality, bug fixes, breaking changes, etc. associated with Selene version releases from v0.5.0 onwards.
4
+
5
+
## Version 0.5.0
6
+
7
+
### New functionality
8
+
-`sampler.MultiSampler`: `MultiSampler` accepts any Selene sampler for each of the train, validation, and test partitions where previously `MultiFileSampler` only accepted `FileSampler`s. We will deprecate `MultiFileSampler` in our next major release.
9
+
-`DataLoader`: Parallel data loading based on PyTorch's `DataLoader` class, which can be used with Selene's `MultiSampler` and `MultiFileSampler` class. (see: `sampler.SamplerDataLoader`, `sampler.H5DataLoader`)
10
+
- To support parallelism via multiprocessing, the sampler that `SamplerDataLoader` used needs to be picklable. To enable this, opening file operations are delayed to when any method that needs the file is called. There is no change to the API and setting `init_unpicklable=True` in `__init__` for `Genome` and all `OnlineSampler` classes will fully reproduce the functionality in `selene_sdk<=0.4.8`.
11
+
-`sampler.RandomPositionsSampler`: added support for `center_bin_to_predict` taking in a list/tuple of two integers to specify the region from which to query the targets---that is, `center_bin_to_predict` by default (`center_bin_to_predict=<int>`) queries targets based on the center bin size, but can be specified as start and end integers that are not at the center if desired.
12
+
-`EvaluateModel`: accepts a list of metrics (by default computing ROC AUC and average precision) with which to evaluate the test dataset.
13
+
14
+
### Usage
15
+
-**Command-line interface (CLI)**: You can now run the CLI directly with `python -m selene_sdk` (if you have cloned the repository, make sure you have locally installed `selene_sdk` via `python setup.py install`, or `selene_sdk` is in the same directory as your script / added to `PYTHONPATH`). Developers can make a copy of the `selene_sdk/cli.py` script and use it the same way that `selene_cli.py` was used in earlier versions of Selene (`python -u cli.py <config-yml> [--lr]`)
16
+
17
+
### Bug fixes
18
+
-`EvaluateModel`: `use_features_ord` allows you to evaluate a trained model on only a subset of chromatin features (targets) predicted by the model. If you are using a `FileSampler` for your test dataset, you now have the option to pass in a subsetted matrix; however, this matrix must be ordered the same way as `features` (the original targets prediction ordering) and not in the same ordering as `use_features_ord`. However, the final model predictions and targets
19
+
(`test_predictions.npz` and `test_targets.npz`) will be outputted according to the `use_features_ord` list and ordering.
20
+
-`MatFileSampler`: Previously the `MatFileSampler` reset the pointer to the start of the matrix too early (going back to the first sample before we had finished sampling the whole matrix).
21
+
- CLI learning rate: Edge cases (e.g. not specifying the learning rate via CLI or config) previously were not handled correctly and did not throw an informative error.
Copy file name to clipboardExpand all lines: docs/source/overview/cli.rst
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,12 +26,12 @@ Selene's CLI accepts configuration files in the `YAML <https://docs.ansible.com/
26
26
We recommend you start off by using one of the `example configuration files <https://github.com/FunctionLab/selene/tree/master/config_examples>`_ provided in the repository as a template for your own configuration file:
There are also various configuration files associated with the Jupyter notebook `tutorials <https://github.com/FunctionLab/selene/tree/master/tutorials>`_ and `manuscript <https://github.com/FunctionLab/selene/tree/master/manuscript>`_ case studies that you may use as a starting point.
Copy file name to clipboardExpand all lines: docs/source/overview/overview.rst
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,21 +12,21 @@ Sampling
12
12
13
13
We start with the modules for sampling data because both training and evaluting a model in Selene will require a user to specify the kind of sampler they want to use.
The *sequences* submodule defines the ``Sequence`` type, and includes implementations for several sub-classes.
19
19
These sub-classes--\ ``Genome`` and ``Proteome``\ --represent different kinds of biological sequences (e.g. DNA, RNA, amino acid sequences), and implement the ``Sequence`` interface’s methods for reading the reference sequence from files (e.g. FASTA), querying subsequences of the reference sequence, and subsequently converting those queried subsequences into a numeric representation.
20
20
Further, each sequence class specifies its own alphabet (e.g., nucleotides, amino acids) to represent query results as strings.
The *targets* submodule defines the ``Target`` class, which specifies the interface for classes to retrieve labels or “targets” for a given query sequence.
26
26
At present, we supply a single implementation of this interface: ``GenomicFeatures``.
27
27
This class takes a tabix-indexed file of intervals for each label we want our model to predict, and uses this file to identify the labels for a given sequence drawn from the reference.
The *samplers* submodule provides methods and classes for randomly sampling and partitioning datasets for training and evaluation.
@@ -36,7 +36,7 @@ Further, a file of names must be provided for the features to be predicted.
36
36
We provide several implementations adhering to the ``Sampler`` interface: the ``RandomPositionsSampler``\ , ``IntervalsSampler``\ , and ``MultiFileSampler``.
37
37
38
38
``MultiFileSampler`` draws samples from structured data files for each partition.
39
-
There is currently support for loading either .bed or .mat files via the ``FileSampler`` classes ``BedFileSampler`` and ``MatFileSampler``\ , respectively (see `API docs for file samplers <http://selene.flatironinstitute.org/samplers.file_samplers.html>`_\ ).
39
+
There is currently support for loading either .bed or .mat files via the ``FileSampler`` classes ``BedFileSampler`` and ``MatFileSampler``\ , respectively (see `API docs for file samplers <../samplers.file_samplers.html>`_\ ).
40
40
It is worth noting that the .bed file used by ``BedFileSampler`` includes the coordinates of each sequence, and the indices corresponding to each feature for which said sequence is a positive example.
41
41
We hope that users will request or contribute classes for other file samplers in the future.
42
42
``MultiFileSampler`` does not support saving the sampled data to a file, so calling the ``save_dataset_to_file`` method from this class will have no effect.
@@ -47,7 +47,7 @@ These samplers automatically partition said data according to user-specified par
47
47
Since ``OnlineSampler``\ ’s samples are randomly generated, we allow the user to save the sampled data to file.
48
48
This file can be subsequently loaded with the ``BedFileSampler``. They rely on classes from the *sequences* and *targets* submodules for retrieving each sequence and its targets in the proper matrix format.
49
49
50
-
Training a model (\ `API <http://selene.flatironinstitute.org/selene.html#trainmodel>`_\ )
50
+
Training a model (\ `API <../selene.html#trainmodel>`_\ )
The ``TrainModel`` class may be used for training and testing of sequence-based models, and provides the core functionality of the CLI’s train command.
@@ -58,14 +58,14 @@ The model’s loss, area under the receiver operating characteristic curve (AUC)
58
58
The frequency of logging is provided by the user.
59
59
At the end of evaluation, ``TrainModel`` logs the performance metrics for each feature predicted, and produces plots of the precision recall and receiver operating characteristic curves.
60
60
61
-
Evaluating a model (\ `API <http://selene.flatironinstitute.org/selene.html#evaluatemodel>`_\ )
61
+
Evaluating a model (\ `API <../selene.html#evaluatemodel>`_\ )
The ``EvaluateModel`` class is used to test the performance of a trained model.
65
65
``EvaluateModel`` uses an instance of ``Sampler`` class or subclass to draw samples from a test set.
66
66
After using the provided model to predict labels for said data, ``EvaluateModel`` logs the performance measures (as described in "Training a model") and generates figures and a performance breakdown by feature.
67
67
68
-
Using a model to make predictions (\ `API <http://selene.flatironinstitute.org/predict.html>`_\ )
68
+
Using a model to make predictions (\ `API <../predict.html>`_\ )
Selene’s ``predict`` submodule includes a number of methods and classes for making predictions with sequence-based models.
@@ -74,14 +74,14 @@ It leverages a user-specified trained model to make predictions for sequences se
74
74
In each case, the user can specify what ``AnalyzeSequences`` should save: raw predictions, difference scores, absolute difference scores, and/or logit scores.
75
75
Note that the aforementioned “scores” can only be computed for *in silico* mutagenesis and variant effect prediction.
76
76
77
-
Visualizing model predictions (\ `API <http://selene.flatironinstitute.org/interpret.html>`_\ )
77
+
Visualizing model predictions (\ `API <../interpret.html>`_\ )
The ``interpret`` submodule of ``selene_sdk`` provides methods for visualizing a sequence-based model’s predictions made with ``AnalyzeSequences``.
81
81
For example, ``interpret`` includes methods for processing variant effect predictions made with ``AnalyzeSequences`` and subsequently visualizing them with a heatmap or sequence logo.
82
82
The functionality included in the ``interpret`` submodule is not heavily incorporated into the CLI, but is instead intended for incorporation into user code.
83
83
84
-
The utilities submodule (\ `API <http://selene.flatironinstitute.org/utils.html>`_\ )
84
+
The utilities submodule (\ `API <../utils.html>`_\ )
Unlike the aforementioned submodules designed around individual concepts, the ``utils`` submodule is a catch-all submodule intended to prevent cluttering of the ``selene_sdk`` top-level namespace.
0 commit comments