-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_geo_files.R
67 lines (58 loc) · 2.06 KB
/
create_geo_files.R
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
library(bcbioRNASeq)
library(tidyverse)
load("data/uuo.rda")
counts = counts(uuo, "tpm")
for(c in colnames(counts)){
counts[,c, drop = FALSE] %>%
as.data.frame %>%
rownames_to_column("gene") %>%
write_csv(file.path("geo", paste0(c, ".tpm")))
}
library(bcbioSmallRna)
load("data/suuo.rda")
counts = mirna(suuo, "rlog")
for(c in colnames(counts)){
counts[,c, drop = FALSE] %>%
as.data.frame %>%
rownames_to_column("gene") %>%
write_csv(file.path("geo", paste0(c, ".mirna")))
}
load("data/me.rda")
counts = experiments(obj[["uuo"]])[["protein"]]
for(c in colnames(counts)){
counts[,c, drop = FALSE] %>%
as.data.frame %>%
rownames_to_column("gene") %>%
write_csv(file.path("geo", paste0(c, "_uuo.tsv")))
}
counts = experiments(obj[["fa"]])[["protein"]]
for(c in colnames(counts)){
counts[,c, drop = FALSE] %>%
as.data.frame %>%
rownames_to_column("gene") %>%
write_csv(file.path("geo", paste0(c, "_fa.tsv")))
}
lapply(list.files("geo", full.names = T, pattern = "tsv"), function(fn){
data.frame(sample = tools::file_path_sans_ext(basename(fn)),
md5 = tools::md5sum(fn),
fn = basename(fn),
stringsAsFactors = T)
}) %>% bind_rows()
lapply(list.files("geo", full.names = T, pattern = "tpm"), function(fn){
data.frame(sample = tools::file_path_sans_ext(basename(fn)),
md5 = tools::md5sum(fn),
fn = basename(fn),
stringsAsFactors = T)
}) %>% bind_rows()
lapply(list.files("geo", full.names = T, pattern = "mirna"), function(fn){
data.frame(sample = tools::file_path_sans_ext(basename(fn)),
md5 = tools::md5sum(fn),
fn = basename(fn),
stringsAsFactors = T)
}) %>% bind_rows()
lapply(list.files("geo", full.names = T, pattern = "gtf"), function(fn){
data.frame(sample = tools::file_path_sans_ext(basename(fn)),
md5 = tools::md5sum(fn),
fn = basename(fn),
stringsAsFactors = T)
}) %>% bind_rows()