Skip to content

Commit

Permalink
Slight clean up _load_sequences_into_memory
Browse files Browse the repository at this point in the history
  • Loading branch information
casblaauw committed Nov 4, 2024
1 parent 87ae027 commit 60c7169
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/crested/tl/data/_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def __init__(
def _load_sequences_into_memory(self, regions: list[str]):
"""Load all sequences into memory (dict)."""
logger.info("Loading sequences into memory...")
strand_reverser = {'+': '-', '-': '+'}
# Check region formatting
stranded = _check_strandedness(regions[0])

Expand All @@ -133,11 +132,11 @@ def _load_sequences_into_memory(self, regions: list[str]):

# Add region to self.sequences
extended_sequence = self._get_extended_sequence(chrom, start, end, strand)
self.sequences[f"{chrom}:{start}-{end}:{strand}"] = extended_sequence
self.sequences[region] = extended_sequence

# Add reverse-complemented region to self.sequences if always_reverse_complement
if self.always_reverse_complement:
self.sequences[f"{chrom}:{start}-{end}:{strand_reverser[strand]}"] = self._reverse_complement(
self.sequences[_flip_region_strand(region)] = self._reverse_complement(
extended_sequence
)

Expand Down

0 comments on commit 60c7169

Please sign in to comment.