Utilities: utils

Utilities: utils#

General utility functions used across CREsted.

Functions

EnhancerOptimizer(*args, **kwargs)

(Alias function for the) class to optimize the mutated sequence based on the original prediction.

calculate_nucleotide_distribution(input[, ...])

Calculate the nucleotide distribution of a genome in a set of regions or sequences.

derive_intermediate_sequences(*args, **kwargs)

Use derive_intermediate_sequences() instead, this alias is deprecated.

fetch_sequences(regions[, genome, uppercase])

Fetch sequences from a genome file for a list of regions using pysam.

flip_region_strand(region)

Reverse the strand of a region strand or tuple.

hot_encoding_to_sequence(...)

Decode a one hot encoded sequence to a DNA sequence string.

one_hot_encode_sequence(sequence[, expand_dim])

One hot encode a DNA sequence.

parse_region(region)

Parse a region string or tuple, returning a consistent (chr, start, end, strand) tuple.

read_bigwig_region(bigwig_file, coordinates)

Extract per-base or binned pair values from a bigWig file for a set of genomic region.

reverse_complement(sequence)

Perform reverse complement on either a one-hot encoded array or a (list of) DNA sequence string(s).

setup_logging([log_level, log_file])

Set up loguru logging for the package.