-
Notifications
You must be signed in to change notification settings - Fork 0
/
0.haplomagic.R
executable file
·39 lines (34 loc) · 1.22 KB
/
0.haplomagic.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
#!/usr/bin/env Rscript
#==================================================================================
#title: 0.haplomagic.R
#description: controls the execution of the pipeline
#author: jmontero
#email: jose.a.montero-tena@ab.uni-giessen.de
#date: 2024-06-20
#version: 1.0.0
#notes:
#==================================================================================
args = commandArgs(trailingOnly=TRUE)
# Define global variables
pops = unlist(strsplit(args[1], split = " "))
chrs = unlist(strsplit(args[2], split = " "))
min = as.numeric(args[3])
imp = as.character(args[4]) # 'imputeNot', 'imputeTHonly' or 'imputeAll'
cor = as.character(args[5]) # if 'imp' != 'correctNot', 'reImpute', 'correctFalseHom', 'correctAll'
thr = as.numeric(args[6])
# Source functions
source("1.phase.founders_function.R")
source("2.phase.rest_function.R")
source("3.haploblock_function.R")
source("4.detect.recombination_function.R")
source("5.statistics_function.R")
# Loop pipeline
for (pop in pops) {
for (chr in chrs) {
PhaseFounders(pop, chr)
PhaseRest(pop, chr, min, imp, cor)
AssignFounderHaploblocks(pop, chr)
DetectRecombination(pop, chr, thr)
GetHaplomagicStatistics(pop, chr)
}
}