Skip to content

lbfextract plugin to calculate the JSD divergence between the fragment length distribution in the flanking regions and at each position around the center of the transcription binding site

Notifications You must be signed in to change notification settings

Isy89/fextract_jsd_to_flanking

Repository files navigation

Fextract JSD to flanking

This is a plugin for LBFextract that calculates the Jensen-Shannon divergence (JSD) for all intervals in a BED file. Specifically, it compares the fragment length distribution in the flanking regions of each interval to the fragment length distribution at each position within the interval.

The plugin outputs the results as a CSV file and generates a plot of the signal, similar to the example below:

jsd_to_flanking_signal_plot.png(jsd_to_flanking_ctcf_signal_plot.pdf)

Signal descriptions

This Plugin implements the CLI interface for the extract_jsd_to_flanking feature extraction method.

extract_jsd_to_flanking

Given a set of genomic intervals having the same length w, extract_jsd_to_flanking calculates the JSD at each position, which can be represented as:

$$ \text{JSD}_l(P_l \parallel Q) = \frac{1}{2} \left( \text{KLD}(P_l \parallel M) + \text{KLD}(Q \parallel M) \right) $$

where $M = \frac{1}{2} (P_l + Q)$ is the average distribution of $P$ at position $l$ and $Q$, and ( $\text{KLD}$ ) is the Kullback–Leibler divergence defined by:

$$ \text{KLD}(P_l \parallel Q) = \sum_{i} P(i) \log \frac{P(i)}{Q(i)} $$

Where $l$ represents the genomic position, $Q$ represents the fragment length distribution in flanking regions and $P_l$ is the fragment length distribution at position $l$.

Installation

To install this plugin, you can use the following command:

    pip install 'git+https://github.com/Isy89/fextract_jsd_to_flanking.git'

About

lbfextract plugin to calculate the JSD divergence between the fragment length distribution in the flanking regions and at each position around the center of the transcription binding site

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages