annotate R/upsetr.R @ 13:152d7c43478b draft default tip

Uploaded
author dereeper
date Thu, 30 May 2024 20:07:55 +0000
parents e42d30da7a74
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
1 #!/usr/bin/R
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
2
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
3 library(UpSetR)
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
4 #library(svglite)
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
5 args = commandArgs(trailingOnly=TRUE)
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
6
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
7
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
8 movies <- read.csv(file=args[1], header = T, sep = "\t")
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
9
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
10 nb <- as.integer(args[3])+1
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
11
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
12 size <- 0.5
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
13 if (as.integer(nb)>60){
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
14 size <- 0.2
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
15 }
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
16
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
17 sets <- names(movies[2:nb])
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
18 #svglite(args[2], width = 4, height = 4)
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
19 pdf(args[2])
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
20 #upset(movies,nintersects = 20,number.angles = 0, mb.ratio = c(0.35, 0.65),order.by = "freq", sets = sets, point.size = 0.5, line.size = 0.3, mainbar.y.label = "Intersections", sets.x.label = "Nb genes", text.scale = c(0.8, 0.8, 0.8, 0.8, size, 0.5))
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
21 upset(movies,nintersects = 20,number.angles = 0, mb.ratio = c(0.35, 0.65), order.by = "freq",keep.order = T, sets = sets, point.size = 1.5, line.size = 0.3, mainbar.y.label = "Intersections", sets.x.label = "Nb genes", text.scale = c(0.8, 0.8, 0.8, 0.8, size, 0.5))
e42d30da7a74 Uploaded
dereeper
parents:
diff changeset
22 dev.off()