forked from liangclab/HERA
-
Notifications
You must be signed in to change notification settings - Fork 1
/
LocalHERA_Run16.R
executable file
·65 lines (61 loc) · 2.55 KB
/
LocalHERA_Run16.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
#!/usr/bin/Rscript
args <- commandArgs(T)
source(args[1])
# Some functions easy to use #
Use_Working_Script <- function(x){
use.script <- paste0(Working_Script,"/",x)
return(use.script)
}
print("---------------------------------------------")
print(" Running LocalHERA Part 16 ")
print("---------------------------------------------")
#aligning the path-contigs to scaffold
print("aligning the path-contigs to scaffold")
ss <- dir(pattern = "^Super.*pbs")
#### 10 ####
for (n in seq(1,length(ss),by = 5)){
if (n < length(ss)+1){
i <- ss[n]
Gap_Info <- gsub(pattern = ".pbs", replacement = "", x = i)
print(Gap_Info)
setwd(Gap_Info)
system(paste("/store/whzhang/anaconda2/envs/falcon/bin/LAdump -cd", paste0(Gap_Info,".dam All.las | perl"), Use_Working_Script("ParseLA.pl"),">",paste0(Gap_Info,"-Final.txt")),wait = F) #10
setwd("../")
}
if (n+1 < length(ss)+1){
i <- ss[n+1]
Gap_Info <- gsub(pattern = ".pbs", replacement = "", x = i)
print(Gap_Info)
setwd(Gap_Info)
system(paste("/store/whzhang/anaconda2/envs/falcon/bin/LAdump -cd", paste0(Gap_Info,".dam All.las | perl"), Use_Working_Script("ParseLA.pl"),">",paste0(Gap_Info,"-Final.txt")),wait = F) #10
setwd("../")
}
if (n+2 < length(ss)+1){
i <- ss[n+2]
Gap_Info <- gsub(pattern = ".pbs", replacement = "", x = i)
print(Gap_Info)
setwd(Gap_Info)
system(paste("/store/whzhang/anaconda2/envs/falcon/bin/LAdump -cd", paste0(Gap_Info,".dam All.las | perl"), Use_Working_Script("ParseLA.pl"),">",paste0(Gap_Info,"-Final.txt")),wait = F) #10
setwd("../")
}
if (n+3 < length(ss)+1){
i <- ss[n+3]
Gap_Info <- gsub(pattern = ".pbs", replacement = "", x = i)
print(Gap_Info)
setwd(Gap_Info)
system(paste("/store/whzhang/anaconda2/envs/falcon/bin/LAdump -cd", paste0(Gap_Info,".dam All.las | perl"), Use_Working_Script("ParseLA.pl"),">",paste0(Gap_Info,"-Final.txt")),wait = F) #10
setwd("../")
}
if (n+4 < length(ss)+1){
i <- ss[n+4]
Gap_Info <- gsub(pattern = ".pbs", replacement = "", x = i)
print(Gap_Info)
setwd(Gap_Info)
system(paste("/store/whzhang/anaconda2/envs/falcon/bin/LAdump -cd", paste0(Gap_Info,".dam All.las | perl"), Use_Working_Script("ParseLA.pl"),">",paste0(Gap_Info,"-Final.txt")),wait = T) #10
setwd("../")
}
}
print("----------------------------------------------------------")
print(" LocalHERA Part 16 Complete! ")
print(" Please check ! ")
print("----------------------------------------------------------")