Skip to content

Commit

Permalink
Merge pull request #3 from beauchamplab/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
beauchamplab authored Oct 19, 2019
2 parents 6d010ce + 6793061 commit 1f8395d
Show file tree
Hide file tree
Showing 47 changed files with 6,625 additions and 2,401 deletions.
51 changes: 32 additions & 19 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,37 +1,50 @@
# Generated by roxygen2: do not edit by hand
Package: ravebuiltins
Type: Package
Title: What the Package Does (Title Case)
Version: 0.1.0
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
Title: Builtin Modules for `RAVE`
Version: 0.1.1
Description: This package provides builtin modules for `RAVE`. It aims at analyze
and visualize `iEEG` data from different perspectives.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
Authors@R:
person(given = "Zhengjia",
family = "Wang",
role = "cre",
email = "[email protected]")
Authors@R: c(
person(given = "Zhengjia", family = "Wang", role = c("cre", "aut"), email = "[email protected]"),
person(given = "John", family = "Magnotti", role = "aut", email = "[email protected]")
)
Imports:
methods,
stats,
graphics,
grid,
abind,
car,
utils,
data.table,
yaml (>= 2.2.0),
shiny (>= 1.2.0),
rlang (>= 0.3.0),
stringr (>= 1.3.1),
magrittr,
circular,
lmerTest,
methods,
threeBrain (>= 0.1.3),
future (>= 0.14.0),
magrittr (>= 1.5),
circular (>= 0.4-93),
lmerTest (>= 3.1-0),
knitr,
assertthat,
shinyjs,
shinyFiles,
reshape2,
digest,
DT,
fst,
htmltools,
rave,
rutabaga,
future,
abind,
stats
rutabaga
Suggests:
devtools,
yaml (>= 2.2.0),
rstudioapi (>= 0.9.0)
Remotes:
github::dipterix/rutabaga,
github::dipterix/threeBrain,
github::beauchamplab/rave
9 changes: 9 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Generated by roxygen2: do not edit by hand

export(across_electrodes_beta_histogram)
export(across_electrodes_f_histogram)
export(by_condition_welch)
export(by_trial_erp_map)
export(dev_ravebuiltins)
Expand All @@ -16,15 +18,22 @@ import(rlang)
import(rutabaga)
import(shiny)
import(stringr)
importFrom(grDevices,col2rgb)
importFrom(grDevices,colorRampPalette)
importFrom(grDevices,dev.off)
importFrom(grDevices,palette)
importFrom(grDevices,pdf)
importFrom(grDevices,rgb)
importFrom(magrittr,"%$%")
importFrom(magrittr,"%<>%")
importFrom(magrittr,"%>%")
importFrom(magrittr,extract)
importFrom(magrittr,extract2)
importFrom(methods,getMethod)
importFrom(methods,is)
importFrom(stats,median)
importFrom(stats,median.default)
importFrom(stats,p.adjust)
importFrom(stats,pt)
importFrom(stats,quantile)
importFrom(stats,symnum)
60 changes: 46 additions & 14 deletions R/aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,59 @@
#' @importFrom magrittr %>%
#' @import stringr
#' @importFrom magrittr %<>%
#' @importFrom magrittr %$%
#' @importFrom magrittr extract2
#' @importFrom magrittr extract
#' @import rlang
#' @import lmerTest
#'
#' @importFrom methods is
#' @importFrom methods getMethod
#' @import circular
#'
#' @importFrom grDevices dev.off
#' @importFrom grDevices pdf
#' @importFrom grDevices palette
#' @importFrom grDevices col2rgb
#' @importFrom grDevices colorRampPalette
#' @importFrom grDevices rgb
#'
#' @import graphics
#'
#' @importFrom stats median
#' @importFrom stats median.default
#' @importFrom stats pt
#' @importFrom stats quantile
#' @importFrom stats p.adjust
#' @importFrom stats symnum
#'
NULL

# Add global variables to pass check
..async_quo = NULL
..async_var = NULL
.palettes = NULL
BASELINE = NULL
FREQUENCY = NULL
Frequency = NULL
TIME_RANGE = NULL
Time = NULL
draw_time_baseline = NULL
is_clean = NULL
label.col = NULL
x = NULL
xax = NULL
xlab = NULL
y = NULL
yax = NULL
ylab = NULL
data = NULL







cat2 <- function(..., end = '\n', level = 'DEBUG', print_level = FALSE, pal = list(
'DEBUG' = 'grey60',
Expand Down Expand Up @@ -262,14 +296,16 @@ rave_color_ramp_dark_palette <- colorRampPalette(c('#13547a', 'black', '#ff758c'
..dark_blue_to_red <- rev(c("#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#ffffff",
"#d1e5f0", "#92c5de", "#4393c3", "#2166ac", "#053061"))
..light_blue_to_light_red <- c(..dark_blue_to_red[5:1], 'black', ..dark_blue_to_red[11:7])

..light_blue_to_gray_to_light_red <- c(..dark_blue_to_red[5:1], '#1E1E1E', ..dark_blue_to_red[11:7])

rave_color_ramp_palette <- colorRampPalette(..dark_blue_to_red, interpolate='linear', space='Lab')
rave_heat_map_colors <- rave_color_ramp_palette(1001)

rave_color_ramp_dark_palette <- colorRampPalette(..light_blue_to_light_red, interpolate='linear', space='Lab')
rave_color_ramp_gray_palette <- colorRampPalette(..light_blue_to_gray_to_light_red, interpolate='linear', space='Lab')

rave_heat_map_dark_colors <- rave_color_ramp_dark_palette(1001)
rave_heat_map_gray_colors <- rave_color_ramp_gray_palette(1001)

# put this here for legacy, but we need to exterminate these references
crp <- rave_heat_map_colors
Expand All @@ -282,12 +318,7 @@ rave_axis <- function(side, at, tcl=-0.3, labels=at, las=1, cex.axis=rave_cex.ax

# if the color isn't specified, then we are free to set the color to what we want.
# let's set it to be black, unless that background color is black, then we'll do white
col %?<-% if(par('bg') == 'black') {
'white'
} else {
'black'
}

col %?<-% get_foreground_color()
col.axis %?<-% col

ruta_axis(
Expand All @@ -305,8 +336,6 @@ rave_axis <- function(side, at, tcl=-0.3, labels=at, las=1, cex.axis=rave_cex.ax
)
}



default_plot <- function() {
plot_clean(1, 1, type='n', main='No Conditions Specified')
}
Expand Down Expand Up @@ -387,11 +416,14 @@ rave_colors <- list('BASELINE_WINDOW'='gray60', 'ANALYSIS_WINDOW' = 'salmon2', '
'TRIAL_TYPE_SEPARATOR'='gray40')

rave_title <- function(main, cex=rave_cex.main, col, font=1) {

col %?<-% if(par('bg') == 'black') {
'white'
} else {
'black'
if(missing(col)) {
col = if(par('bg') == 'black') {
'white'
} else if (par('bg') == '#1E1E1E'){
'gray70'
} else {
'black'
}
}

title(main=list(main, cex=cex, col=col, font=font))
Expand Down
Loading

0 comments on commit 1f8395d

Please sign in to comment.