Skip to content

Commit

Permalink
Added property for the nucleotides used in bed sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCappelletti94 committed Jul 16, 2020
1 parent 0c5e822 commit 4721f55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion keras_bed_sequence/bed_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(

self._window_length = (bed.chromEnd - bed.chromStart).values[0]
self._genome = assembly
self._nucleotides = nucleotides
self._nucleotides_number = len(nucleotides)
self._unknown_nucleotide_value = unknown_nucleotide_value

Expand All @@ -62,7 +63,7 @@ def __init__(
sequences = self._genome.bed_to_sequence(bed).sequence.values.astype(str)

super().__init__(
nucleotides_to_numbers(nucleotides, sequences),
nucleotides_to_numbers(self.nucleotides, sequences),
batch_size,
seed=seed,
elapsed_epochs=elapsed_epochs
Expand All @@ -73,6 +74,11 @@ def window_length(self) -> int:
"""Return number of nucleotides in a window."""
return self._window_length

@property
def nucleotides(self) -> int:
"""Return number of nucleotides considered."""
return self._nucleotides

@property
def nucleotides_number(self) -> int:
"""Return number of nucleotides considered."""
Expand Down

0 comments on commit 4721f55

Please sign in to comment.