Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in plot functions. Also update DESCRIPTION file. #50

Merged
merged 3 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Title: Cell type annotation diagnostics
Version: 0.99.0
Authors@R: c(
person("Anthony", "Christidis", role = c("aut", "cre"),
email = "anthony-alexander_christidis@hms.harvard.edu"),
email = "anthony-alexander_christidis@hms.harvard.edu",
comment = c(ORCID = "0000-0002-4565-6279")),
person("Andrew", "Ghazi", role = "aut"),
person("Smriti", "Chawla", role = "aut"),
person("Nitesh", "Turaga", role = "ctb"),
Expand Down
8 changes: 5 additions & 3 deletions R/plot.compareCCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ plot.compareCCA <- function(x, ...){
x = "",
y = "Cosine Similarity of CC Coefficients",
size = "Correlation") +
ggplot2::theme_minimal() +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, vjust = 1,
size = 12, hjust = 1))
ggplot2::theme_bw() +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, vjust = 1, size = 12, hjust = 1),
axis.title = ggplot2::element_text(size = 12), axis.text = ggplot2::element_text(size = 10),
panel.grid.minor = ggplot2::element_blank(),
panel.grid.major = ggplot2::element_line(color = "gray", linetype = "dotted"))
return(cca_plot)
}
18 changes: 10 additions & 8 deletions R/plot.comparePCASubspace.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
plot.comparePCASubspace <- function(x, ...){

# Create a data frame for plotting
x <- data.frame(PC = paste0("Ref PC", x$cosine_id[, 1],
" - Query PC", x$cosine_id[, 2]),
Cosine = x$cosine_similarity,
VarianceExplained = subspace_comparison$var_explained_avg)
x$PC <- factor(x$PC, levels = x$PC)
x <- data.frame(PC = paste0("Ref PC", x[["cosine_id"]][, 1],
" - Query PC", x[["cosine_id"]][, 2]),
Cosine = x[["cosine_similarity"]],
VarianceExplained = x[["var_explained_avg"]])
x[["PC"]] <- factor(x[["PC"]], levels = x[["PC"]])

# Create plot
pc_plot <- ggplot2::ggplot(x, ggplot2::aes(x = PC, y = Cosine, size = VarianceExplained)) +
Expand All @@ -40,8 +40,10 @@ plot.comparePCASubspace <- function(x, ...){
x = "",
y = "Cosine Similarity of Principal Angle",
size = "Variance Explained") +
ggplot2::theme_minimal() +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, vjust = 1,
size = 12, hjust = 1))
ggplot2::theme_bw() +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, vjust = 1, size = 12, hjust = 1),
axis.title = ggplot2::element_text(size = 12), axis.text = ggplot2::element_text(size = 10),
panel.grid.minor = ggplot2::element_blank(),
panel.grid.major = ggplot2::element_line(color = "gray", linetype = "dotted"))
return(pc_plot)
}
Loading