Skip to content

Commit

Permalink
Drop se calculation given memory limitation
Browse files Browse the repository at this point in the history
Signed-off-by: Liang Zhang <[email protected]>
  • Loading branch information
psychelzh committed Dec 13, 2023
1 parent e3b95e7 commit 9e2eace
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 13 additions & 4 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tar_option_set(
format = "qs",
controller = crew::crew_controller_local(
name = "local",
workers = 8
workers = 20
),
memory = "transient",
garbage_collection = TRUE
Expand Down Expand Up @@ -58,7 +58,7 @@ inter_check_window <- tarchetypes::tar_map(
tar_target(
path_chunks,
fs::dir_ls(tar_name_path, type = "file", recurse = TRUE) |>
split(1:50)
as_tibble_col()
),
tar_target(
rsa_inter_common_trials,
Expand All @@ -71,15 +71,24 @@ inter_check_window <- tarchetypes::tar_map(
pattern = map(path_chunks)
),
tar_target(
summary_word_cat,
summary_word_cat_branches,
rsa_inter_common_trials |>
lapply(
summarise,
mean_se(fisher_z),
n = n(),
sum_fisher_z = sum(fisher_z),
.by = c(region_id, word_category, window_id)
) |>
list_rbind(),
pattern = map(rsa_inter_common_trials)
),
tar_target(
summary_word_cat,
summary_word_cat_branches |>
summarise(
mean_fisher_z = sum(sum_fisher_z) / sum(n),
.by = c(region_id, word_category, window_id)
)
)
)

Expand Down
4 changes: 1 addition & 3 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ targets::tar_read(rsa_inter_common_trials) |>
ggpubr::theme_pubclean()
targets::tar_read(summary_word_cat_rsa_inter_common_trials_window) |>
ggplot(aes(window_id, y, ymax = ymax, ymin = ymin)) +
ggplot(aes(window_id, mean_fisher_z)) +
geom_line(aes(color = word_category, group = word_category)) +
geom_ribbon(aes(fill = word_category), alpha = 0.5) +
scale_x_continuous(name = "Time (ms)", labels = \(x) x * 20) +
scale_y_continuous(name = "Intersubject Correlation") +
ggsci::scale_fill_d3(name = "Word Type") +
ggsci::scale_color_d3(name = "Word Type") +
facet_wrap(vars(region_id)) +
ggpubr::theme_pubclean()
Expand Down

0 comments on commit 9e2eace

Please sign in to comment.