Figures

Let’s look at some figures!

Explore your IPR results here

Runtime histogram

hist_plot <- job_time_hist(ipr_log_path = infile_iprlog)
hist_plot

Domain stats

ipr_summ <- ipr_combnd |> 
  group_by(AccNum, Analysis) |> 
  summarize(TotalDoms=n())

# static plot
ps <- ipr_summ |> 
  ggplot(aes(y = TotalDoms)) +
  geom_histogram(stat="bin")

# plotly
ggplotly(ps)

gganimate | domains-per-protein

ipr_summ2 <- ipr_combnd |> 
  group_by(AccNum, DB.ID) |> 
  summarise(TotDoms=n())

ipr_summ2 |> 
  ggplot(aes(y=DB.ID, x=TotDoms, fill=DB.ID)) +
  geom_bar(stat="identity") +
  theme_minimal() +
  transition_states(AccNum, transition_length=2, state_length=1) +
  ease_aes('linear')

heatmap

ipr_summ2 |> 
  ggplot(aes(x=AccNum, y=DB.ID, fill=TotDoms)) +
  geom_tile() + theme_minimal() +
  scale_fill_viridis_b() +
  theme(axis.text.x = element_text(angle = 90, hjust=1))

## plotly
# ipr_wide <- ipr_summ2 |> 
#   pivot_wider(names_from = DB.ID, values_from = TotDoms) |> 
#   column_to_rownames(var = "AccNum")
# ipr_wide[is.na(ipr_wide)] <- 0
# 
# plot_ly(x = colnames(ipr_wide),
#         y = rownames(ipr_wide),
#         z=ipr_wide,
#         type = "heatmap")

Wordcloud

ipr_combnd |>
  filter(Analysis=="Pfam") |> 
  group_by(DB.ID) |> 
  summarize(freq=n()) |> select(word=DB.ID, freq) |> 
  wordcloud2()