Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for decoding one hot encoded sequence back to a DNA seque… #4

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

ghuls
Copy link
Member

@ghuls ghuls commented Jun 27, 2024

…nce.

Add support for decoding one hot encoded sequence back to a DNA sequence.

import numpy as np
from crested.tl._utils import one_hot_encode_sequence

one_hot_encoded_sequence = np.array([
   [1., 0., 0., 0.],
   [1., 0., 0., 0.],
   [0., 1., 0., 0.],
   [0., 0., 1., 0.],
   [0., 0., 0., 1.],
   [0., 0., 0., 1.],
   [1., 0., 0., 0.],
   [0., 0., 1., 0.],
   [0., 1., 0., 0.]],
   dtype=float32
)

hot_encoding_to_sequence(one_hot_encoded_sequence)) == "AACGTTAGC"

…nce.

Add support for decoding one hot encoded sequence back to a DNA sequence.

    import numpy as np
    from crested.tl._utils import one_hot_encode_sequence

    one_hot_encoded_sequence = np.array([
       [1., 0., 0., 0.],
       [1., 0., 0., 0.],
       [0., 1., 0., 0.],
       [0., 0., 1., 0.],
       [0., 0., 0., 1.],
       [0., 0., 0., 1.],
       [1., 0., 0., 0.],
       [0., 0., 1., 0.],
       [0., 1., 0., 0.]],
       dtype=float32
    )

    hot_encoding_to_sequence(one_hot_encoded_sequence)) == "AACGTTAGC"
@LukasMahieu LukasMahieu merged commit 599c4da into main Jun 27, 2024
4 checks passed
@LukasMahieu LukasMahieu deleted the add_hot_encoding_to_sequence branch June 27, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants