BackofenLab / IntaRNA

Efficient target prediction incorporating accessibility of interaction sites

Home Page:https://backofenlab.github.io/IntaRNA/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scalebar issuses

Sububioinfo opened this issue · comments

Let me know how to create the scale bars, as you provide in web browser for minimal energy plot. otherwise please provide your code which you are using in web browser to produce that plot.
d <- read.table("pairMinE.csv",header=T,sep=",");
d <- d[,2:ncol(d)];
d[is.na(d)] = 0;
d[d>0] = 0;
image(1:nrow(d), 1:ncol(d), as.matrix(d), col = heat.colors(25), main="Minimal energy per query-target index pair", xlab="target sequence position", ylab="query sequence position");
box();

hi, the image on the webserver is rendered using the plotly javascript framework. so I have no R code at hand to reproduce the plot...

I just had quick try myself in R. you get something similar using

library(tidyverse)

read_delim("pairMinE-t1q1.csv", delim=";") %>%
  replace(is.na(.), 0) %>%
  rename( target = minE ) %>%
  pivot_longer( cols=-target, names_to = "query", values_to = "E" ) %>%
  separate( query, into = c("qSeq","qIdx"), sep = "_") %>%
  separate( target, into = c("tSeq","tIdx"), sep = "_") %>%
  mutate(across(c(tIdx,qIdx,E),as.numeric)) %>%
  mutate(E = ifelse( E>0, 0, E)) %>%
  ggplot(aes(x=tIdx,y=qIdx, fill=E)) +
    geom_tile() + 
    scale_fill_gradient(low="blue",high="red")

grafik