diff --git a/DESCRIPTION b/DESCRIPTION index 0871d85..1229beb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: phenoptrReports Title: Create reports using Phenoptics data -Version: 0.2.1.9000 -Date: 2019-05-31 +Version: 0.2.2 +Date: 2019-06-18 Authors@R: c( person("Kent S", "Johnson", role = c("aut", "cre"), email = "kjohnson@akoyabio.com"), diff --git a/NEWS.md b/NEWS.md index d731f52..6cec3e9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,12 +1,15 @@ -# phenoptrReports 0.2.1.9000 +# phenoptrReports 0.2.2 +**2019-06-18** + +Spatial map viewer addin: +- New addin provides a field-based viewer of nearest neighbor relationships. + See the + [Visualizing spatial relationships tutorial](https://akoyabio.github.io/phenoptrReports/articles/spatial_map_viewer.html) + for details. -Analysis addin +Analysis addin: - Phenotype definitions may include valid expressions such as `` ~`Membrane PDL1 (Opal 520) Mean`>5 ``. - -Spatial map viewer addin -- New addin provides a field-based viewer of nearest neighbor relationships. - See the "Viewing nearest neighbors" tutorial for details. Bug fixes: - Fix error during calculation of N/A and Total cell in cell seg summary report diff --git a/README.md b/README.md index 9862946..060a55b 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ the analysis addin and in inForm export folder containing composite and component images. For detailed instructions and requirements, see the -[Spatial map viewer tutorial](https://akoyabio.github.io/phenoptrReports/articles/spatial_map_viewer.html). +[Visualizing spatial relationships tutorial](https://akoyabio.github.io/phenoptrReports/articles/spatial_map_viewer.html). ### Unmixing quality report diff --git a/_pkgdown.yml b/_pkgdown.yml index 58bc6f1..eb5a534 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -16,6 +16,8 @@ navbar: href: articles/consolidation.html - text: "Analyzing inForm data" href: articles/analysis.html + - text: "Visualizing spatial relationships" + href: articles/spatial_map_viewer.html - text: "Unmixing quality report" href: articles/unmixing_quality_report.html - text: "Reference" diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index a4ee3e6..8d68e48 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -60,7 +60,7 @@
@@ -85,6 +85,9 @@vignettes/analysis.Rmd
analysis.Rmd
In this section, select the types of spatial analysis to include.
+Include nearest neighbor summary If this is selected, the generated report will include a tab summarizing nearest neighbor distances between every pair of phenotypes and heatmap visualizations of the mean distances.
Include “count within radius” summary If this is selected, the generated report will include a tab summarizing, for each pair of phenotypes, the number of cells of a phenotype having a cell of a second phenotype within a specified radius. Enter the radius or radii of interest in the text field.
Save nearest neighbor details If this is selected, the analysis will write a nearest_neighbors.csv
file containing, for each cell, the distance to the nearest cell of each phenotype and the cell ID of the cell. This file is needed by the “Spatial map viewer” to visualize nearest neighbor distances and may be useful for more detailed statistical analysis of nearest neighbor distances. Select this option if you want to use the Spatial map viewer later!
vignettes/consolidation.Rmd
consolidation.Rmd
vignettes/spatial_map_viewer.Rmd
+ spatial_map_viewer.Rmd
The “Spatial map viewer” addin allows viewing of nearest neighbor relationships between cells of selected phenotypes in a single field. Views can be saved for later use.
+Nearest neighbor relationships are read from a nearest_neighbors.csv
file. This file is created by the “Analyze consolidated data” addin when “Save nearest neighbor details” is selected.
The viewer uses both composite and component image files for the fields of interest. These files are written by the inForm export step.
+The composite images are shown as the background of the nearest neighbor visualizations. The colors and components shown are determined by the inForm export settings.
+The component images are the source of metadata about fields that is needed to properly places cells in the visualizations.
+Choose “Spatial map viewer” from the RStudio Addins menu to start the viewer.
+The viewer’s initial screen allows you to select the nearest neighbor file and inForm export directory containing the fields of interest.
+First, click the “Browse input” button and select the nearest_neighbors.csv
file created by the analysis addin.
Next, click the second “Browse” button and select the inForm output directory corresponding with the nearest neighbors file.
Finally, click “Open Viewer” to start the viewer.
The nearest neighbor viewer allows you to
+Select and color phenotypes In this section, select the two phenotypes of interest and the colors to use to display the phenotypes. Important! Only single phenotypes are supported. Double-positive phenotypes may not be used here.
Select a field to view Use the dropdown to select a particular field, or use the Previous and Next buttons to browse through all the fields.
Select the type of nearest neighbor relationship “Nearest neighbor” is not a symmetric relationship—cell A may have a nearest neighbor B, whose nearest neighbor is not A. Try the different settings to find the one you want.
Control the dot size This slider controls the size of the dots displaying the cells. You may want to make the dots smaller before saving images.
Save a single view or views for all fields The “Save image” button will save the currently displayed image in your browser’s Download folder. The “Save all” button will use the current settings to save a zip file containing images of all fields in the experiment.
vignettes/unmixing_quality_report.Rmd
unmixing_quality_report.Rmd
Kent S Johnson. Author, maintainer.
+Carla Coltharp. Contributor. +
+Akoya Biosciences. Copyright holder.
diff --git a/docs/index.html b/docs/index.html index 12e2f60..bd6b6a4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -30,7 +30,7 @@ @@ -55,6 +55,9 @@phenoptrReports
generates reports based on data created by Akoya Biosciences’ inForm® software.
The “Merge cell seg files” application merges inForm data files from individual fields to create “Merge” data files. This is similar to the inForm Merge tab but does not include the ability to review and reject individual fields.
-The consolidation and analysis applications in phenoptrReports
use merged data files to analyze cell phenotype and expression data created by inForm. They use data from multiple inForm projects to aggregate phenoype counts, density, mean expression and H-Score for each slide and tissue category in an experiment.
For each analysis, the applications create
-The unmixing quality report analyzes unmixed, singleplex images to help evaluate staining and unmixing quality. This report shows crosstalk between components and highlights potential problem areas in assay development.
-The component levels report analyzes unmixed, multiplex images to help evaluate staining levels for an entire experiment. This report shows the distribution of signal and dark pixels for all components.
-phenoptrReports
is part of the Akoya Biosciences Phenoptics™ family of Quantitative Pathology Research Solutions. For more information visit the Phenoptics™ home page.
phenoptrReports
generates reports and visualizations based on data created by Akoya Biosciences’ inForm® software.
phenoptrReports
is part of the Akoya Biosciences Phenoptics™ family of Quantitative Pathology Research Solutions. For more information visit the Phenoptics™ home page.
phenoptrReports
requires the R environment for statistical computing, version 3.5.0 or higher. To install R, visit the R download page.
The analysis apps in phenoptrReports
run as “Addins” to the RStudio IDE, which must also be installed.
phenoptrReports
from GitHub. In the RStudio console, copy and paste or type these commands (press Enter after each line):install.packages("devtools")
-devtools::install_github("akoyabio/phenoptrReports")
-1
(Yes) to install BiocInstaller.phenoptrReports
uses the Akoya Biosciences phenoptr
package for much of its functionality. Please follow the phenoptr
installation instructions, including the optional installations, before installing phenoptrReports
.
Next, install phenoptrReports
from GitHub. In the RStudio console, copy and paste or type this command:
devtools::install_github("akoyabio/phenoptrReports")
phenoptrReports
functionality is provided via RStudio Addins. These are small applications accessed via the “Addins” menu in the RStudio IDE.
Use the “Merge cell seg files” addin to merge inForm data from individual fields into “Merge” data files. This is similar to the function of the inForm Merge tab and should be used only when the inForm Merge is not available.
+Merge data from individual fields +The Merge cell seg files addin merges inForm data files from individual fields to create “Merge” data files. This is similar to the inForm Merge tab but does not include the ability to review and reject individual fields. Use this addin if you are not able to merge in inForm for any reason.
+This addin allows you to select an inForm export directory containing data files for individual fields. It creates merge data files combining data for all fields.
A phenoptrReports
data analysis has two major steps - data consolidation and data aggregation. Start the consolidation step by selecting Consolidate and summarize from the RStudio Addins menu.
The consolidation step combines the output from multiple inForm projects into a single consolidated data file, creating columns for each individual phenotype. The inputs to this step are merged cell seg data files created by inForm. The output is a consolidated data file and a summary report for each file.
-Run the consolidation step even if your data comes from a single inForm project. This creates a data file in the format that the analysis step uses.
-For detailed instructions and requirements, see the Consolidating inForm data tutorial.
+Consolidate merged data to a single file +The Consolidate and summarize addin combines the output from multiple inForm projects into a single consolidated data file, creating columns for each individual phenotype. The inputs to this addin are merged cell seg data files created by inForm. The output is a consolidated data file and a summary report for each file.
+Run the consolidation addin even if your data comes from a single inForm project. This creates a data file in the format that the analysis addin uses.
+For detailed instructions and requirements, see the Consolidating inForm data tutorial.
The analysis step has three parts:
+The Analyze consolidated data addin reads data produced by the consolidation addin. It aggregates phenoype counts, density, mean expression and H-Score for each slide and tissue category in an experiment and can also report on nearest neighbors and count cells within a radius.
+This addin creates
+The analysis addin has three parts:
The most important input file is the consolidated data file from the consolidation step. Selecting a summary cell seg data file enables density calculations; selecting a score data file enables H-Score calculation.
+The most important input file is the consolidated data file from the consolidation addin. Selecting a summary cell seg data file enables density calculations; selecting a score data file enables H-Score calculation.
To define the analysis, you select tissue categories, phenotypes, and markers of interest.
To create the final reports, the analysis app writes and runs an R script. The script computes the aggregated statistics, writes them to an Excel workbook, and creates visualizations of the results in a Word document.
-For detailed instructions and requirements, see the Analyzing inForm data tutorial.
+For detailed instructions and requirements, see the Analyzing inForm data tutorial.
For more information about the unmixing quality report, see the Unmixing quality report tutorial.
+Visualization of spatial relationships +The Spatial map viewer addin creates visualizations of nearest neighbors of selected phenotypes within individual fields. The visualizations can be saved for use in other applications.
+The spatial map viewer requires a nearest_neighbors.csv
file created by the analysis addin and in inForm export folder containing composite and component images.
For detailed instructions and requirements, see the Visualizing spatial relationships tutorial.
+The Unmixing quality report addin analyzes unmixed, singleplex images to help evaluate staining and unmixing quality. This report shows crosstalk between components and highlights potential problem areas in assay development.
+For more information about the unmixing quality report, see the Unmixing quality report tutorial.
+NEWS.md
2019-06-18
+Spatial map viewer addin:
+Analysis addin:
+~`Membrane PDL1 (Opal 520) Mean`>5
.Bug fixes:
+R/spatial_map_viewer_addin.R
+ addin_35_spatial_map_viewer.Rd
This function starts a GUI which allows you to select a nearest neighbors +file and an inForm export directory. Once selected, you can view fields +in the export directory superimposed with a map of nearest neighbor +relationships.
+ +addin_35_spatial_map_viewer()
+
+
+ Spatial map viewer addin
Make a nearest neighbor map for a single field
Order a data frame by slide ID and tissue category, putting the categories in the given order and the "Total" category in the proper place.
Run the spatial map viewer with the given nearest neighbor +file and export directory.
R/spatial_maps.R
+ nearest_neighbor_map.Rd
The phenotype definitions may be NA, in which case the base field +will be shown with any available phenotype.
+ +nearest_neighbor_map(csd, field, export_path, pheno1, pheno2, color1, + color2, show_as = c("from_to", "to_from", "mutual", "none"), + dot_size = 3, add_logo = TRUE)+ +
csd | +Cell seg data with distance columns |
+
---|---|
field | +Sample Name or Annotation ID to map |
+
export_path | +Path to a directory containing composite and component +image files from inForm |
+
pheno1, pheno2 | +Phenotype definitions |
+
color1, color2 | +Colors to draw the phenotype dots |
+
show_as | +Which nearest neighbors should be shown? |
+
dot_size | +Size of the dots used to show phenotypes |
+
add_logo | +Show the Akoya logo in the image? |
+
A ggplot object
+ +Note: Only single phenotypes are supported.
+ + +R/spatial_map_viewer_addin.R
+ spatial_map_viewer.Rd
See addin_35_spatial_map_viewer()
+for a GUI front-end to this function.
spatial_map_viewer(nn_path, export_path)+ +
nn_path | +Path to a nearest_neighbors.csv file created by the +analysis app. |
+
---|---|
export_path | +Path to a directory containing composite and +component images for the fields in the nearest neighbors file. |
+
None; starts the viewer app
+ + +R/spatial_map_viewer_addin.R
+ spatial_map_viewer_front_end.Rd
Request input file and directory for the viewer, then launch the viewer
+ +spatial_map_viewer_front_end()
+
+
+