@@ -63,19 +63,19 @@ PREPEND_TO_OUTPUT <- ''
63
63
64
64
# Produce some helpful warning messages
65
65
if (! (NBOOTSTRAPS > = 1 && NBOOTSTRAPS < = 1000000 )) {
66
- cat(" ### WARNING: NBOOTSTRAPS must be in the range [1,1000000]. Using: 1000.\n " )
66
+ cat(" \n ### WARNING: NBOOTSTRAPS must be in the range [1,1000000]. Using: 1000.\n " )
67
67
NBOOTSTRAPS <- 1000
68
68
}
69
69
70
70
if (! (MIN_DEFINED_CODONS > = 2 )) {
71
- cat(" ### WARNING: MIN_DEFINED_CODONS must be ≥2. Using: 6.\n " )
71
+ cat(" \n ### WARNING: MIN_DEFINED_CODONS must be ≥2. Using: 6.\n " )
72
72
MIN_DEFINED_CODONS <- 6
73
73
}
74
74
75
75
if (! is.na(ARGV [8 ]) && ARGV [8 ] == " JC" ) {
76
76
CORRECTION <- as.character(ARGV [8 ])
77
- } else {
78
- cat(" ### WARNING: unrecognized CORRECTION supplied. Using: \" NONE\" .\n " )
77
+ } else if (is.na( ARGV [ 8 ]) || ARGV [ 8 ] != " NONE " ) {
78
+ cat(" \n ### WARNING: unrecognized CORRECTION supplied. Using: \" NONE\" .\n " )
79
79
}
80
80
81
81
if (! is.na(ARGV [9 ]) && str_detect(string = ARGV [9 ], pattern = " \\ d" ) && ! str_detect(string = ARGV [9 ], pattern = " [a-zA-Z]" )) {
@@ -87,7 +87,7 @@ if(! is.na(ARGV[10])) {
87
87
}
88
88
89
89
# EXAMPLES
90
- # CODON_RESULTS_FILE <- "/Users/cwnelson88 /Desktop/SCIENCE/Karlin_OLGs_B19/OLGenie_codon_results .txt"
90
+ # CODON_RESULTS_FILE <- "/Users/chase /Desktop/OLG_projects/OLGenie-out .txt"
91
91
# NUMERATOR <- "NN"
92
92
# DENOMINATOR <- "NS"
93
93
# WINDOW_SIZE <- 25
@@ -296,36 +296,36 @@ dNdS_diff_boot_fun_JC <- function(codon_results, numerator, denominator, num_rep
296
296
# ## ADD COLUMNS TO DATA
297
297
RATIO_NAME <- paste0(' d' , NUMERATOR , ' d' , DENOMINATOR )
298
298
codon_data $ sw_ratio <- RATIO_NAME
299
- codon_data $ sw_start <- NA
300
- codon_data $ sw_center <- NA
301
- codon_data $ sw_end <- NA
302
- codon_data $ sw_num_replicates <- NA
303
- codon_data $ sw_N_diffs <- NA
304
- codon_data $ sw_S_diffs <- NA
305
- codon_data $ sw_N_sites <- NA
306
- codon_data $ sw_S_sites <- NA
307
- codon_data $ sw_dN <- NA
308
- codon_data $ sw_dS <- NA
309
- codon_data $ sw_dNdS <- NA
310
- codon_data $ sw_dN_m_dS <- NA
311
- codon_data $ sw_boot_dN_SE <- NA
312
- codon_data $ sw_boot_dS_SE <- NA
313
- codon_data $ sw_boot_dN_over_dS_SE <- NA
314
- codon_data $ sw_boot_dN_over_dS_P <- NA
315
- codon_data $ sw_boot_dN_m_dS_SE <- NA
316
- codon_data $ sw_boot_dN_m_dS_P <- NA
317
- codon_data $ sw_boot_dN_gt_dS_count <- NA
318
- codon_data $ sw_boot_dN_eq_dS_count <- NA
319
- codon_data $ sw_boot_dN_lt_dS_count <- NA
320
- codon_data $ sw_ASL_dN_gt_dS_P <- NA
321
- codon_data $ sw_ASL_dN_lt_dS_P <- NA
322
- codon_data $ sw_ASL_dNdS_P <- NA
299
+ codon_data $ sw_start <- as.double( NA )
300
+ codon_data $ sw_center <- as.double( NA )
301
+ codon_data $ sw_end <- as.double( NA )
302
+ codon_data $ sw_num_replicates <- as.integer( NA )
303
+ codon_data $ sw_N_diffs <- as.double( NA )
304
+ codon_data $ sw_S_diffs <- as.double( NA )
305
+ codon_data $ sw_N_sites <- as.double( NA )
306
+ codon_data $ sw_S_sites <- as.double( NA )
307
+ codon_data $ sw_dN <- as.double( NA )
308
+ codon_data $ sw_dS <- as.double( NA )
309
+ codon_data $ sw_dNdS <- as.double( NA )
310
+ codon_data $ sw_dN_m_dS <- as.double( NA )
311
+ codon_data $ sw_boot_dN_SE <- as.double( NA )
312
+ codon_data $ sw_boot_dS_SE <- as.double( NA )
313
+ codon_data $ sw_boot_dN_over_dS_SE <- as.double( NA )
314
+ codon_data $ sw_boot_dN_over_dS_P <- as.double( NA )
315
+ codon_data $ sw_boot_dN_m_dS_SE <- as.double( NA )
316
+ codon_data $ sw_boot_dN_m_dS_P <- as.double( NA )
317
+ codon_data $ sw_boot_dN_gt_dS_count <- as.integer( NA )
318
+ codon_data $ sw_boot_dN_eq_dS_count <- as.integer( NA )
319
+ codon_data $ sw_boot_dN_lt_dS_count <- as.integer( NA )
320
+ codon_data $ sw_ASL_dN_gt_dS_P <- as.double( NA )
321
+ codon_data $ sw_ASL_dN_lt_dS_P <- as.double( NA )
322
+ codon_data $ sw_ASL_dNdS_P <- as.double( NA )
323
323
324
324
325
325
# ## PERFORM SLIDING WINDOW
326
326
cat(" Performing sliding window analysis...\n\n " )
327
327
for (this_frame in unique(codon_data $ frame )) {
328
- # this_frame <- 'ss13 '
328
+ # this_frame <- 'sas13 '
329
329
frame_codon_data <- filter(codon_data , frame == this_frame , num_defined_seqs > = MIN_DEFINED_CODONS )
330
330
frame_codon_data <- dplyr :: arrange(frame_codon_data , codon_num )
331
331
0 commit comments