Skip to content

Commit

Permalink
Merge pull request WayScience#129 from MikeLippincott/refactor_figures
Browse files Browse the repository at this point in the history
Refactor figures
  • Loading branch information
MikeLippincott authored Mar 5, 2024
2 parents dffbf88 + c23cd9e commit 257bc5f
Show file tree
Hide file tree
Showing 65 changed files with 1,023 additions and 1,044 deletions.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@
" \"../\", \n",
" \"figures/\",\n",
" cell_type,\n",
" \"final_figure.png\")), width = width, height = height, units = \"in\", res = 600\n",
" \"S10.png\")), width = width, height = height, units = \"in\", res = 600\n",
")\n",
"figure\n",
"dev.off()\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ png(filename = file.path(paste0(
"../",
"figures/",
cell_type,
"final_figure.png")), width = width, height = height, units = "in", res = 600
"S10.png")), width = width, height = height, units = "in", res = 600
)
figure
dev.off()
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
},
"outputs": [],
"source": [
"suppressWarnings(suppressPackageStartupMessages(library(ggplot2)))\n",
"suppressWarnings(suppressPackageStartupMessages(library(platetools)))\n",
"suppressWarnings(suppressPackageStartupMessages(library(gridExtra)))\n",
"suppressWarnings(suppressPackageStartupMessages(library(cowplot)))\n",
"suppressWarnings(suppressPackageStartupMessages(library(viridis)))\n",
"suppressWarnings(suppressPackageStartupMessages(library(argparse)))\n",
"suppressWarnings(suppressPackageStartupMessages(library(patchwork)))\n",
"suppressWarnings(suppressPackageStartupMessages(library(arrow)))\n",
"suppressWarnings(suppressPackageStartupMessages(library(dplyr)))"
"suppressWarnings(suppressPackageStartupMessages(library(ggplot2))) # plotting\n",
"suppressWarnings(suppressPackageStartupMessages(library(platetools))) # plotting\n",
"suppressWarnings(suppressPackageStartupMessages(library(gridExtra))) # plot assembly\n",
"suppressWarnings(suppressPackageStartupMessages(library(cowplot))) # plot assembly\n",
"suppressWarnings(suppressPackageStartupMessages(library(viridis))) # color palettes\n",
"suppressWarnings(suppressPackageStartupMessages(library(argparse))) # command line arguments\n",
"suppressWarnings(suppressPackageStartupMessages(library(patchwork))) # plot assembly\n",
"suppressWarnings(suppressPackageStartupMessages(library(arrow))) # reading parquet files\n",
"suppressWarnings(suppressPackageStartupMessages(library(dplyr))) # data manipulation"
]
},
{
Expand Down Expand Up @@ -338,15 +338,13 @@
],
"source": [
"# set path to the PBMC metadata file\n",
"metadata_file_path_PBMC <-file.path(\n",
"metadata_file_path_PBMC <- file.path(\n",
" \"..\",\n",
" \"..\",\n",
" \"..\",\n",
" \"data\",\n",
" \"PBMC_preprocessed_sc_norm.parquet\"\n",
")\n",
"# load the metadata file via arrow \n",
"# metadata_file <- arrow::read_parquet(metadata_file_path)\n",
"\n",
"# load via arrow with certain columns\n",
"metadata_file_PBMC <- arrow::read_parquet(\n",
Expand All @@ -361,7 +359,7 @@
"\n",
"# SHSY5Y\n",
"# set path to the SHSY5Y metadata file\n",
"metadata_file_path_SHSY5Y <-file.path(\n",
"metadata_file_path_SHSY5Y <- file.path(\n",
" \"..\",\n",
" \"..\",\n",
" \"..\",\n",
Expand Down Expand Up @@ -547,7 +545,7 @@
" replacement = \"pool\",\n",
" x = metadata_file_PBMC$label\n",
")\n",
"# aggreagate the metadata via Metadata_Well\n",
"# aggregate the metadata via Metadata_Well\n",
"metadata_file_PBMC <- metadata_file_PBMC %>%\n",
" group_by(Metadata_Well, Metadata_cell_type, label) %>%\n",
" summarize(\n",
Expand All @@ -574,7 +572,7 @@
" replacement = \"pool\",\n",
" x = metadata_file_SHSY5Y$label\n",
")\n",
"# aggreagate the metadata via Metadata_Well\n",
"# aggregate the metadata via Metadata_Well\n",
"metadata_file_SHSY5Y <- metadata_file_SHSY5Y %>%\n",
" group_by(Metadata_Well, Metadata_cell_type, label) %>%\n",
" summarize(\n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
suppressWarnings(suppressPackageStartupMessages(library(ggplot2)))
suppressWarnings(suppressPackageStartupMessages(library(platetools)))
suppressWarnings(suppressPackageStartupMessages(library(gridExtra)))
suppressWarnings(suppressPackageStartupMessages(library(cowplot)))
suppressWarnings(suppressPackageStartupMessages(library(viridis)))
suppressWarnings(suppressPackageStartupMessages(library(argparse)))
suppressWarnings(suppressPackageStartupMessages(library(patchwork)))
suppressWarnings(suppressPackageStartupMessages(library(arrow)))
suppressWarnings(suppressPackageStartupMessages(library(dplyr)))
suppressWarnings(suppressPackageStartupMessages(library(ggplot2))) # plotting
suppressWarnings(suppressPackageStartupMessages(library(platetools))) # plotting
suppressWarnings(suppressPackageStartupMessages(library(gridExtra))) # plot assembly
suppressWarnings(suppressPackageStartupMessages(library(cowplot))) # plot assembly
suppressWarnings(suppressPackageStartupMessages(library(viridis))) # color palettes
suppressWarnings(suppressPackageStartupMessages(library(argparse))) # command line arguments
suppressWarnings(suppressPackageStartupMessages(library(patchwork))) # plot assembly
suppressWarnings(suppressPackageStartupMessages(library(arrow))) # reading parquet files
suppressWarnings(suppressPackageStartupMessages(library(dplyr))) # data manipulation

# define the base directory
base_dir <- file.path(
Expand Down Expand Up @@ -56,15 +56,13 @@ head(index_file_SHSY5Y,2)


# set path to the PBMC metadata file
metadata_file_path_PBMC <-file.path(
metadata_file_path_PBMC <- file.path(
"..",
"..",
"..",
"data",
"PBMC_preprocessed_sc_norm.parquet"
)
# load the metadata file via arrow
# metadata_file <- arrow::read_parquet(metadata_file_path)

# load via arrow with certain columns
metadata_file_PBMC <- arrow::read_parquet(
Expand All @@ -79,7 +77,7 @@ head(metadata_file_PBMC)

# SHSY5Y
# set path to the SHSY5Y metadata file
metadata_file_path_SHSY5Y <-file.path(
metadata_file_path_SHSY5Y <- file.path(
"..",
"..",
"..",
Expand Down Expand Up @@ -117,7 +115,7 @@ metadata_file_PBMC$label <- gsub(
replacement = "pool",
x = metadata_file_PBMC$label
)
# aggreagate the metadata via Metadata_Well
# aggregate the metadata via Metadata_Well
metadata_file_PBMC <- metadata_file_PBMC %>%
group_by(Metadata_Well, Metadata_cell_type, label) %>%
summarize(
Expand All @@ -144,7 +142,7 @@ metadata_file_SHSY5Y$label <- gsub(
replacement = "pool",
x = metadata_file_SHSY5Y$label
)
# aggreagate the metadata via Metadata_Well
# aggregate the metadata via Metadata_Well
metadata_file_SHSY5Y <- metadata_file_SHSY5Y %>%
group_by(Metadata_Well, Metadata_cell_type, label) %>%
summarize(
Expand Down
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,15 @@
"width <- 10\n",
"height <- 10\n",
"options(repr.plot.width=width, repr.plot.height=height, units = \"cm\", dpi = 600)\n",
"fig5 <- (\n",
"fig12 <- (\n",
" f1_score_plot\n",
" + theme(plot.tag = element_text(size = 20))\n",
")\n",
"fig5\n",
"fig12\n",
"\n",
"# save the plot\n",
"\n",
"ggsave(\"../figures/S8.png\", fig5, width = width, height = height, dpi = 600)\n"
"ggsave(\"../figures/S12.png\", fig12, width = width, height = height, dpi = 600)\n"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ f1_score_plot
width <- 10
height <- 10
options(repr.plot.width=width, repr.plot.height=height, units = "cm", dpi = 600)
fig5 <- (
fig12 <- (
f1_score_plot
+ theme(plot.tag = element_text(size = 20))
)
fig5
fig12

# save the plot

ggsave("../figures/S8.png", fig5, width = width, height = height, dpi = 600)
ggsave("../figures/S12.png", fig12, width = width, height = height, dpi = 600)

Binary file added figures/S13/figures/S13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 257bc5f

Please sign in to comment.