-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseparate_delim.R
More file actions
executable file
·29 lines (28 loc) · 912 Bytes
/
separate_delim.R
File metadata and controls
executable file
·29 lines (28 loc) · 912 Bytes
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
#!/bin/env Rscript
library(tidyr)
df <- data.frame(
vdj_region = c("AAAA",
"CCCC",
"DDDD",
"EEEE",
"FFFF",
"GGGG"),
stuff=c(":B:12:D::F:GAPDH",
":X:25:Y:H:I:ADH",
"::45:Z:I:J:LDH",
"::17:A:B:C:enolase",
"::346:D:E:F:RNAPolI",
"Q:W:E:R:T:Y:DNAPol")
)
df2 <- df %>%
separate_wider_delim(stuff,
delim = ":",
names = c(NA,
NA,
"ID",
NA,
NA,
NA,
"GeneName")
)
print(df2)