-
Notifications
You must be signed in to change notification settings - Fork 0
/
id_part1.R
executable file
·38 lines (31 loc) · 1.19 KB
/
id_part1.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
"Usage: id_part1.R (--out1 <O1>) (--out2 <O2>) <input1> <input2>
-h --help show this
--out1 name1 specify the name for the first output file
--out2 name2 specify the name for the second output file
id_part1.R -h | --help show this message
" -> doc
# loads the docopt library
require(docopt)
# retrieves the command-line arguments
opts <- docopt(doc)
# Reads the file with the genomic features information of the E. grandis genome
marcas <- read.table(opts$`<input1>`, colClasses = "character")
# Reads the sites that overlaps genes
marcas_genes_int <- read.table(opts$`<input2>`,
sep = "\t",
colClasses = "character")
marcas_genes_int_names <- unique(marcas_genes_int$V4)
marcas_em_genes <- marcas[marcas$V4 %in% marcas_genes_int_names, ]
write.table(marcas_em_genes,
paste(opts$O1),
sep = "\t",
col.names = F,
row.names = F,
quote = F)
marcas_fora_dos_genes <- marcas[!marcas$V4 %in% marcas_genes_int_names, ]
write.table(marcas_fora_dos_genes,
paste(opts$O2),
sep = "\t",
col.names = F,
row.names = F,
quote = F)