From f34de8b1c713bc8f54856a2d879ef271fd20d9c8 Mon Sep 17 00:00:00 2001 From: kchu25 Date: Wed, 21 Aug 2024 17:39:17 -0400 Subject: [PATCH] update readme --- README.md | 33 +++++++++++++++++++++++++++++++++ demo/demo.png | Bin 0 -> 8430 bytes 2 files changed, 33 insertions(+) create mode 100644 demo/demo.png diff --git a/README.md b/README.md index c51c793..cfe674a 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,36 @@ [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://kchu25.github.io/PlotPWM.jl/dev/) [![Build Status](https://github.com/kchu25/PlotPWM.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/kchu25/PlotPWM.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Coverage](https://codecov.io/gh/kchu25/PlotPWM.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/kchu25/PlotPWM.jl) + + +# Usage + +``` +using PlotPWM + +# Given a position frequency matrix (each column sum to 1) + +pfm = [0.01 1.0 0.98 0.0 0.0 0.0 0.98 0.0 0.18 1.0 + 0.98 0.0 0.01 0.19 0.0 0.96 0.01 0.89 0.03 0.0 + 0.0 0.0 0.0 0.77 0.01 0.0 0.0 0.0 0.56 0.0 + 0.0 0.0 0.0 0.05 0.99 0.04 0.01 0.11 0.24 0.0] + +logoplot(pfm) +``` +will give + +![pfm](demo/demo.png) + +# Note + +The information content $IC(\cdot)$ (i.e. the "letter height") of the $i$-th column $c_i$ in a position weight matrix (PWM) is + +$$ +IC(c_i) = \sum_{\alpha}\,f_{\alpha i}\,\log_2 \frac{f_{\alpha i}}{\beta_\alpha} +$$ + +where $f_{\alpha i}$ the frequency of nucleotide $\alpha\in\{A,C,G,T\}$ at the $i$-th column of a PWM. The $4$-dimensional vector $\beta$ is the assumed genomic background + +By default, the background $\beta$ is assumed to be flat, i.e. $\beta=(0.25, 0.25,0.25,0.25)$. + + diff --git a/demo/demo.png b/demo/demo.png new file mode 100644 index 0000000000000000000000000000000000000000..564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