Skip to content

Commit

Permalink
Remove summary lines from the Count Within worksheet, they are not co…
Browse files Browse the repository at this point in the history
…rrect (close #35)

Keep the row order (by slide) from the previous change, it seems better than by category.
  • Loading branch information
AB-Kent committed May 18, 2020
1 parent b03875f commit 38431b4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# phenoptrReports 0.2.7.9000

Analysis addin:
- Remove summary lines from the Count Within worksheet, they are not
correct (#35)!

Spatial map viewer addin:
- For the usual use where the client browser is running on the user's
computer, the "Save all" saves directly to the local file system without
Expand Down
17 changes: 3 additions & 14 deletions R/distance_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,9 @@ count_within_summary = function(csd, radii, phenotypes=NULL, categories=NA,
aggregate_counts() %>%
dplyr::ungroup()

# If there are multiple tissue categories, add another level of
# aggregation.
if (length(categories) > 1) {
distances = distances %>%
tidyr::nest(data=c(category, from_count, to_count,
from_with, within_mean)) %>%
# This adds an "All" row to each nested group
dplyr::mutate(data=purrr::map(data,
~dplyr::bind_rows(.x,
cbind(category='All', aggregate_counts(.x),
stringsAsFactors=FALSE)))) %>%
tidyr::unnest(data)

}
# Better row order
distances = distances %>%
dplyr::arrange(!!.by, from, to, radius)

distances %>%
# Make pretty names for the Excel export and re-order a little
Expand Down
Binary file modified tests/testthat/test_data/Results.xlsx
Binary file not shown.
Binary file modified tests/testthat/test_data/Results_by_sample.xlsx
Binary file not shown.

0 comments on commit 38431b4

Please sign in to comment.