-
Notifications
You must be signed in to change notification settings - Fork 0
/
Basespace_fetch_tool_flu.R
59 lines (52 loc) · 1.33 KB
/
Basespace_fetch_tool_flu.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
library(readr)
library(stringr)
library(lubridate)
#Grab barcodes
Samplesheet <-
read_delim(
"Sample_sheet.txt",
"-",
escape_double = FALSE,
trim_ws = TRUE,
col_names = F
)
barcodes = toupper(Samplesheet$X1)
experiment_name = paste(Samplesheet$X2, Samplesheet$X3, Samplesheet$X4, sep="-")
samplesheet_id <-
read_delim(
"Sample_sheet.txt",
"/n",
escape_double = FALSE,
trim_ws = TRUE,
col_names = F
)
write(experiment_name, "experiment_name.txt")
x = read_delim("experiment_name.txt", "_", col_names = F)
colnames(x) = c("1", "2", "Date", "Run")
Run = x$Run
rundate = mdy(x$Date)
instrument_model= " "
seq_platform="ILLUMINA"
if(x$`2`[1]== "NB552483"){
instrument_model="NextSeq 550"
} else{
instrument_model="Illumina MiSeq"
}
a = data.frame(barcodes,
rundate,
Run,
experiment_name,
samplesheet_id,
instrument_model,
seq_platform)
colnames(a) = c("entity:flu_id",
"Date_of_run",
"Run",
"experiment_name",
"samplesheet_id",
"instrument_model",
"seq_platform")
write_tsv(as.data.frame(a),
"upload_sheet_bsf_flu.tsv",
eol = "\n")
View(a)