Changes in version 2.0.0 Statistical corrections o leviSingleCellInteractionTFCE() now tests per-donor interaction contrasts, (stim - ctrl) in a cell type minus (stim - ctrl) in the reference type, with a limma-trend one-sample moderated t and a within-donor sign-flip null. The previous refit of ~ donor + type * condition on swapped labels was valid only under the global null: with a shared condition effect and no interaction it rejected in 85% of null data sets (now 3%, attainable level 3.1%). Cell types are aligned on their shared genes before the contrasts are formed; stacking matrices filtered per type had mixed genes across rows or aborted. o leviBulkGraphInference() refits the whole DESeq2 pipeline in every permutation by default (refit_dispersions = TRUE). Keeping the label-dependent size factors and dispersions fixed gave a family-wise error rate about three times the attainable level; that mode now warns that it has no level guarantee. Cook-outlier replacement is switched off so that observed and permuted fits use the same pipeline. o leviGraphMoran() computes local P-values by conditional permutation (each node keeps its own score; its neighbours are drawn from the other scores), as in spdep and GeoDa, and centres the two-sided P-values on the null expectations. Total permutation called an isolated outlier with iid neighbours significant in about half of null data sets. o Documentation of the node-label and rewiring tests (levi(), leviGraphGetisOrd(), leviGraphSpectrum(), leviGraphWeightedTopology(), leviGraphRewiringInference(), leviGraphTFCERewiring()) states that their nulls treat scores as exchangeable over nodes and reject under co-expression or degree association without any condition effect. Behaviour changes (these alter landscapes and regional P-values) o Nodes without a measurement have weight zero in the landscape, and so do the edge midpoints that touch them. They used to enter the average at the neutral value with full weight, which pulled the surface to "no change" around every unmeasured gene. Unmeasured parts of the network now drop out of the average and out of the silhouette; the weights are the same in every permutation, and the result stores them in $metadata$support_weights. The effect grows with the share of missing nodes; a complete expression table gives the same result as before. o Reciprocal edges (A-B and B-A) and self-loops count once in the landscape, as they already did in the graph tests. A network file that lists both directions no longer puts two support points on each edge midpoint. o leviFromEdges() scales both axes of the layout with one factor, so the aspect ratio of the layout is kept. Each axis used to be stretched to [1, 100] on its own, which made every layout square. Landscapes of networks laid out by leviFromEdges() change; shipped files are unaffected. o The peak of a region (PeakRow, PeakCol) is the first cell within 1e-9 of the extreme score. It was the first cell with the exact extreme, which on a plateau depended on the last bit of the surface and differed between x86_64 and arm64. The peak score, mass and P-values are unchanged; the peak cell of a region on a plateau can move. o The thresholds of the C++ TFCE are computed without fused multiply-add, so that it agrees with the R reference on arm64. o permutation_method = "auto" no longer exceeds n_perm. It enumerates every label assignment only when that takes at most n_perm permutations (and at most max_exact); otherwise it draws n_perm Monte Carlo permutations. It used to enumerate up to max_exact assignments whatever n_perm said, so an 8 vs 8 design with n_perm = 99 ran 12,869 permutations. With the default n_perm = 999, designs with more than 1,000 assignments (7 vs 7 and larger) are now sampled; use permutation_method = "exact" for the full enumeration. New options (default behaviour and P-values unchanged) o levi(region_statistic = "standardised") measures a region on the landscape standardised by its standard deviation under node-label permutation, computed analytically from the layout and the weights (landscape_null_scale(); it matches the permutation value to within a few per cent). A fixed excess over 0.5 favours sparse parts of the network, where the null surface varies most. The threshold is then in standard deviations (default 2), mass and PeakScore are on the 0.5 + Z scale, and the same field is used by the node-label and sample-label tests. The default, "excess", is unchanged; the displayed landscape is the same either way. o leviGraphSpectrum() and leviGraphWeightedTopology() take 'strata' (NULL, "degree" or one value per node) to permute scores within groups of nodes, for example degree bins, as an approximation to removing the dependence of the score on degree. leviGraphMoran(), leviGraphGetisOrd(), leviGraphSpectrum() and leviGraphWeightedTopology() warn (class "levi_degree_warning") when the scores correlate with log degree. o leviGraphSpectrum() adds DegreeNormalisedEnergy and its P-value, the Rayleigh quotient of the normalised Laplacian. The plain EnergyP is the same test as Geary's C (the sum of squared scores does not change under permutation); the degree-normalised version is not. o levi(bandwidth_edges = ) sets the kernel width as a multiple of the median edge length, independent of the network and of the zoom; smoothValueInput is ignored when it is given. The default keeps the slider. o The graph and pseudobulk tests take 'sig_level' (default 0.05) for their Significant and GlobalSignificant flags; it also feeds the warning about the smallest attainable P-value. It does not change any P-value. o leviGraphMoran() and leviGraphGetisOrd() warn, with the condition class "levi_resolution_warning", when n_perm is too small for BH across the nodes to declare a single node significant. o leviGraphGetisOrd() adds PConditional and PConditionalAdjusted, a conditional-permutation P-value that keeps the node's own score fixed like the local Moran (the unconditional P rejected 11% of extreme nodes under an iid null, the conditional one 4%). The node-wise tests carry a 'Null' column naming the permutation null. o leviGraphTFCEInference(), leviGraphTFCEFreedmanLane(), leviGraphClusterInference(), leviBulkGraphInference() and leviReplicateInference() warn (class "levi_group_order_warning") when 'test' and 'control' are taken from the order in which the group labels appear, and the first four store them in the result as $test and $control. o leviFromDESeq2(value = "stat") and leviFromLimma(value = "t") carry the Wald or moderated t-statistic instead of the fold change. o levi() stores $metadata$diagnostics: number of components, share of nodes in the largest one, diameter, median edge length, the kernel width in edge lengths and the share of the grid inside the silhouette. Performance (results unchanged) o The graph TFCE statistic runs in C++ with union-find components (src/tfce.cpp), 25 to 40 times faster on a 1,000-node graph and equal to the plain-R version (kept as .tfceR() for the tests) to a relative 4e-16. o The permutation loops of levi(), leviReplicateInference() and leviSingleCellRegionalInference() compute the combined-signal landscape with the smoothed occupancy cached (landscape_occupancy() and landscape_m1()): one blur per draw instead of four, bit-identical to landscape_gauss(). levi() with n_perm = 200 on the 30-node medusa network at resolution 100 went from 46 s to 8 s with identical p-values and the same random-number stream. o The maximum regional mass of every null draw is found in C++ (src/region_mass.cpp; the R version stays as .maximumRegionMassR()). o leviBulkGraphInference() estimates the size factors once, reads the Wald statistic from the fitted coefficients and silences DESeq2's per-permutation messages: about 20% faster with identical statistics and p-values. o leviGraphMoran() and leviGraphGetisOrd() fold the null into running counts in blocks of 250 draws instead of keeping a draws x nodes matrix, so memory no longer grows with n_perm (identical P-values). o The C++ entry points skip the random-number scope, and the shared library registers its routines (useDynLib(levi, .registration = TRUE)). o tests/testthat/test_characterization.R compares the landscape and regional results of levi() on the hub and medusa networks with stored values (tolerance 1e-8). Bug fixes o leviFromLimma() no longer defaults to the first coefficient, which in a ~ group design is the intercept. 'coef' is required when the fit has several coefficients, and an intercept is refused. o leviFromSE() accepts sparse (dgCMatrix) and DelayedArray assays (MatrixGenerics is now imported). An 'assay_name' that does not exist and duplicated gene names are errors instead of a silent fallback to the first assay. Averaging the raw "counts" assay warns that the Test/Control ratio then depends on sequencing depth. o leviFromSeurat() now warns, rather than prints a message, that FindMarkers() statistics are cell-level. o The graph and pseudobulk inference functions (leviGraphTFCEInference(), leviGraphTFCEFreedmanLane(), leviBulkGraphInference() and the leviSingleCell*() functions) stop with a clear message when the expression has no gene in common with the network, has duplicated gene names, or 'test'/'control' are not levels of 'groups'. They used to return zeros with one warning per permutation or fail inside limma. o The package license is GPL (>= 2), as stated in DESCRIPTION; the stray LICENSE.txt (Apache-2.0) was removed. limma and edgeR, which the adapters call, are now in Imports. o The ALL examples in the vignettes collapse the B/T subtypes, map probe sets to gene symbols and select a coefficient by name. o Graph tests stop with an informative error for unnamed scores, fewer than three matched nodes, an invalid n_perm or an unknown fileTypeInput (case is now ignored). In the graph tests (TFCE, Moran, Getis-Ord, rewiring) reciprocal edges (A-B and B-A) are counted once, and so they are in the landscape (see Behaviour changes). o leviEnrich(), leviRegionGenes() and leviDiff() explain how to pick one result when given the list that levi() returns for several comparisons. print() of a result no longer fails when both regional and cell-wise P-values are present. o Permutation P-values are counted by binary search on the sorted null (same values; memory O(n) instead of O(n x nodes)). o Vignette HTML files and tests/testthat/Rplots.pdf are excluded from the build. Changes in version 1.99.4 Bug fixes o Pseudobulk preserves grouping labels containing delimiters and gives count columns unique names. Missing grouping labels are rejected. o Calibration includes datasets without regions as non-rejections in error rates and power; saved summaries use the corrected denominators. o Degree-weighting documentation no longer claims unit incident sums. o The Shiny camera observer waits for an actual relayout event before reading Plotly event data, avoiding warnings before 3D is rendered. Changes in version 1.99.0 Overview o This is the Bioconductor devel version of the rewritten package; it will be released as levi 2.0.0. The landscape core was rebuilt, an inference layer with permutation tests was added, the Shiny interface now shares every computation with script mode, and adapters bring data in from the main Bioconductor and single-cell workflows. Landscape core o The landscape is computed as a Gaussian-kernel weighted average (normalised convolution) instead of an unweighted mean over the k nearest points. Every landscape value is a convex combination of the input signals and lies within their range; data with no variation gives the neutral value 0.5 at any smoothing and any network density. o The previous implementation injected a zero-signal point at every background grid cell, which divided the landscape amplitude by k (about 11% of the colour scale at the default smoothing), put result$scores off the documented [0, 1] scale and made peaks unreachable on sparse networks. All ten Expected results assertions of the bundled toy datasets now pass (three passed before). o The network silhouette is carried by the sum of kernel weights. Cells outside the network return NA and are drawn in a background colour, so "no network here" and "network present, minimal expression" are no longer the same value. o The kernel is separable, so the convolution runs as two 1-D passes. medusa.dat at resolution 135 went from 28.5 s to about 12 ms and the cost no longer grows with network size. o New argument edge_weighting in levi(): "midpoint" (default) keeps the historical deposit of one support point per edge midpoint, "degree" weights the midpoint of edge (i, j) by (1/d_i + 1/d_j)/2, reducing their influence relative to unit weights, and "none" smooths the node values alone. The choice and the weights are recorded in the result metadata and reused by the sample-label null. o The grid always leaves room for the smoothed silhouette. The margin used to be the zoom alone, while the kernel carries occupancy about 20% beyond the outermost node, so landscapes were clipped wherever a node sat near the border. zoomValueInput now adds up to 20% on top of a frame that fits the silhouette (0 = widest, 100 = tightest). o contrastValueInput and smoothValueInput keep their 0-100 range but now set the occupancy threshold of the silhouette and the Gaussian width in grid cells. The width is scaled to resolutionValueInput, so changing the resolution no longer changes the apparent smoothing, and smoothing no longer changes the value scale. o The same transformed signal feeds the surface, the scores, the peaks and the tests. Ratio scores keep the absolute Test/(Test+Control) scale; the old max() normalisation of the per-condition matrices was dropped. o SigCoordPiso(), matrix_entrada() and matrix_saida() were replaced by landscape_gauss(); nearest_node_grid() labels each grid cell with its closest node. Signal modes and input guards o New argument signal_mode: "ratio" (default) for counts, TPM, FPKM and linear proteomics; "logfc" (sigmoid of the log fold change, with steepness logfc_k) for RMA microarray, VST/rlog and single-cell avg_log2FC; "zscore" for multi-condition or heterogeneous-scale data. Single-column logFC input uses readExpColumn("logFC-logFC") with signal_mode = "logfc". o expressionLog back-transforms from log2 only in ratio mode; in the other modes it is ignored with a message, because log-scale data must stay in log2 for the fold change. o Ratio mode warns when the expression data contain negative values, which invert the landscape; Test + Control == 0 is reported and set to the neutral score instead of escaping as Inf. o The [0, 1] range of LandscapeScore is enforced for every signal mode in one place and fixed by a test. o Duplicated identifiers are still averaged, but the number collapsed is reported; a warning is raised when no identifier of the network matches the expression data, and a message states how many nodes have no expression value. o expressionInput accepts a data.frame or matrix as well as a file path, and the stg branch accepts in-memory node and edge tables. o The error for a missing expression column now reads "Column not found in the expression data". Result object, scores, peaks and regions o levi() returns an object of class "levi_result" with a print() method summarising the comparison, the scored nodes, the score range, the strongest and weakest genes, the peaks and valleys and whether a permutation test ran. The fields are unchanged, so result$scores and the rest keep working. o result$scores ranks every gene by LandscapeScore in [0, 1]; result$peaks lists local maxima and minima with the nearest gene, matrix position and score. o Explicit eight-connected landscape regions with direction, area, mass, peak, centroid and member cells. Without permutations they remain descriptive; with them they carry regional p-values. o Result provenance is recorded and leviDiff() rejects incompatible comparisons. Inference layer o Permutation test in levi() with n_perm, sig_level and perm_side ("both", "over", "under"). result$pvalues holds $over and $under matrices; 2D figures overlay the sig_level contours, dashed for over-expression and dotted for under-expression, and the 3D surface traces the same boundary. o inference_unit = "region" (now the default) runs a maximum excess-mass permutation test over eight-connected regions in both directions, keeps the null maxima, reports a spatial p-value per region and draws regional boundaries. inference_unit = "cell" keeps the legacy per-cell test, which the Shiny contours still use. Both directional families are adjusted jointly (BY by default) and the raw p-values remain available. o Node-label permutations shuffle only the signals, never the coordinates, so the silhouette and the denominator are computed once. p-values use (k+1)/(n+1), so none is reported as exactly 0. Optional perm_strata shuffles within bins of expression, detection rate or degree. o New leviReplicateInference(): regional maximum-mass inference by permuting biological sample labels, optionally within blocks. Regional figures label only the regions that pass sig_level. o New leviAdjustPathways() to correct regional results across a family of pathway networks, and leviRegionGenes() to rank the genes that contribute to a region. o New graph statistics on the network itself: leviGraphMoran() (global and local autocorrelation from the same permutations, with BH-adjusted local p-values), leviGraphGetisOrd() (hotspots and coldspots with PTwoSided and PAdjusted; Significant uses the adjusted value), leviGraphSpectrum() (Laplacian smoothness and low-frequency energy; the eigenvector order was corrected and the decomposition is computed once) and leviGraphWeightedTopology(). o New sample-label graph tests: leviGraphClusterInference() for connected cluster mass, leviGraphTFCEInference() for threshold-free cluster enhancement, leviGraphTFCEFreedmanLane() for residual permutation under covariates, leviGraphRewiringInference() and leviGraphTFCERewiring() for degree-preserving rewiring nulls, and leviBulkGraphInference() on DESeq2 counts. o leviBulkGraphInference() keeps the observed size factors and dispersions fixed across permutations by default (refit_dispersions = FALSE) and uses one dispersion estimator for the observed statistic and every draw, falling back to gene-wise dispersions when the trend fit fails; the choice is returned as dispersion_estimator. o Single-cell pseudobulk tests: leviPseudobulk() aggregates counts per sample and cell type; leviSingleCellRegionalInference(), leviSingleCellGraphInference(), leviSingleCellTFCEInference(), leviSingleCellInteractionTFCE() and leviSingleCellTopologyInference() permute within donor. They use TMM-normalised log2 CPM and the limma-trend moderated t (normalize = "none" restores plain CPM) and drop genes with fewer than 10 counts in two pseudobulks before the fit, always keeping the network genes; the interaction coefficient is located by its exact design column name. o Graph TFCE builds the igraph object once per call and recomputes the components only when the set of nodes above the threshold changes, instead of rebuilding the graph at each of the 100 integration steps of every permutation. The single-cell TFCE example runs in under a second instead of about 6 s; results are identical. o All permutation tests share one engine with a BPPARAM argument. SerialParam is the default; MulticoreParam() and SnowParam() give identical results because all randomness stays in the calling process. Sparse adjacency matrices are used throughout (Matrix in Imports). o A warning states when a design cannot reach the significance level. Under exact enumeration of a design balanced within every block, swapping every label negates each statistic and the tests take their maximum over both directions, so arrangements come in tied pairs and the attainable floor is 2/n_possible, not 1/n_possible: 3 vs 3 unblocked (20 arrangements) has a floor of 0.10 and four paired donors (16) a floor of 0.125, and both now warn at alpha = 0.05. Monte Carlo draws keep the floor 1/(n_perm + 1). The floor is returned as p_floor beside exact and possible_permutations by leviReplicateInference() (in metadata), the graph cluster, TFCE, DESeq2 and single-cell tests; it applies to the joint p-values (PGlobal, PSpatial), while the per-direction POver and PUnder keep 1/n_possible. Arrangements are counted with choose() before enumeration, so unblocked designs with more than about 30 samples no longer abort. Blocks holding a single condition contribute one fixed arrangement instead of an error. o Global and per-direction p-values of the TFCE and graph-cluster tests count a null maximum within a relative 1e-12 of the observed value as a tie, as the regional test already did. Under exact enumeration the complement arrangement reproduces the observed statistic up to rounding, so these p-values no longer come out as 1/n or 2/n depending on BLAS rounding; the joint p-values are now at least 2/n_possible. o leviFromSeurat() states in a message and in its documentation that FindMarkers() output is cell-level and pseudoreplicated for donor-level inference: use it for visualisation and node-label tests, and run donor-level inference through leviPseudobulk() and the single-cell functions. o leviSingleCellRegionalInference() builds the null landscapes with the logfc_k passed through '...', as leviReplicateInference() does. The null used to be computed at logfc_k = 1 whatever the observed landscape used, so with logfc_k < 1 the null was steeper than the observed surface and the landscape PSpatial was conservative (and anti-conservative with logfc_k > 1); results at the default logfc_k = 1 are unchanged. Data adapters and network construction o leviFromDESeq2(), leviFromEdgeR(), leviFromLimma() and leviFromSeurat() convert differential expression tables to levi input; leviFromSE(), leviFromExpressionSet() and leviFromBioc() read SummarizedExperiment and ExpressionSet objects, selecting samples by name, index or colData condition. o leviFromSTRING() builds a network from the STRING database from a vector of gene symbols, and leviFromEdges() builds one from a plain edge list (data.frame, matrix or igraph graph), computing a layout with igraph (fr, kk, lgl, dh or circle) scaled to the range levi expects. Both share the same layout routine and report interactions dropped for a missing endpoint. o leviFromSTRING() returns one edge per interacting pair. STRING lists every interaction in both directions and the graph from STRINGdb carries two parallel edges per pair, so $edges, the "N edges" message and the layout saw every interaction twice. The landscape core and the graph tests already kept one support point per distinct edge row, and Kamada-Kawai layouts do not depend on edge multiplicity, so results built with layout = "kk" are unchanged; Fruchterman-Reingold layouts of STRING networks move, and edge counts reported from $edges halve. o Network parsers live in one place, one per format (dat, dyn, net, stg), and are shared by script mode and the interface. Comparison, enrichment and export helpers o leviGrid() arranges several results side by side (patchwork, cowplot or gridExtra); leviDiff() subtracts two landscapes cell by cell into a diverging map. o leviEnrich() runs GO and KEGG enrichment on the top and bottom genes of result$scores through clusterProfiler; the KEGG background identifier mapping was fixed. o plot3d draws an interactive plotly surface next to the 2D map, with the significance boundary when a test ran. New leviSave3D() writes it to html, png, jpeg, webp, svg, pdf or tiff from a chosen camera position. o Contour layers drop out-of-silhouette cells before stat_contour() and say when there is no curve to draw instead of warning. Shiny interface o The interface no longer compiles its own copy of the C++ core at startup and no longer keeps private copies of network parsing, the permutation test, the palettes or the figure. It calls the same routines as script mode, so no compiler is needed and the two paths cannot drift (they had: the same palette name gave different colours and the scale arrows sat at different heights). o The 2D landscape and the 3D surface are shown in two tabs; the gene, node score, peak and region tables are tabs of their own below the figure, each with a CSV download. "Genes" lists what was brushed on the map. The 3D tab has a "Download 3D (HTML)" button that keeps the rotated view, and the toolbar PNG export was raised to 1600 x 1200 at scale 2. o Settings tab exposes signal_mode, logfc_k, n_perm, perm_side, sig_level and a "Test unit" selector. The regional test runs by default and the significant regions are outlined and labelled as in script mode; a permutation progress bar reports each iteration. o Gene highlight accepts several genes, draws one circle per gene at its own grid cell and offers a colour selector; "Label peaks on map" overlays gene names at the detected peaks. o The interface could not compute anything under igraph >= 2.0 because a deprecation warning was caught as fatal and reported as "Incorrect file format". graph_from_edgelist() is used and warnings are shown as notifications while the computation continues; a file without a trailing newline is read instead of rejected. o tests/testthat/test_gui_parity.R drives the server with shiny::testServer and requires the same scores, surface and, under a fixed seed, the same p-values as script mode. Documentation, datasets and validation o Four vignettes: "levi" (introduction, workflow and every control of the interface, with new screenshots), "levi_guide" (Bioconductor data, adapters and STRING), "levi_inference" (which null answers which question, the p-value floor of small designs, BPPARAM and a reporting checklist) and "levi_validation" (type I error, power and layout sensitivity from offline simulations, plus the airway dexamethasone experiment). All vignettes cite their methods and data sources from a shared bibliography. o Twelve self-contained scripts in inst/scripts/ with a README, from first steps to degree weighting, calibration and the airway preprocessing; they run on the bundled data alone. o Toy datasets in inst/extdata/, each documented with expected results: hub, gradient, bimodal, flat, sparse, logfc and multi-comparison, beside the original medusa data, the airway summaries and the validation tables. o Real-data integration tests replay the analyses of the supplement (airway, GSE10072 and Kang 2018 on STRING and KEGG networks) and are skipped unless LEVI_INTEGRATION is set. o Every argument of the inference functions is documented and the examples run on the hub dataset. Examples that need objects the user must supply (a DESeq2, edgeR, limma or Seurat fit, a SummarizedExperiment, real gene symbols for STRING or org.Hs.eg.db) are marked \dontrun so R CMD check --as-cran passes. o Title, Description and biocViews describe the inference layer (RNASeq, GraphAndNetwork and StatisticalMethod added). NAMESPACE uses specific importFrom() directives; knitr, rmarkdown and BiocStyle moved to Suggests. Comments, test names and messages are all in English. Breaking changes o The argument geneSymbolnput of levi() was renamed geneSymbolInput. No alias is kept; positional calls are unaffected. o Every landscape changes with the new core, so figures produced with levi 1.x are not comparable to figures produced with this version. o inference_unit defaults to "region"; use inference_unit = "cell" for the former per-cell test. Bug fixes o Operator precedence in the DAT parser (3:(delimiter-1)). o C++ buffer overflow in the former matrix_saida() and matrixOutFun() when smoothValue >= h. o colorSet() returned inside an else block; duplicate coord_fixed() call; deprecated size aesthetic in annotate() segments. o Internal networkNodesInput renamed networkCoordinatesInput to match the public API. o edgeR test-object conversion, medusa validation on the linear ratio scale with a matched smoking category, and the ".logFC" title on replicate landscapes. Changes in version 1.0.0 Overview o First version of levi.