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

Added visualization for Gini coefficient; cleaned up vis.R to reduce copy-pasted values and code #343

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ S3method(vis,immunr_exp_count)
S3method(vis,immunr_exp_len)
S3method(vis,immunr_exp_vol)
S3method(vis,immunr_gene_usage)
S3method(vis,immunr_gini)
S3method(vis,immunr_ginisimp)
S3method(vis,immunr_gu_matrix)
S3method(vis,immunr_hclust)
Expand Down
12 changes: 12 additions & 0 deletions R/tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,18 @@ rename_column <- function(.data, .old, .new) {
}


matrix_to_df <- function(.data) {
data.frame(Sample = row.names(.data), Value = .data[, 1])
}


transpose_gene_usage <- function(.data) {
row.names(.data) <- .data[[1]]
.data <- t(as.matrix(.data[2:ncol(.data)]))
.data
}


#' Apply function to each pair of data frames from a list.
#'
#' @concept utility_public
Expand Down
218 changes: 132 additions & 86 deletions R/vis.R

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions man/vis.immunr_chao1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/vis.immunr_clonal_prop.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/vis.immunr_exp_vol.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/vis.immunr_kmeans.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/vis.immunr_mds.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/vis_bar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/vis_box.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/vis_public_clonotypes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/vis_textlogo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.