Skip to content

Commit

Permalink
code to combine matrices and track how big each split is
Browse files Browse the repository at this point in the history
  • Loading branch information
sjspielman committed Oct 19, 2023
1 parent bd3961f commit bc18369
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions templates/qc_report/celltypes_supplemental_report.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,30 @@ calculate_jaccard_matrix <- function(celltype_df, colname1, colname2) {
```{r}
# Calculate all jaccard matrices of interest for input to heatmap
# baseline matrix
jaccard_mat <- matrix(
nrow = 0,
ncol = length(unique(celltype_df$cluster))
)
# vector to track splitting the heatmap
split_lengths <- c()
if (has_submitter) {
cluster_submitter_jaccard_matrix <- calculate_jaccard_matrix(celltype_df, "cluster", "submitter_celltype_annotation")
jaccard_mat <- rbind(jaccard_mat, cluster_submitter_jaccard_matrix)
split_lengths <- c(split_lengths, "Submitter annotations" = nrow(cluster_submitter_jaccard_matrix))
}
if (has_singler) {
cluster_singler_jaccard_matrix <- calculate_jaccard_matrix(celltype_df, "cluster", "singler_celltype_annotation")
jaccard_mat <- rbind(jaccard_mat, cluster_singler_jaccard_matrix)
split_lengths <- c(split_lengths, "SingleR annotations" = nrow(cluster_singler_jaccard_matrix))
}
if (has_cellassign) {
cluster_cellassign_jaccard_matrix <- calculate_jaccard_matrix(celltype_df, "cluster", "cellassign_celltype_annotation")
jaccard_mat <- rbind(jaccard_mat, cluster_cellassign_jaccard_matrix)
split_lengths <- c(split_lengths, "CellAssign annotations" = nrow(cluster_cellassign_jaccard_matrix))
}
# TODO: Need a clean appraoch with correct logic for combining these matrices.
```


Expand Down

0 comments on commit bc18369

Please sign in to comment.