Releases: PixelgenTechnologies/pixelatorR
v0.18.2
v0.18.1
Fixes
- Fixed a bug in the
tbl_lazymethod forProximityScoresToAssaywhere the proximity scores were incorrectly mapped to protein pairs and components.
Changes
- Removed option
return_sparsefromProximityScoresToAssay(tbl_lazyanddata.framemethods). These methods now always return a sparse matrix (dgCMatrix). - Removed option
missing_obsfromProximityScoresToAssay. Missing observations are now set to 0. - Added option
lazytoProximityScoresToAssay(PNAAssayandSeuratmethods) to enable lazy evaluation of proximity scores.
v0.18.0
Added
layout_with_coarsened_pmdslayout method for faster and more accurate PNA cell graph layouts.ComputeProximityScoresmethods to compute global proximity scores for cell graphs. The method also enables computing proximity scores for k > 1 neighborhoods (lower spatial resolution), but this option is limited to log2 ratios (no Z scores).heuristic_illuminationto approximate natural illumination of a 3D layout.- Illumination masking option in
render_rotating_layoutto modulatenode_valcolors with a heuristic illumination mask. - Shadow palette blending in
render_rotating_layoutviaillumination_shadow_colorsfor palette-based shadow interpolation. normalize_illuminationargument inrender_rotating_layoutto optionally disable rescaling of the illumination mask to[0, 1].- "NaturalBlue" option as a gradient palette in
PixelgenGradientto use as a natural illuminated color gradient.
Updated
- Changed the default proximity score in
ProximityScoresToAssayfrom "join_count_z" to "log2_ratio" ProximityScoresToAssaynow takes aseparatorargument to specify the character used to separate marker names. The default separator is changed from/to:to avoid misinterpretation of marker names containing/.approximate_node_saturation,approximate_edge_saturationandapproximate_saturation_curvenow uses the standard definition of saturation (s = 1 - molecules / reads).ReadPNA_Seuratwill now throw an informative error when reading a file with only a single cell, which would otherwise throw a cryptic error when trying to create the Seurat object.
Fixes
- Fixed a bug in
SummarizeProximityScoreswhere theinclude_missing_obsargument was not properly handled wheninclude_missing_obs = FALSE. - Added an explicit error message in
SummarizeProximityScoresfor when there are duplicate rows in the input Proximity Score table.
v0.17.1
Updated
- Added scaling to
isotype_plsand changed defaultlayerto "data" to avoid issues where some markers are missing from the "scale.data"layer. render_rotating_layoutnow acceptsmax_degreedown to 0 degrees instead of 90 degrees as a minimum.
Fixes
- Fixed a bug where running
AnnotateCells(..., method = "nmf")could unintentionally propagate normalization changes from an internal temporarySeuratobject to the returned object. - Fixed a bug in
render_rotating_layoutto explicitly usegraphics::layoutto avoid an error being triggered when havingplotlyloaded.
v0.17.0
Added
- Added
CalculateDispersionmethod for calculating dispersion of counts across features and cells. Currently "tau" and "gini" dispersion metrics are supported. This method is useful for identifying outliers in the count data, for example to identify cells with an unusual count distribution across markers. - Added a new gradient color palette "BluesGrayCherry" to
PixelgenGradient.
Fixes
- Fixed bug in
FSMap<-when handling Seurat objects multiple PNA/MPX assays. Previously, FSMap would only update the active assay. Now, the Seurat object is scanned for all PNA/MPX assays and updates them withvalue. - Fixed a bug in
SequenceSaturationCurvethat would throw an error when there areint64columns in the edgelist.
v0.16.0
Updated
- Added option to ignore low transition probability edges in
expand_adjacency_matrixwhenuse_weights = TRUE. - Switched to using svds from RSpectra to compute MDS in
layout_with_weighted_pmdsfor a performance boost - Switched to using pattern matrix representation of the adjacency matrix in
expand_adjacency_matrixfor a performance boost
Added
- Added reference PBMC dataset and load function
read_pbmc_referencethat can be used for annotation. - Added
isotype_plsto calculate isotype background score. - Added
export_plotutility function to export ggplot objects to file. - Added
create_discrete_paletteto create palettes to color different samples or conditions. - Added
Pixelgen_cell_palette, a named vector of colors assigned to cell types.
Fixes
- Fixed bug in
SequenceSaturationCurvewhere the node saturation would be calculated as1 - graph_proteins / (2 * graph_reads)instead of1 - graph_proteins / graph_reads. - DuckDB temporary directory can now be set with
PIXELATOR_DUCKDB_TEMP_DIR - Fixed bug in
render_rotating_layoutwhencenter_zero = TRUEand the most extreme values were negative. Now the color scale should be centered properly.
v0.15.0
Added
-
new sequencing saturation and graph stability functions.
approximate_edge_saturationcomputes edge saturation for components in a PXL fileapproximate_node_saturationcomputes node saturation for components in a PXL fileapproximate_saturation_curvecomputes node/edge saturation for downsampled components in a PXL filedownsample_to_parquetdownsamples the edgelist in a PXL file and exports these edgelists to parquet fileslcc_sizescomputes the largest connected components for cell components in downsampled edgeslists (parquet files)lcc_curvecomputes LCC for downsampled components in a PXL file using theduckpgqDuckDB extension
-
sequencing_saturationandSequenceSaturationCurveto compute sequencing saturation statistics from an edgelist. -
Updated
-
approximate_edge_saturationandapproximate_node_saturationnow accepts acomponentsargument for filtering. -
Added an argument
unionto control whether tables of lazy tables should be joined or output as a list in.lazy_load_tableandEdgelists. -
AnnotateCellsnow returns columns named exactly asreference_groups
Fixed
- Fixed a bug in
.lazy_load_tablethat prevented lazy loading of tables.
v0.14.0
Added
- Supervised patch detection implemented in the
patch_detectionfunction. Addedidentify_markers_for_patch_analysisto identify markers for patch analysis. render_rotating_layoutfunction to create videos of rotating cells from a tibble containing layout coordinates. The function supports multiple video formats but uses GIF as default.subsetmethod forCellGraphclass- Option to add marker count proportions to the proximity score table in
ProximityScores pack_2bitsandunpack_2bitsto pack and unpack DNA sequences into 64-bit integers using 2 bits per base.- Experimental
PredictDoubletsfunction for detecting doublets in a Seurat object or count matrix. SimulateDoubletsto simulate doublets.FindAnnoyNeighborsComputes nearest neighbors using the Annoy algorithm.DensityScatterPlotnow has an argumentequal_axesto control whether the x and y axes should have a common range.return_idargument toSimulateDoubletsto output the IDs of cells used to simulate each doublet.
Fixes
- Fixed bug in
ColocalizationHeatmapwheremarker1_colandmarker2_colonly worked for "marker_1" and "marker_2". - Fixed bug in
DensityScatterPlotwhere the % cells label would be calculated across all facets instead of per each facet.
v0.13.0
pixelatorR 0.13.0 
This release introduces a suite of powerful new features designed to streamline the loading, processing, analysis, and visualization of Proximity Network Assay (PNA) data. Central to this update is the introduction of the PixelDB R6 class, providing a robust interface for interacting with the newly supported PXL file format. We've included specialized functions for reading data directly from PXL files into R. Furthermore, two new assay classes have been developed specifically to represent PNA data effectively within the Seurat analysis framework. These core components are complemented by a wide range of new methods and enhancements across the analysis pipeline. See below for a detailed list of additions and modifications.
Added
PixelDBR6 class to access data from a PXL file (<pxl_file>) containing a duckdb database.PixelDB$newcreate a newPixelDBobject from a PXL file containing PNA data.PixelDB$infoget information about the tables stored in the PXL file.PixelDB$querysend an SQL query to the database.PixelDB$check_connectioncheck if the connection to the PXL file is still valid.PixelDB$reconnectreconnect to the database if the connection is closed.PixelDB$namesget the names of the tables stored in the database.PixelDB$fetch_tablefetch an entire table as adata.frame.PixelDB$fetch_table_subsetfetch a subset of a table as adata.framePixelDB$countsfetch the antibody count matrix.PixelDB$proximityfetch the proximity scores table.PixelDB$cell_metafetch the component/cell meta data.PixelDB$protein_metafetch the protein meta data.PixelDB$run_metafetch the Pixelator run meta data.PixelDB$components_edgelistfetch the edgelist(s) for selected components/cells.PixelDB$components_layoutfetch the layout(s) for selected components/cells.PixelDB$components_marker_countsfetch the node counts for selected component/cell graphs.PixelDB$export_parquetexport a table in the database to a parquet file.PixelDB$closeclose the connection.
ReadPNA_countsfunction to load the count matrix from a PXL file containing PNA data.ReadPNA_proximityfunction to load the proximity scores table from a PXL file containing PNA data. Also supports lazy loading.ReadPNA_edgelistfunction to load the edgelist from a PXL file containing PNA data. Also supports lazy loading.ReadPNA_layoutsfunction to load component layouts from a PXL file containing PNA data with pre-computed layouts.ReadPNA_Seuratfunction to construct aSeuratobject from a PXL file containing PNA data.ReadPNA_metadatafunction to load sample meta data from a PXL file containing PNA data.PNAAssayclass to store PNA data in aSeuratobject (v3).CreatePNAAssayto create aPNAAssayobject.PNAAssay5class to store PNA data in aSeuratobject (v5).CreatePNAAssay5to create aPNAAssay5object.Edgelistsmethods forPNAAssay,PNAAssay5andSeuratto load edgelists. Supports lazy loading for manipulation withdbplyr.ProximityScoresmethods forPNAAssay,PNAAssay5andSeuratto fetch proximity scores. Supports lazy loading for manipulation withdbplyr.ProximityScores<-methods forPNAAssay,PNAAssay5andSeuratto set proximity scores.ProximityScoresToAssaymethods fordata.frame,tbl_lazy,PNAAssay,PNAAssay5andSeuratto convert the long formatted proximity score table into a wide format.LoadCellGraphsmethods for forPNAAssayandPNAAssay5.ComputeLayoutmethods for forPNAAssayandPNAAssay5.RemoveCellGraphsmethods for forPNAAssayandPNAAssay5.CellGraphsmethods for forPNAAssayandPNAAssay5.RestorePathsmethods for forPNAAssayandPNAAssay5.FSMap/FSMap<-methods forPNAAssayandPNAAssay5.showmethod forPNAAssayandPNAAssay5.subsetmethod forPNAAssayandPNAAssay5.mergemethod forPNAAssayandPNAAssay5.RenameCellsmethods forPNAAssayandPNAAssay5.JoinLayersmethod forPNAAssay5.as.PNAAssaymethod to convert anAssayobject to aPNAAssayobject.as.PNAAssay5method to convert anAssay5object to aPNAAssay5object.DifferentialProximityAnalysisfunction to perform differential testing on PNA proximity scores. The function has a similar API asRunDAA,RunDPAandRunDCAbut uses a much faster implementation of the Wilcoxon rank sum test (Mann-Whitney U test) with thedata.tableR package.- A minimal PXL file woth PNA data.
minimal_mpx_pxl_filefunction to get the path to the minimal MPX PXL file.minimal_mpx_pna_filefunction to get the path to the minimal PNA PXL file.- Utility function for asserting valid colors;
assert_valid_color. - Utility function for asserting valid
PNAAssay/PNAAssay5;assert_pna_assay. - Utility function for asserting valid
PNAAssay/PNAAssay5/CellGraphAssay/CellGraphAssay5;assert_pna_assay.
Updates
MoleculeRankPlotnow supports Seurat objects with PNA data withn_umirepresenting the total number of detected antibodies.TauPlotnow supports Seurat objects with PNA data usingn_umion the y-axis.Plot2DGraphnow supports Seurat objects with PNA data.Plot2DGraphMnow supports Seurat objects with PNA data.Plot3DGraphnow supports Seurat objects with PNA data.DensityScatterPlotcan now drawrectangleorquadrantgates by selecting the appropriategate_typeargument. Additionally, gate annotation aesthetics can now be customized usingannotation_params.
Changes
ComputeLayoutnow only supports the "pmds" and "wpmds" graph drawing methods. The "kk", "fr" and "drl" methods have been removed but can be run if needed using thecustom_layout_functionparameter. The default layout method is now "wpmds" withdim = 3.NormalizeMPXis superseded byNormalize. TheNormalizeMPXfunction will be removed in a future release.
Removed
LoadCellGraphs.data.framemethod
Fixes
- Fixed bug in
DensityScatterPlotwhere thegate_typedefault would lead to an error. - Fixed bug in
DensityScatterPlotwhere the x- and y-axis titles were hardcoded as "Marker1" and "Marker2" - Fixed bug in
subset.MPXAssayandsubset.PNAAssaywhere thefs_maptable was not filtered correctly when all components from a sample are removed.
v0.12.0
Added
RunDAA: Differential abundance analysis function with a similar interface toRunDPAandRunDCA.RunDAAuses theFindMarkersfunction from Seurat to perform differential abundance analysis, but enables splitting of tests into multiple groups. By default, it reports the difference in means instead ofavg_log2FC.
Updates
- Updated type assertions and improved error messaging (inspired by the tidyverse style guide).
- The
ComputeLayout.Seuratmethod now supports parallelized computation of layouts. - Added option to fetch marker counts in
PolarizationScoresandColocalizationScoresmethods. This is for example useful when filtering spatial metrics tables for markers with low counts. - Silenced warnings in
RunDPA/RunDCAwhen running tests in parallel to avoid halting the R session. - Improved clean up of temporary files created by
ReadMPX_countsandReadMPX_item. RunDPAandRunDCAnow accepts any numeric vector from the spatial metric table as input for differential testing. The metric is specified bypolarity_metric(RunDPA) orcoloc_metric(RunDCA).- Updated
subsetandmergemethods forMPXAssayto have less stringent validation of the spatial metric tables (polarity and colocalization scores). - Updated
ReadMPX_Seuratto have less stringent validation of the spatial metric tables (polarity and colocalization scores). ColocalizationHeatmapnow allows legend titles and the legend range to be manually set
Fixes
- pixelatorR read functions now uses
utils::unzipinstead ofzip::unzipto support PXL files larger than 2GB LoadCellGraphsnow throws an error if duplicated cell ids (cells) are provided- PXL files missing spatial scores can now be loaded with
ReadMPX_Seuratwithout throwing an error. This is useful when the pixelator pipeline was run without computing spatial scores.