The following script was run using a conda environment. Below you can find how to create the same environment

Load utils and necessary functions

Load the data

(to be used to initialize DeepExplainer)

Load the model

Create random sequences

(or) Create random sequences by shuffling a given sequence.

(Length of the given sequence should be the same size you used for the model, which is 500bp in this case)

(or) Create random sequences that follow the GC-content of the given fasta sequences

Define the patterns to be implanted

Here you generate synthetic sequence by in silico evolution.

pattern: selected motif to be implanted
region: initial regions to implant the selected pattern on
model: selected deep learning model
class_no: chosen class to select the best position to implant motif
As an output it results a dictionary; regions contains the sequences after implantation to the best location and locations contains the implanted position as the position of first nucleotide of the implanted motif

Load the saved file

Plot the prediction distributions

Plot the location distribution of an implanted motif

Plot the location distribution of an implanted motif relative to another implanted motif

Plot deepexplainer and saturation mutagenesis of a selected sequence

Plot prediction of a region at different steps

Convert created sequence to letters