Setup

library(BioPlex)
library(AnnotationDbi)
library(AnnotationHub)
library(PFAM.db)
library(graph)
library(ggalluvial)

Data retrieval

Get the latest version of the HCT116 PPI network:

bp.hct116 <- BioPlex::getBioPlex(cell.line = "HCT116", version = "1.0")

and turn into a graph object:

hct.gr <- BioPlex::bioplex2graph(bp.hct116)
hct.gr

Annotate PFAM domains to the node metadata:

Connect to AnnotationHub:

ah <- AnnotationHub::AnnotationHub()

OrgDb package for human:

orgdb <- AnnotationHub::query(ah, c("orgDb", "Homo sapiens"))
orgdb <- orgdb[[1]] 
orgdb
AnnotationDbi::keytypes(orgdb)
hct.gr <- BioPlex::annotatePFAM(hct.gr, orgdb)

Domain-domain association analysis

system.time( res.hct <- BioPlexAnalysis::testDomainAssociation(hct.gr) )
head(res.hct)

Get human readable description for the PFAM domain IDs:

id2de <- as.list(PFAMDE)
id2de <- unlist(id2de)

What are the top interacting domain pairs for the HCT116 network:

res.hct$DOMAIN1 <- id2de[res.hct$PFAM1]
res.hct$DOMAIN2 <- id2de[res.hct$PFAM2]
head(res.hct)

Visualization

top10 <- unique(c(res.hct[1:8,1], res.hct[1:8,2]))
ind <- res.hct[,1] %in% top10 & res.hct[,2] %in% top10
pldf <- res.hct[ind,]
ggplot(pldf, aes(y = FREQ, axis1 = PFAM1, axis2 = PFAM2)) + 
    geom_alluvium(aes(fill = PFAM1)) + 
    scale_x_discrete(limits = c("PFAM1", "PFAM2"), expand = c(.05, .05)) + 
    geom_stratum(width = 1/12, fill = "lightgrey", color = "darkgrey") + 
    geom_label(stat = "stratum", aes(label = after_stat(stratum))) + 
    ylab("#PPIs") + 
    theme_bw() + theme(legend.position = "none")


ccb-hms/BioPlexAnalysis documentation built on Jan. 29, 2023, 6:55 p.m.