Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kchu25 committed Aug 28, 2024
1 parent a0ce2d7 commit 66f25e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ pfm = [0.01 1.0 0.98 0.0 0.0 0.0 0.98 0.0 0.18 1.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)
# Define the background probabilities for (A, C, G, T)
background = [0.25, 0.25, 0.25, 0.25]
logoplot(pfm, background)
```
will give

Expand All @@ -32,6 +37,15 @@ The function `logoplot(pfm)` produces a plot where:
- The x-axis shows the positions in the PWM.
- The y-axis shows the information content (bits) for each position.

Here, `background` is an array representing the background probabilities for A, C, G, and T. These should sum to 1. In this case, a uniform background of `[0.25, 0.25, 0.25, 0.25]` is used, assuming equal probabilities for each base.

You can also simply call
```
logoplot(pfm)
```
to get identical results as above, where background is set to be `[0.25, 0.25, 0.25, 0.25]` by default.


## Plotting your PWMs with crosslinking tendencies

The cross-linked PWMs not only display the PWM but also account for crosslinking tendencies, which is typically done for RNA-binding proteins (RBPs).
Expand Down
2 changes: 1 addition & 1 deletion src/plot_logo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ end

@userplot LogoPlot
@recipe function f(data::LogoPlot;
background = [0.25 for _ = 1:4],
dna=true,
xaxis=false,
yaxis=false,
Expand Down Expand Up @@ -76,6 +75,7 @@ end
thickness_scaling --> thickness_scaling
size --> logo_size
pfm = data.args[1]
background = length(data.args) 2 ? data.args[2] : [0.25 for _ = 1:4]
coords = freq2xy(pfm; background=background, dna=dna, beta=beta,
logo_x_offset=logo_x_offset,
logo_y_offset=logo_y_offset);
Expand Down

0 comments on commit 66f25e6

Please sign in to comment.