Skip to content

Commit

Permalink
deploy: 26b60c7
Browse files Browse the repository at this point in the history
  • Loading branch information
avantikalal committed May 30, 2024
0 parents commit b28a1ea
Show file tree
Hide file tree
Showing 244 changed files with 85,526 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 9ea53df5e29e4199cacaaa405e3b21db
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/authors.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/data/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/data/utils/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/design/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/interpret/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/io/bed/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/io/bigwig/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/io/fasta/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/io/genome/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/io/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/io/meme/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/lightning/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/model/heads/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/model/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/resources/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/sequence/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/transforms/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/utils/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/variant/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/grelu/visualize/index.doctree
Binary file not shown.
Binary file added .doctrees/autoapi/index.doctree
Binary file not shown.
Binary file added .doctrees/changelog.doctree
Binary file not shown.
Binary file added .doctrees/contributing.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/license.doctree
Binary file not shown.
Binary file added .doctrees/readme.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/1_inference.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/2_finetune.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/3_train.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/4_design.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/5_variant.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/6_model_zoo.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/flowchart.jpg
3 changes: 3 additions & 0 deletions _sources/authors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. _authors:
.. include:: ../AUTHORS.md
:parser: myst_parser.sphinx_
171 changes: 171 additions & 0 deletions _sources/autoapi/grelu/data/augment/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
grelu.data.augment
==================

.. py:module:: grelu.data.augment
.. autoapi-nested-parse::

Functions to augment data. All functions assume that the input is a numpy array containing an integer
encoded DNA sequence of shape (L,) or a numpy array containing a label of shape (T, L).
The augmented output will be in the same format.



Attributes
----------

.. autoapisummary::

grelu.data.augment.AUGMENTATION_MULTIPLIER_FUNCS


Classes
-------

.. autoapisummary::

grelu.data.augment.Augmenter


Functions
---------

.. autoapisummary::

grelu.data.augment.random_mutate
grelu.data.augment.reverse_complement
grelu.data.augment._get_multipliers
grelu.data.augment._split_overall_idx
grelu.data.augment.shift
grelu.data.augment.rc_seq
grelu.data.augment.rc_label


Module Contents
---------------

.. py:function:: random_mutate(seq: Union[str, numpy.ndarray], rng: Optional[numpy.random.RandomState] = None, pos: Optional[int] = None, drop_ref: bool = True, input_type: Optional[str] = None, protect: List[int] = []) -> Union[str, numpy.ndarray]
Introduce a random single-base substitution into a DNA sequence.

:param seq: A single DNA sequence in string or integer encoded format.
:param rng: np.random.RandomState object for reproducibility
:param pos: Position at which to insert a random mutation. If None, a random position will be chosen.
:param drop_ref: If True, the reference base will be dropped from the list of possible bases at the mutated position.
If False, there is a possibility that the original sequence will be returned.
:param input_type: Format of the input sequence. Accepted values are "strings" or "indices".
:param protect: A list of positions to protect from mutation. Only needed if `pos` is None.

:returns: A mutated sequence in the same format as the input sequence

:raises ValueError: if the input is not a string or integer encoded DNA sequence.


.. py:function:: reverse_complement(seqs: [str, List[str], numpy.ndarray], input_type: Optional[str] = None) -> Union[str, List[str], numpy.ndarray]
Reverse complement input DNA sequences

:param seqs: DNA sequences as strings or index encoding
:param input_type: Format of the input sequences. Accepted values
are "strings" or "indices".

:returns: reverse complemented sequences in the same format as the input.

:raises ValueError: If the input DNA sequence is not in string or index encoded format.


.. py:data:: AUGMENTATION_MULTIPLIER_FUNCS
.. py:function:: _get_multipliers(**kwargs) -> List[int]
.. py:function:: _split_overall_idx(idx: int, max_values: List[int]) -> List[List[int]]
Given an integer index, split it into multiple indices, each ranging from 0
to a specified maximum value


.. py:function:: shift(arr: numpy.ndarray, seq_len: int, idx: int) -> numpy.ndarray
Shift a sliding window along a sequence or label by the given number of bases.

:param arr: Numpy array with length as the last dimension.
:param seq_len: Desired length for the output sequence.
:param idx: Start position

:returns: Shifted sequence


.. py:function:: rc_seq(seq: numpy.ndarray, idx: bool) -> numpy.ndarray
Reverse complement a sequence based on the index

:param seq: Integer-encoded sequence.
:param idx: If True, the reverse complement sequence will be returned.
If False, the sequence will be returned unchanged.

:returns: Same or reverse complemented sequence


.. py:function:: rc_label(label: numpy.ndarray, idx: bool) -> numpy.ndarray
Reverse a label based on the index

:param label: Numpy array with length as the last dimension
:param idx: If True, the label will be reversed along the length axis.
If False, the label will be returned unchanged.

:returns: Same or reversed label


.. py:class:: Augmenter(rc: bool = False, max_seq_shift: int = 0, max_pair_shift: int = 0, n_mutated_seqs: int = 0, n_mutated_bases: Optional[int] = None, protect: List[int] = [], seq_len: Optional[int] = None, label_len: Optional[int] = None, seed: Optional[int] = None, mode: str = 'serial')
A class that generates augmented DNA sequences or (sequence, label) pairs.

:param rc: If True, augmentation by reverse complementation will be performed.
:param max_seq_shift: Maximum number of bases by which the sequence alone can be shifted.
This is normally a small value (< 10).
:param max_pair_shift: Maximum number of bases by which the sequence and label can be jointly
shifted. This can be a larger value.
:param n_mutated_seqs: Number of augmented sequences to generate by random mutation
:param n_mutated_bases: The number of bases to mutate in each augmented sequence. Only used
if n_mutated_seqs is greater than 0.
:param protect: A list of positions to protect from random mutation. Only used
if n_mutated_seqs is greater than 0.
:param seq_len: Length of the augmented sequences
:param label_len: Length of the augmented labels
:param seed: Random seed for reproducibility.
:param mode: "random" or "serial"


.. py:method:: __len__() -> int
The total number of augmented sequences that can be produced from a single
DNA sequence



.. py:method:: _split(idx: int) -> List[tuple]
Function to split an input index into indices specifying each type
of augmentation



.. py:method:: _get_random_idxs() -> List[tuple]
Function to select indices for each type of augmentation randomly



.. py:method:: __call__(idx: int, seq: numpy.ndarray, label: Optional[numpy.ndarray] = None) -> Union[numpy.ndarray, Tuple[numpy.ndarray, numpy.ndarray]]
Perform augmentation on a given integer-encoded DNA sequence or (sequence, label) pair

:param idx: Index specifying the augmentation to be performed.
:param seq: A single integer encoded DNA sequence
:param label: A numpy array of shape (T, L) containing the label

:returns: The augmented DNA sequence or (sequence, label) pair if label is supplied.



Loading

0 comments on commit b28a1ea

Please sign in to comment.