This is a document describing new functionality, bug fixes, breaking changes, etc. associated with Selene version releases from v0.5.0 onwards.
- Adjust dependency requirements
- Fix Cython type error causing build issues with Python 3.9+
- PyTorch<=1.9 compatibility
sampler.MultiSampler
:MultiSampler
accepts any Selene sampler for each of the train, validation, and test partitions where previouslyMultiFileSampler
only acceptedFileSampler
s. We will deprecateMultiFileSampler
in our next major release.DataLoader
: Parallel data loading based on PyTorch'sDataLoader
class, which can be used with Selene'sMultiSampler
andMultiFileSampler
class. (see:sampler.SamplerDataLoader
,sampler.H5DataLoader
)- 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 settinginit_unpicklable=True
in__init__
forGenome
and allOnlineSampler
classes will fully reproduce the functionality inselene_sdk<=0.4.8
. sampler.RandomPositionsSampler
: added support forcenter_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.EvaluateModel
: accepts a list of metrics (by default computing ROC AUC and average precision) with which to evaluate the test dataset.
- 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 installedselene_sdk
viapython setup.py install
, orselene_sdk
is in the same directory as your script / added toPYTHONPATH
). Developers can make a copy of theselene_sdk/cli.py
script and use it the same way thatselene_cli.py
was used in earlier versions of Selene (python -u cli.py <config-yml> [--lr]
)
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 aFileSampler
for your test dataset, you now have the option to pass in a subsetted matrix; however, this matrix must be ordered the same way asfeatures
(the original targets prediction ordering) and not in the same ordering asuse_features_ord
. However, the final model predictions and targets (test_predictions.npz
andtest_targets.npz
) will be outputted according to theuse_features_ord
list and ordering.MatFileSampler
: Previously theMatFileSampler
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).- 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.