SHARE
TWEET

Untitled

a guest Jan 17th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library(ComplexHeatmap)
  2. library(circlize)
  3.  d11 <- read.csv("DC3_7_MUT.txt",stringsAsFactors = FALSE)
  4. a <- as.data.frame(d11)
  5. head(a)
  6.  
  7.  
  8. ex <- melt(a, id.vars=c("Gene"))
  9. head(ex)
  10. dim(ex)
  11.  
  12. bb1 <- ex %>% na.omit() %>%
  13.   group_by(Gene,value) %>%
  14.   mutate(new = n()) %>%
  15.   data.frame()
  16.  
  17. #head(bbb)
  18. #dim(bbb)
  19.  
  20. bb1[bb1==""]<-NA
  21.  
  22. df <- na.omit(bb1)
  23.  
  24. bbb <- df
  25.  
  26. features1 = unique(bbb[[3]])
  27. features_col1 = structure(rand_color(length(features1)), names = features1)
  28.    
  29. patients_col1 = structure(1:187, names = unique(bbb[[2]]))
  30.    
  31. col1 = ifelse(bbb[[4]], features_col1[bbb[[3]]], "#FFFFFF00")
  32. col1 = gsub("FF$", "80", col1) # half transparent
  33. features_count1 = tapply(bbb[[4]], bbb[[3]], sum)
  34. head(bbb)
  35. # set color to white if it only exists in one patient/cell
  36. col1[features_count1[bbb[[3]]] == 1] = "#FFFFFF00"
  37. pdf("CIRCOS.pdf",20,25)
  38. chordDiagram(bbb, col = col1, grid.col = c(features_col1, patients_col1))
  39.  
  40.  
  41. dev.off()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top