-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdomainformat.R
More file actions
48 lines (41 loc) · 1.79 KB
/
domainformat.R
File metadata and controls
48 lines (41 loc) · 1.79 KB
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
library(tidyverse)
cnldom <- read.delim("cnl.interpro.tsv", sep = "\t", header = FALSE)
cnldom <- cnldom[,c(1,6)]
tnldom <- read.delim("tnl.interpro.tsv", sep = "\t", header = FALSE)
tnldom <- tnldom[,c(1,6)]
rnldom <- read.delim("rnl.interpro.tsv", sep = "\t", header = FALSE)
rnldom <- rnldom[,c(1,6)]
mnldom <- read.delim("mnl.interpro.tsv", sep = "\t", header = FALSE)
mnldom <- mnldom[,c(1,6)]
xnldom <- read.delim("other.interpro.tsv", sep = "\t", header = FALSE)
xnldom <- xnldom[,c(1,6)]
cnl_dom_wide <- cnldom %>%
group_by(V1) %>%
mutate(domain = row_number()) %>%
ungroup() %>%
pivot_wider(names_from = domain, values_from = V6)
tnl_dom_wide <- tnldom %>%
group_by(V1) %>%
mutate(domain = row_number()) %>%
ungroup() %>%
pivot_wider(names_from = domain, values_from = V6)
rnl_dom_wide <- rnldom %>%
group_by(V1) %>%
mutate(domain = row_number()) %>%
ungroup() %>%
pivot_wider(names_from = domain, values_from = V6)
mnl_dom_wide <- mnldom %>%
group_by(V1) %>%
mutate(domain = row_number()) %>%
ungroup() %>%
pivot_wider(names_from = domain, values_from = V6)
xnl_dom_wide <- xnldom %>%
group_by(V1) %>%
mutate(domain = row_number()) %>%
ungroup() %>%
pivot_wider(names_from = domain, values_from = V6)
write.table(cnl_dom_wide, "cnl_domains_wide.txt", sep = "\t", row.names = FALSE, col.names = FALSE, quote = FALSE)
write.table(tnl_dom_wide, "tnl_domains_wide.txt", sep = "\t", row.names = FALSE, col.names = FALSE, quote = FALSE)
write.table(rnl_dom_wide, "rnl_domains_wide.txt", sep = "\t", row.names = FALSE, col.names = FALSE, quote = FALSE)
write.table(mnl_dom_wide, "mnl_domains_wide.txt", sep = "\t", row.names = FALSE, col.names = FALSE, quote = FALSE)
write.table(xnl_dom_wide, "other_domains_wide.txt", sep = "\t", row.names = FALSE, col.names = FALSE, quote = FALSE)