Background models define probability distributions for DNA sequences. These can be simple (0-order) models that only contain information about the relative frequencies of the four DNA bases in the sequence
or they can be higher-order
Markov models (up to order 5)
where the probability of observing a particular base at a position in a sequence will depend on which bases that preceeded it.
For a Markov model of order
N the Background Model will store information about the relative frequency of every oligo of length
N (of which there are 4
N)
and also a transition matrix of size 4
N×4 which states the probabilities that a given oligo of length
N will be followed by either an A, C, G or T respectively.
In addition, the model will also contain information about the single nucleotide frequency of each of the four DNA bases.
Background models can be defined manually by explicitly listing all the oligo frequencies and transition probabilities, but this is not recommended for higher-order models since it would involve too much tedious typing that can be hard to do correctly.
A better way to create background models is to derive them from DNA sequence tracks.
MotifLab also comes bundled with several predefined background models (borrowed from the
INCLUSive project)
that can be easily imported, and background models can be imported from files in various formats.
# Import the predefined "EDP_human_3" background model that comes bundled with MotifLab
EDPhuman3 = new Background Model(Model:EDP_human_3)
# Import a background model from file in MEME background format
BGmodel = new Background Model(File:"C:\mouse.freq", Format=MEME_Background)
# Create a new 0-order model with uniform distribution
UniformBG = new Background Model
# Manually define a 0-order model with high GC-content (A=10%, C=40%, G=40%, T=10%)
High_GC_background = new Background Model(SNF:0.1,0.4,0.4,0.1;MATRIX:0.1,0.4,0.4,0.1)
# Create a new 3-order background model derived from a DNA track.
# Use the DNA strand relative to the sequence orientation
Background1 = new Background Model(Track:DNA, Order=3, Strand=Relative)
Background models are immutable data objects and cannot be changed after they have been created.
Background models can be used by some motif discovery and motif scanning tools to correct for background bias when searching for transcription factor binding sites.
Background models can also be used to create new artifical DNA sequence tracks or mask portions of existing DNA tracks.
# Use the "EDP_human_3" model to correct for background bias when discovering motifs with MEME
[TFBS,MEMEmotifs] = motifDiscovery in DNA with MEME {Background=EDP_human_3, ... }
# Replace bases inside TFBS regions with new bases randomly sampled from the distribution defined
# in "Background1". This will in effect destroy these binding motifs in the sequence.
mask DNA with Background1 where inside TFBS
# Create a new artificial DNA sequence track by randomly sampling bases
# according to the distribution defined in the background model
DNA_random = new DNA Sequence Dataset(EDP_human_3)