Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodelucchi authored Mar 20, 2020
1 parent 42f58f4 commit abb265e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions results/swissprot_pfam_domain_clustering.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ getPalette = colorRampPalette(brewer.pal(9, "Dark2"))
# library(viridis)
# viridiscols <- viridis_pal(option = "D")(length(unique(df_spec$PFAM_desc))) # n = number of colors seeked
require(plotly)
require(htmlwidgets)
require(compare)
```

```{r Script specific functions}
Expand Down Expand Up @@ -938,6 +939,14 @@ df_spec <- df_spec %>%
group_by(Superkingdom) %>%
mutate(rank = base::rank(count))
# Compare the two groups:
comp <- compare(df_spec$PFAM_desc[which(df_spec$Superkingdom == "Eukaryota")], df_spec$PFAM_desc[which(df_spec$Superkingdom == "Prokaryota")], allowAll = T)
comp$tM # those PFAMs appear in both Superkingdoms
length(comp$tM) # Number of shared PFAMs. Remove TOP from calculation above to get it not only for the top 10 but for all of them.
length(df_spec$PFAM_desc[which(df_spec$Superkingdom == "Eukaryota")])
length(df_spec$PFAM_desc[which(df_spec$Superkingdom == "Prokaryota")])
## make plot
pd <- position_dodge(0.4)
# p <- ggplot(df_spec, aes(x = Superkingdom, y = rel_freq, color = PFAM_desc))+
Expand Down Expand Up @@ -1304,10 +1313,6 @@ d_superkingdom[grepl(d_superkingdom$PFAM_desc, pattern = "^WD"),]

since overall plot is a bit messy, let's try with plotly:
```{r plotly overall plot}
# install.packages("plotly")
require(plotly)
require(htmlwidgets)
df_spec$textlabel <- paste("PFAM-Name: ", df_spec$PFAM_Name, "\n",
"PFAM-Desc.: ", df_spec$PFAM_desc, "\n",
"PFAM-Acce.: ", df_spec$model)
Expand Down Expand Up @@ -1553,4 +1558,4 @@ TODO: necessary?
# head(d_sub)
# pfam_map[which(pfam_map$ID == "A0A0C5CJR8"),]
# d_sub[which(d_sub$ID == "A0A0C5CJR8"),]
```
```

0 comments on commit abb265e

Please sign in to comment.