Utils

Utils#

CREsted provides a few utility function to help with sequence encoding, function optimization, …

EnhancerOptimizer(optimize_func)

Class to optimize the mutated sequence based on the original prediction.

read_bigwig_region(bigwig_file, coordinates)

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

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.

fetch_sequences(regions[, genome, uppercase])

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

reverse_complement(sequence)

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

permute_model(model, new_input_shape)

Add a permutation layer to the input of a model to change the shape from (B, W, C) to (B, C, W) or vice versa.

setup_logging([log_level, log_file])

Set up loguru logging for the package.