Title: | Obtain total affinity and occupancies for binding site matrices on a given sequence |
---|---|
Description: | Calculates a single number for a whole sequence that reflects the propensity of a DNA binding protein to interact with it. The DNA binding protein has to be described with a PFM matrix, for example gotten from Jaspar. |
Authors: | Elena Grassi |
Maintainer: | Elena Grassi <[email protected]> |
License: | GPL-3 |
Version: | 1.39.0 |
Built: | 2024-10-30 07:42:54 UTC |
Source: | https://github.com/bioc/MatrixRider |
Calculates a single number for a whole sequence that reflects the propensity of a DNA binding protein to interact with it. The DNA binding protein has to be described with a PFM matrix, for example gotten from Jaspar.
Elena Grassi <[email protected]>
library(JASPAR2014) library(TFBSTools) library(Biostrings) pfm <- getMatrixByID(JASPAR2014,"MA0004.1") ## The following sequence has a single perfect match ## thus it gives the same results with all cutoff values. sequence <- DNAString("CACGTG") getSeqOccupancy(sequence, pfm, 0.1) getSeqOccupancy(sequence, pfm, 1)
library(JASPAR2014) library(TFBSTools) library(Biostrings) pfm <- getMatrixByID(JASPAR2014,"MA0004.1") ## The following sequence has a single perfect match ## thus it gives the same results with all cutoff values. sequence <- DNAString("CACGTG") getSeqOccupancy(sequence, pfm, 0.1) getSeqOccupancy(sequence, pfm, 1)
The affinity/occupancy is calculated on the given DNAString for the given PFMatrix (or all the ones in the PFMatrix list given).
getSeqOccupancy(sequence, pfm, cutoff)
getSeqOccupancy(sequence, pfm, cutoff)
sequence |
A DNAString object with the sequence for which affinity will be computed. |
pfm |
A PFMatrix or a PFMatrixList object with the matrixes whose affinity will be calculated. The background (bg,XMatrix-method) of the given pfm is used to perform affinity calculations. |
cutoff |
numeric(1); between 0 and 1 (included): 0 corresponds to total affinity
(i.e. summing all the affinities) while 1 to
summing only values corresponding to the perfect match
for a given PFMatrix.
See vignette for details on how scores are calculated. If
MatrixRider is installed, open the vignette with
|
numeric; the resulting total affinity calculated on the given fasta. If a PFMatrixList has been passed then a named numeric vector with the affinities for all the PFMs. The vignette has all the details on the calculations (such as PFM to PWM conversion and pseudocounts).
library(JASPAR2014) library(TFBSTools) library(Biostrings) pfm <- getMatrixByID(JASPAR2014,"MA0004.1") ## The following sequence has a single perfect match ## thus it gives the same results with all cutoff values. sequence <- DNAString("CACGTG") getSeqOccupancy(sequence, pfm, 0.1) getSeqOccupancy(sequence, pfm, 1) pfm2 <- getMatrixByID(JASPAR2014,"MA0005.1") pfms <- PFMatrixList(pfm, pfm2) names(pfms) <- c(name(pfm), name(pfm2)) ## This calculates total affinity for both the PFMatrixes. getSeqOccupancy(sequence, pfms, 0)
library(JASPAR2014) library(TFBSTools) library(Biostrings) pfm <- getMatrixByID(JASPAR2014,"MA0004.1") ## The following sequence has a single perfect match ## thus it gives the same results with all cutoff values. sequence <- DNAString("CACGTG") getSeqOccupancy(sequence, pfm, 0.1) getSeqOccupancy(sequence, pfm, 1) pfm2 <- getMatrixByID(JASPAR2014,"MA0005.1") pfms <- PFMatrixList(pfm, pfm2) names(pfms) <- c(name(pfm), name(pfm2)) ## This calculates total affinity for both the PFMatrixes. getSeqOccupancy(sequence, pfms, 0)