-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathRun-c2g.R
66 lines (54 loc) · 2.61 KB
/
Run-c2g.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
#! /usr/bin/Rscript
#######################################################################################
### Run-c2g.R - V0.1 - Clement Goubert (2020) - [email protected] ###
### ------------------------------------------------------------------------------- ###
### This script uses the R function consensus2genome to infer breakpoints ###
### to split and/or trim TE ###
### consensus generated by tools like RepeatModeler2, EDTA, REPET,... ###
### USAGE: TE-slocer.sh <TE-header> <[> ###
### query: path to query (fasta file) ###
### db: path to blast db (blast formated nucleotide database) ###
#######################################################################################
Args = commandArgs()
query = as.character(Args[6])
database = as.character(Args[7])
evalue = as.numeric(Args[8])
FLthresh = as.numeric(Args[9])
alpha = as.numeric(Args[10])
full_alpha = as.numeric(Args[11])
autoy = as.character(Args[12]) # TRUE or numeric value for y max
output = as.character(Args[13])
selfdb = as.character(Args[14]) # bool
blastp = as.character(Args[15]) # includes orfs position
osize = as.numeric(Args[16])
wdir = as.character(Args[17]) # from the shell: path to running directory
tables = as.character(Args[18])
nored = as.character(Args[19])
source(paste(wdir, "/", "consensus2genome.R", sep = ""))
source(paste(wdir, "/", "blastndotplot.R", sep = ""))
pdf(width = 12, height = 12, file = paste(output, "/", tail(strsplit(as.character(query), "/")[[1]],1), ".c2g.pdf", sep=""))
#pdf(width = 16, height = 16, file = paste(tail(strsplit(as.character(query), "/")[[1]],1), ".c2g.pdf", sep=""))
par(mfrow=c(2,2))
print("R: ploting genome blastn results and computing coverage...")
consensus2genome(query = query,
db = database,
evalue = evalue,
FL_thresh = FLthresh,
alpha = alpha,
full_alpha = full_alpha,
auto_y = autoy,
wdir = wdir,
nored = nored
# ,
# cover = cover,
# cov_thresh = drops
# ,
)
print("R: ploting self dot-plot and orf/protein hits...")
blastdotplot(query = query,
db = selfdb,
blast = blastp,
os = osize,
tables = tables,
output = output)
dev.off()