This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtar_vep.R
74 lines (65 loc) · 2.31 KB
/
tar_vep.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
68
69
70
71
72
73
74
### global libraries ===============================================================================
library(targets)
library(tarchetypes)
library(here)
library(data.table)
library(future)
library(future.callr)
# targets::tar_renv(extras = "visNetwork", path = "scripts/_dependencies.R")
### project setup ==================================================================================
# Functions/scripts required: tar-vep.R
invisible(sapply(
X = list.files(here("scripts", "tar-utils"), pattern = "^tar-.*R$", full.names = TRUE),
FUN = source, echo = FALSE
))
plan(future.callr::callr, workers = 3)
# plan(multicore, workers = 40)
message(sprintf("Number of workers: %d", future::nbrOfWorkers()))
# setDTthreads(threads = 1)
### targets setup ==================================================================================
tar_setup <- list( # Setup project
tar_target(project, sub("(.*)_[^_]*\\.Rproj$", "\\1", list.files(here(), pattern = ".Rproj$")), packages = "here"),
tar_target(author, "Mickaël CANOUIL, *Ph.D.*"),
tar_target(output_directory, here::here("outputs"), packages = "here"),
tar_target(genome_assembly, "GRCh38"),
tar_target(ensembl_version, "104"),
tar_target(ensembl_species, "homo_sapiens"),
tar_target(vep_cache,
command = c(
"server" = "/media/Data/ExternalData/vep_data",
"docker" = "/disks/DATA/ExternalData/vep_data"
)
),
tar_target(bcftools, "/usr/bin/bcftools", format = "file"),
tar_target(tabix, "/usr/bin/tabix", format = "file"),
tar_target(bgzip, "/usr/bin/bgzip", format = "file")
)
### targets ========================================================================================
tar_vep <- list(
tar_target(vep_symbol,
command = get_symbol_vep(
input = get_variants(
path = "file.vcf.gz",
output_directory = output_directory,
bin_path = list(bcftools = bcftools)
),
output_directory = output_directory,
genome_assembly = genome_assembly,
ensembl_version = ensembl_version,
ensembl_species = ensembl_species,
vep_cache = vep_cache
),
packages = c("here", "data.table")
),
tar_target(veb_symbol_file,
command = format_symbol_vep(
file = vep_symbol,
bin_path = list(tabix = tabix, bgzip = bgzip)
),
format = "file"
)
)
list(
tar_setup,
tar_vep
)