달력

122025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'Coding'에 해당되는 글 78건

  1. 2018.08.02 plots
  2. 2018.07.24 [PPI]String R package
  3. 2018.07.24 [Statistics] distance calculation + ROCR
  4. 2018.07.16 PCA
  5. 2018.07.10 [plot]violin plot
  6. 2018.06.27 JSON parsing
  7. 2018.04.04 [R] igraph
  8. 2017.11.23 [Python] tabix
  9. 2017.06.13 [plot] barplot with text
  10. 2017.04.25 dbsnp data description

plots

2018. 8. 2. 13:23

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[PPI]String R package

2018. 7. 24. 14:56

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

PCA

2018. 7. 16. 11:35

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[plot]violin plot

2018. 7. 10. 13:46

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

JSON parsing

2018. 6. 27. 17:24

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[R] igraph

Coding/R 2018. 4. 4. 11:05

source("https://bioconductor.org/biocLite.R")

biocLite("STRINGdb")



library(STRINGdb)


library(igraph)

g <- read.graph("karate.net", format="pajek")

d <- get.diameter(g)


L <- graph(n=9,c(1,4,2,4,3,4,4,5,5,6,6,7,7,8,8,9),directed=F)

plot(L, layout=layout.fruchterman.reingold, edge.arrow.mode="-", edge.width=2, vertex.label.cex=1.2)


g <- graph.empty (5, directed = FALSE)

new_edges <- c(1,3, 1,5, 2,5, 4,5)

g <- add.edges(g, new_edges)

plot(g)



library(igraph)

dat = as.matrix(read.table('/Users/lsy/Downloads/string_interactions.tsv',sep='\t',header = FALSE))

#dat = rbind(dat,c("BCAM","","0","0","9606.ENSP00000363071","0","0","0","0","0","0","0","0.0","0","0"))

edges = as.vector(t(dat[,1:2]))

g<-graph(edges, n=max(edges), isolates=c("BCAM"))

get.edgelist(g)

plot(g, layout = layout.fruchterman.reingold, vertex.label=V(g)$number,edge.arrow.size=0.5)



library(igraph)

dat = as.matrix(read.table('/Users/lsy/Downloads/string_interactions.tsv',sep='\t',header = FALSE))

edges = as.vector(t(dat[,1:2]))

net <- graph_from_data_frame(d=dat, vertices=unique(edges), directed=T) 

plot(net, edge.arrow.size=.4,vertex.label=NA)

as_data_frame(net, what="edges")

as_data_frame(net, what="vertices")



plot(net, vertex.shape="none", vertex.label=names(V(net)), 

  vertex.label.font=2, vertex.label.color="gray40",

  vertex.label.cex=.7, edge.color="gray85")


E(net)$color[E(net)$weight > 2] <- 'green'

plot.igraph(net,vertex.label=V(net)$name,layout=layout.fruchterman.reingold,edge.arrow.size=0.2,

            vertex.label.color="gray40",edge.color="red",vertex.shape="none"

)





E(testgraph)$color <- as.factor(edges$department)


E(g)$lty[E(g)$weight == 8] <- 1

E(g)$color[E(g)$weight == 3] <- 'green'

E(g)$lty[E(g)$weight == 3] <- 2





library(igraph)

dat = as.matrix(read.table('/Users/lsy/Downloads/string_interactions.tsv',sep='\t',header = FALSE))

edges = as.vector(t(dat[,1:2]))

g<-graph(edges, n=max(edges), isolates=c("BCAM"), directed=FALSE)

E(g)$weight = as.numeric(dat[,15])

E(g)$color <-"skyblue"

E(g)$color[which(E(g)$weight > 0.7)] ="blue"

V(g)$color <-c('red','red','yellow','red','yellow','yellow','yellow')

plot.igraph(g,layout=layout.fruchterman.reingold,

            vertex.shape="circle",vertex.color=c("#Eddfed","#Eddfed","#90A66A","#Eddfed","#C45A63","#C45A63","#C45A63")

            ,vertex.size=30,

            vertex.label=V(g)$name, vertex.label.color=V(g)$color,vertex.label.cex=1, vertex.frame.color= "white",

            edge.arrow.size=0.2,edge.color=E(g)$color,edge.label=c("","PM1689487","","","","PM27559130","",""),

            edge.label.color="black",edge.label.cex=0.7

)



g<-graph(edges, n=max(edges), isolates=c("Glioblastoma\ngene","Damaging\nnsSNV","Tolerated\nnsSNV"), directed=FALSE)

V(g)$color <-c('red','red','yellow','red','yellow','yellow','red','yellow','yellow')

plot.igraph(g,layout=layout.fruchterman.reingold,

            vertex.shape="circle",

            vertex.color=c("#Eddfed","#Eddfed","#90A66A","#Eddfed","#C45A63","#C45A63","#Eddfed","#C45A63","#90A66A")

            ,vertex.size=50,

            vertex.label=V(g)$name, vertex.label.color=V(g)$color,vertex.label.cex=1, vertex.frame.color= "white",

            edge.arrow.size=0.2,edge.color=E(g)$color,edge.label=c("","PM1689487","","","","PM27559130","",""),

            edge.label.color="black",edge.label.cex=0.7

)


de

legend("topleft", legend=c("interaction score > 0.7", "0.7 < interaction score > 0.4"), col=c("blue", "skyblue"), lty=1, cex=0.8)



'Coding > R' 카테고리의 다른 글

PCA  (0) 2018.07.16
[plot]violin plot  (0) 2018.07.10
[plot] barplot with text  (0) 2017.06.13
line plot  (0) 2014.03.14
line plot  (0) 2014.01.28
Posted by jjbang
|

[Python] tabix

Coding/python 2017. 11. 23. 14:50
sudo apt-get install tabix
sort -k1,1 -k2,2 -V -s 1_20171123_ptm_info.txt > 1.txt
bgzip 1.txt
tabix -s 1 -b 2 -e 2 1.txt.gz


'Coding > python ' 카테고리의 다른 글

JSON parsing  (0) 2018.06.27
xml parsing  (0) 2017.03.28
윈도우에 패키지 설치하기  (0) 2017.03.24
file string check  (0) 2014.01.08
원하는 라인부터 읽기  (0) 2014.01.04
Posted by jjbang
|

[plot] barplot with text

Coding/R 2017. 6. 13. 15:12

bp = barplot(table(dat[,1]),las=2,ylim = c(0,600),main="Number of experience per cell line in the L1000 data")

text(x = bp, y = table(dat[,1]), label = table(dat[,1]), pos = 3, cex = 0.8, col = "red")


bp = barplot(table(dat[,1]),las=2,ylim = c(0,600),main="Number of experience per cell line in the L1000 data")

text(x = bp, y = table(dat[,1]), label = table(dat[,1]), pos = 3, cex = 0.8, col = "red")

'Coding > R' 카테고리의 다른 글

[plot]violin plot  (0) 2018.07.10
[R] igraph  (0) 2018.04.04
line plot  (0) 2014.03.14
line plot  (0) 2014.01.28
ggplot histogram  (0) 2012.09.19
Posted by jjbang
|

dbsnp data description

2017. 4. 25. 10:51

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.