| Title: | A Toolset for the Functional Analysis and Interactive Visualization of Protein Complex Data |
|---|---|
| Description: | Provides a comprehensive workflow for the quality control, refinement, functional enrichment, and network-based analysis of protein complex datasets. ComplexMap allows for the quantitative evaluation of predicted complexes against a reference and provides an interactive Cytoscape.js-powered Shiny explorer to navigate the functional landscape of a protein complex map. |
| Authors: | Qingzhou Zhang [aut, cre] (ORCID: <https://orcid.org/0000-0001-9540-2624>) |
| Maintainer: | Qingzhou Zhang <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.0.0 |
| Built: | 2026-10-09 10:24:55 UTC |
| Source: | https://github.com/zqzneptune/ComplexMap |
Evaluates how different merging thresholds affect the quality AND diversity of the resulting complex map.
benchmarkParameters( complexList, referenceComplexes, threshold_range = seq(0.5, 1, by = 0.05), similarityMethod = "jaccard", ... )benchmarkParameters( complexList, referenceComplexes, threshold_range = seq(0.5, 1, by = 0.05), similarityMethod = "jaccard", ... )
complexList |
A list of predicted protein complexes to be refined. |
referenceComplexes |
A list of reference (gold standard) complexes. |
threshold_range |
Numeric vector of thresholds to test. Defaults to 'seq(0.5, 1.0, by = 0.05)'. |
similarityMethod |
The metric used for merging. Defaults to **"jaccard"**. |
... |
Additional arguments passed to 'refineComplexList' (e.g., minSize). |
**Systems Biology Rationale:** When optimizing the 'mergeThreshold', there is a trade-off between removing redundancy (increasing PPV) and losing specific variants (decreasing Sensitivity and Diversity).
This function returns the standard metrics (PPV, Sn, Acc, MMR) but also adds **NumComplexes**. - **Collapse Warning:** If 'NumComplexes' drops precipitously between two thresholds, you have likely crossed the point where distinct biological variants are being merged into generic blobs. - **Recommendation:** Choose the threshold that maximizes F1/MMR while maintaining a 'NumComplexes' count close to your expected biological complexity.
A 'tibble' with columns: - 'mergeThreshold': The threshold tested. - 'NumComplexes': Number of complexes remaining (Diversity metric). - 'PPV': Positive Predictive Value (Precision). - 'Sn': Sensitivity (Recall). - 'F1': Harmonic mean of PPV and Sn. - 'Acc': Accuracy (Geometric mean of PPV and Sn). - 'MMR': Maximum Matching Ratio.
Qingzhou Zhang <[email protected]>
Constructs a network of complexes where edges represent similarity.
buildComplexNetwork( complexes, enrichments, mode = "combined", similarityMethod = "jaccard", alpha = 0.75, nCores = NULL, chunkSize = 1000, verbose = TRUE )buildComplexNetwork( complexes, enrichments, mode = "combined", similarityMethod = "jaccard", alpha = 0.75, nCores = NULL, chunkSize = 1000, verbose = TRUE )
complexes |
A named list of protein complexes. |
enrichments |
A named list of enrichment results (from 'runComplexEnrichment'). |
mode |
Edge weight mode: "compositional", "functional", or "combined". Defaults to "combined". |
similarityMethod |
The metric for similarity. Defaults to **"jaccard"**. **Warning:** Using "overlap" is discouraged as it tends to collapse diverse hierarchies into single blobs. |
alpha |
Numeric (0-1). Weight given to Compositional Similarity in "combined" mode. Defaults to **0.75** (favoring physical structure). |
nCores |
Number of cores for parallel processing. |
chunkSize |
Size of processing chunks. |
verbose |
Logical. |
**Systems Biology Rationale:** To generate a diverse and physically meaningful landscape, this function defaults to prioritizing **Compositional Similarity** (shared proteins) over functional similarity.
- **Composition (Protein Identity)** is treated as the "Physical Truth". - **Function (Enrichment)** is treated as an attribute.
The 'alpha' parameter controls this balance. The new default (0.75) gives 75 (like "Cell Cycle") from artificially pulling distinct physical complexes into a single cluster, while still allowing functionally related complexes to drift closer than unrelated ones.
A 'tibble' of network edges with 'weight' representing the calculated similarity.
Qingzhou Zhang <[email protected]>
Calculates the 2D layout coordinates and key centrality metrics for a complex network. This function serves as the final step in preparing network data for visualization.
computeMapTopology(nodeAttributes, network, seed = 123, verbose = TRUE)computeMapTopology(nodeAttributes, network, seed = 123, verbose = TRUE)
nodeAttributes |
A 'tibble' or 'data.frame' containing attributes for each node (complex). Must contain a column with node identifiers that matches the source/target columns in the 'network' data. |
network |
A 'tibble' or 'data.frame' representing the network edges. Must contain columns for source, target, and edge 'weight'. |
seed |
Integer seed for reproducible layout. Defaults to '123'. |
verbose |
A logical value indicating whether to print progress messages. Defaults to 'TRUE'. |
This function takes a node attribute table and an edge list (network) and performs the following steps:
1. Constructs an 'igraph' graph object from the provided data.
2. Computes a force-directed layout using the Fruchterman-Reingold algorithm via 'igraph::layout_with_fr'. Edge weights are used to influence the layout, pulling strongly connected nodes closer together.
3. Calculates node centrality metrics:
- **Betweenness Centrality:** Measures how often a node lies on the shortest path between other nodes (normalized).
- **Degree Centrality:** The number of edges connected to a node.
4. Merges the layout coordinates and centrality scores back into the original node attribute table.
A 'tibble' containing all original columns from 'nodeAttributes' plus four new columns: 'x', 'y' (layout coordinates), 'betweenness', and 'degree'. The table is arranged in descending order of betweenness and degree.
Qingzhou Zhang <[email protected]>
'generateNodeAttributes()', 'buildComplexNetwork()'
# --- Sample Data --- # 1. Node attributes nodes <- tibble::tibble( complexId = c("Cpx1", "Cpx2", "Cpx3"), proteinCount = c(10, 8, 12) ) # 2. Network edges net <- tibble::tibble( source = c("Cpx1", "Cpx2"), target = c("Cpx2", "Cpx3"), weight = c(0.8, 0.6) ) # --- Compute Topology --- masterLayout <- computeMapTopology(nodes, net) print(masterLayout)# --- Sample Data --- # 1. Node attributes nodes <- tibble::tibble( complexId = c("Cpx1", "Cpx2", "Cpx3"), proteinCount = c(10, 8, 12) ) # 2. Network edges net <- tibble::tibble( source = c("Cpx1", "Cpx2"), target = c("Cpx2", "Cpx3"), weight = c(0.8, 0.6) ) # --- Compute Topology --- masterLayout <- computeMapTopology(nodes, net) print(masterLayout)
A high-level wrapper function that executes the entire 'ComplexMap' workflow. It takes a list of protein complexes and a gene set matrix (GMT) and performs refinement, enrichment, network construction, and topology calculation.
createComplexMap( complexList, gmt, similarityMethod = "jaccard", alpha = 0.75, ifRefineCpx = FALSE, layout_seed = 123, verbose = TRUE, ... )createComplexMap( complexList, gmt, similarityMethod = "jaccard", alpha = 0.75, ifRefineCpx = FALSE, layout_seed = 123, verbose = TRUE, ... )
complexList |
A named list where each element is a character vector of protein identifiers representing a complex. |
gmt |
A named list where each element is a character vector of genes. |
similarityMethod |
The metric used for comparing complexes and functional terms. Defaults to **"jaccard"** to penalize size differences and maintain diversity. Avoid "overlap" if you wish to see specific pathways distinct from generic ones. |
alpha |
Numeric (0-1). The weight given to physical protein composition versus functional similarity in the network layout. Defaults to **0.75** (75% physical, 25% functional). |
ifRefineCpx |
Logical. If **TRUE**, executes Step 1 to refine the input complex list (merge redundant complexes). If **FALSE**, Step 1 is skipped, and the raw 'complexList' is used for downstream analysis. Defaults to **FALSE**. |
layout_seed |
Integer seed for reproducible layout. Defaults to 123. |
verbose |
A logical value indicating whether to print progress messages. |
... |
Additional arguments passed to core functions: - 'minSize', 'maxSize', 'mergeThreshold' (for 'refineComplexList' if 'ifRefineCpx = TRUE') - 'pAdjustMethod', 'pValueCutoff' (for 'runComplexEnrichment') - 'geneSetDb' (for 'generateNodeAttributes' semantic clustering) |
This function is tuned to generate a **functionally diverse landscape**. It enforces the following logic: 1. **Refinement:** (Optional) Uses Jaccard similarity to merge only highly redundant complexes, preserving biological variants (subsets/supersets). Controlled by 'ifRefineCpx'. 2. **Enrichment:** Calculates 'Fold Enrichment' to prioritize specific biological functions over generic ones. 3. **Network:** Builds the layout primarily based on **Physical Composition** (alpha = 0.75), using functional annotations only to group related clusters, not to collapse them.
A validated 'ComplexMap' S3 object.
Qingzhou Zhang <[email protected]>
A dataset containing a list of 622 putative protein complexes identified in the study using an integrative global proteomic profiling approach. This dataset is intended for use in package examples and vignettes.
demoComplexesdemoComplexes
A named list with 622 elements. Each element is a character vector of protein identifiers representing a single complex.
These complexes were derived from chromatographic separation of cultured human cell extracts into more than one thousand biochemical fractions, followed by quantitative tandem mass spectrometry analysis. Most of the 622 complexes are linked to core biological processes and include candidate disease genes and unannotated proteins.
Supplementary Table 3 (first tab) from: Havugimana PC, Hart GT, Nepusz T, Yang H, Turinsky AL, Li Z, Wang PI, Boutz DR, Fong V, Phanse S, Babu M, Craig SA, Hu P, Wan C, Vlasblom J, Dar VU, Bezginov A, Clark GW, Wu GC, Wodak SJ, Tillier ER, Paccanaro A, Marcotte EM, Emili A. *A census of human soluble protein complexes.* Cell. 2012 Aug 31;150(5):1068-81. doi: 10.1016/j.cell.2012.08.011. PMID: 22939629; PMCID: PMC3477804.
Calculates four standard metrics for evaluating protein complex predictions: Positive Predictive Value (PPV), Sensitivity (Sn), Accuracy (Acc), and the Maximum Matching Ratio (MMR).
evaluateComplexes( predictedComplexes, referenceComplexes, nCores = NULL, verbose = TRUE )evaluateComplexes( predictedComplexes, referenceComplexes, nCores = NULL, verbose = TRUE )
predictedComplexes |
A list of predicted protein complexes. |
referenceComplexes |
A list of reference (gold standard) complexes. |
nCores |
The number of CPU cores to use for parallel computation. Defaults to one less than the total number of detected cores. |
verbose |
A logical value indicating whether to print progress messages. Defaults to 'TRUE'. |
This function is optimized for speed by calculating a shared intersection matrix between predicted and reference complexes in parallel. This matrix is then used as the basis for all four metric calculations.
- **PPV, Sn, and Acc** are calculated based on the confusion matrix between predicted and reference complexes, as described in the literature (e.g., Zhang et al., 2012).
- **MMR** is calculated by first deriving an overlap score matrix, where the score for a predicted complex (P) and a reference complex (R) is '|P ∩ R|² / (|P| * |R|)'. The [Hungarian algorithm](https://en.wikipedia.org/wiki/Hungarian_algorithm) is then used to solve the maximum weight bipartite matching problem. This approach is based on the method described by Nepusz et al. (2012).
The parallel computation uses 'future.apply::future_lapply' for cross-platform compatibility (unlike 'parallel::mclapply', which is not available on Windows).
A named list containing four numeric values: 'PPV', 'Sn', 'Acc', and 'MMR'. Returns 'NA' for all metrics if either input list is empty.
Qingzhou Zhang <[email protected]>
Nepusz, T., Yu, H. & Paccanaro, A. (2012). Detecting overlapping protein complexes in protein-protein interaction networks. *Nature Methods*, 9, 471–472. doi:10.1038/nmeth.1938
Zhang XF, Dai DQ, Ou-Yang L, Wu MY (2012). Exploring Overlapping Functional Units with Various Structure in Protein Interaction Networks. *PLOS ONE*, 7(8): e43092. doi:10.1371/journal.pone.0043092
# --- Sample Data --- # Predicted complexes pred1 <- c("A", "B", "C") pred2 <- c("D", "E", "F") pred3 <- c("A", "G", "H") predicted <- list(P1 = pred1, P2 = pred2, P3 = pred3) # Reference complexes (gold standard) ref1 <- c("A", "B", "C", "X") # Good match for pred1 ref2 <- c("D", "E", "F") # Perfect match for pred2 ref3 <- c("I", "J", "K") # Unmatched complex reference <- list(R1 = ref1, R2 = ref2, R3 = ref3) # --- Evaluation --- # Use 2 cores for the example metrics <- evaluateComplexes(predicted, reference, nCores = 2) print(metrics)# --- Sample Data --- # Predicted complexes pred1 <- c("A", "B", "C") pred2 <- c("D", "E", "F") pred3 <- c("A", "G", "H") predicted <- list(P1 = pred1, P2 = pred2, P3 = pred3) # Reference complexes (gold standard) ref1 <- c("A", "B", "C", "X") # Good match for pred1 ref2 <- c("D", "E", "F") # Perfect match for pred2 ref3 <- c("I", "J", "K") # Unmatched complex reference <- list(R1 = ref1, R2 = ref2, R3 = ref3) # --- Evaluation --- # Use 2 cores for the example metrics <- evaluateComplexes(predicted, reference, nCores = 2) print(metrics)
A convenient alias for 'runComplexMapApp()'. Launches the Cytoscape.js interactive explorer.
explore(cmap, ...)explore(cmap, ...)
cmap |
A 'ComplexMap' object. |
... |
Additional arguments passed to 'runComplexMapApp'. |
Exports the 'ComplexMap' nodes and edges to compatible file formats, preserving systems biology attributes like Specificity Scores and Functional Domains.
exportNetwork( complexMapObject, filePrefix, format = "cytoscape", verbose = TRUE )exportNetwork( complexMapObject, filePrefix, format = "cytoscape", verbose = TRUE )
complexMapObject |
A 'ComplexMap' object. |
filePrefix |
Character string for output filenames (e.g., "results/my_map"). |
format |
Output format. One of: - '"cytoscape"': Writes separate node and edge TSV files for Cytoscape Desktop. - '"graphml"': Writes a GraphML file (via 'igraph'). - '"tsv"': Writes a single node-attribute TSV file. |
verbose |
Logical. |
**Systems Biology Rationale:** To verify the landscape in external tools (e.g., Cytoscape Desktop), this function ensures that the specific calculated attributes are correctly formatted:
- **'score'**: The Specificity Score. - **'primaryFunctionalDomain'**: The Specific Label. - **'colorHex'**: The calculated blended color.
It performs a "Sanitization" step to convert any R-specific list columns into semi-colon separated strings and fills 'NA' values to ensure safe import.
None (Writes files to disk).
Qingzhou Zhang <[email protected]>
Creates a detailed attribute table for each complex, emphasizing functional specificity for network visualization, and assigns professional HCL colors.
generateNodeAttributes( complexes, enrichments, geneSetDb = NULL, similarityMethod = "jaccard", verbose = TRUE )generateNodeAttributes( complexes, enrichments, geneSetDb = NULL, similarityMethod = "jaccard", verbose = TRUE )
complexes |
A named list of protein complexes. |
enrichments |
A named list of enrichment results. Must contain 'Fold'. |
geneSetDb |
Optional named list of gene sets for semantic clustering. |
similarityMethod |
Distance method for clustering ("jaccard", etc.). |
verbose |
Logical. |
A 'tibble' with complex attributes.
Qingzhou Zhang <[email protected]>
Access the network edge list (weights, similarity types).
getEdgeTable(cm)getEdgeTable(cm)
cm |
A 'ComplexMap' object. |
A 'tibble'.
Provides the full system path to an example gene set (GMT) file included with the ComplexMap package.
getExampleGmt()getExampleGmt()
The included file is the BioCarta gene set collection from the Molecular Signatures Database (MSigDB v2025.1). This function makes it easy to access the file for use in examples and vignettes.
A character string containing the full path to the example GMT file.
# Get the path gmtPath <- getExampleGmt() # You can then read the file using the path if (file.exists(gmtPath)) { exampleGmt <- getGmtFromFile(gmtPath) }# Get the path gmtPath <- getExampleGmt() # You can then read the file using the path if (file.exists(gmtPath)) { exampleGmt <- getGmtFromFile(gmtPath) }
Parses a local GMT (Gene Matrix Transposed) file into the standard named-list format.
getGmtFromFile(filepath, verbose = TRUE)getGmtFromFile(filepath, verbose = TRUE)
filepath |
The path to the local .gmt file. |
verbose |
A logical value indicating whether to print progress messages. |
A named list where names are gene set names and values are character vectors of genes.
Fetches GO terms and their associated genes from a Bioconductor AnnotationDb package.
getGoGmt( speciesDb, ontology = "BP", minGmtSize = 10, maxGmtSize = 500, verbose = TRUE )getGoGmt( speciesDb, ontology = "BP", minGmtSize = 10, maxGmtSize = 500, verbose = TRUE )
speciesDb |
An AnnotationDb object for the target species (e.g., 'org.Hs.eg.db'). |
ontology |
The GO ontology to fetch. One of "BP", "MF", or "CC". |
minGmtSize |
The minimum number of genes for a GO term to be included. |
maxGmtSize |
The maximum number of genes for a GO term to be included. |
verbose |
A logical value indicating whether to print progress messages. |
A named list where names are GO terms and values are character vectors of Entrez IDs.
A wrapper for 'msigdbr::msigdbr' to fetch gene sets and format them as a named list (GMT format).
getMsigdbGmt(species = "Homo sapiens", collection = "H", verbose = TRUE)getMsigdbGmt(species = "Homo sapiens", collection = "H", verbose = TRUE)
species |
The scientific name for the species (e.g., "Homo sapiens"). |
collection |
The MSigDB collection code (e.g., "H" for hallmark). |
verbose |
A logical value indicating whether to print progress messages. |
A named list where names are gene set names and values are character vectors of gene symbols.
Access the node attributes (layout, function, specificity scores).
getNodeTable(cm)getNodeTable(cm)
cm |
A 'ComplexMap' object. |
A 'tibble'.
Fetches Reactome pathways and their associated genes from the 'reactome.db' Bioconductor annotation package.
getReactomeGmt(speciesDb, verbose = TRUE)getReactomeGmt(speciesDb, verbose = TRUE)
speciesDb |
An AnnotationDb object for the target species (e.g., 'org.Hs.eg.db'). This is used to filter pathways for the correct species. |
verbose |
A logical value indicating whether to print progress messages. |
A named list where names are Reactome pathway names and values are character vectors of Entrez IDs.
Provides a "Systems Biology Dashboard" summary of the ComplexMap object.
## S3 method for class 'ComplexMap' print(x, ...)## S3 method for class 'ComplexMap' print(x, ...)
x |
A 'ComplexMap' object. |
... |
Additional arguments. |
This summary is designed to give immediate feedback on the **Functional Diversity** of the landscape:
- **Functional Diversity:** The count of distinct functional labels (colors). A high number (e.g., >15) indicates a rich, specific landscape. A low number indicates over-clustering or generic annotation. - **Annotation Coverage:** The percentage of complexes that could be assigned a function. High coverage with high diversity is the ideal state.
Invisibly returns the object.
Reduces the number of edges in a 'ComplexMap' object to prevent browser overload during interactive exploration.
pruneNetwork( cmap, method = "top_k", k = 5, weight_quantile = 0.75, verbose = TRUE )pruneNetwork( cmap, method = "top_k", k = 5, weight_quantile = 0.75, verbose = TRUE )
cmap |
A 'ComplexMap' object. |
method |
Pruning method: '"top_k"' (keep top-k edges per node) or '"quantile"' (keep edges above a weight quantile). |
k |
Integer. Number of top edges to retain per node when 'method = "top_k"'. |
weight_quantile |
Numeric (0-1). Quantile threshold when 'method = "quantile"'. Defaults to '0.75'. |
verbose |
Logical. |
A modified 'ComplexMap' object with pruned edges.
A diagnostic tool to assess complex size distribution and distinguish between true redundancy (synonyms) and biological hierarchy (subsets).
qcComplexList( complexList, redundancyThreshold = 0.9, subsetThreshold = 0.9, verbose = TRUE )qcComplexList( complexList, redundancyThreshold = 0.9, subsetThreshold = 0.9, verbose = TRUE )
complexList |
A list of character vectors (protein complexes). |
redundancyThreshold |
Threshold for Jaccard similarity warning. Defaults to 0.9. |
subsetThreshold |
Threshold for Simpson coefficient (subset) reporting. Defaults to 0.9. |
verbose |
Logical. |
**Systems Biology Rationale:** To maintain a diverse functional landscape, it is critical to distinguish between two types of similarity:
1. **Jaccard Similarity (Redundancy):** Complex A and B are nearly identical. * *Action:* Merge these (using 'refineComplexList'). 2. **Overlap/Simpson Similarity (Hierarchy):** Complex A is a subset of Complex B. * *Action:* **Keep these.** Do not merge. These often represent distinct biological states (e.g., Core Complex vs. Holo-Complex).
This report calculates both metrics to guide your refinement strategy.
Invisibly returns the input 'complexList'.
Qingzhou Zhang <[email protected]>
Targeted querying of complexes or proteins.
queryMap(complexMapObject, query, type)queryMap(complexMapObject, query, type)
complexMapObject |
A 'ComplexMap' object. |
query |
Search string. |
type |
"protein" or "complex". |
- 'type="protein"': Regex search for protein members. - 'type="complex"': Exact match for Complex ID.
A tibble of matching nodes.
A reference dataset containing 324 merged CORUM protein complexes used in training protein-protein interaction scoring and clustering optimization procedures in the study.
referenceComplexesreferenceComplexes
A named list with 324 elements. Each element is a character vector of protein identifiers.
These complexes were curated from the CORUM database and merged to reduce redundancy for benchmarking purposes.
Supplementary Table 3 (second tab) from: Havugimana PC, Hart GT, Nepusz T, Yang H, Turinsky AL, Li Z, Wang PI, Boutz DR, Fong V, Phanse S, Babu M, Craig SA, Hu P, Wan C, Vlasblom J, Dar VU, Bezginov A, Clark GW, Wu GC, Wodak SJ, Tillier ER, Paccanaro A, Marcotte EM, Emili A. *A census of human soluble protein complexes.* Cell. 2012 Aug 31;150(5):1068-81. doi: 10.1016/j.cell.2012.08.011. PMID: 22939629; PMCID: PMC3477804.
This function filters complexes by size and merges highly redundant ones.
refineComplexList( complexList, minSize = 3, maxSize = 500, mergeThreshold = 0.9, similarityMethod = "jaccard", verbose = TRUE )refineComplexList( complexList, minSize = 3, maxSize = 500, mergeThreshold = 0.9, similarityMethod = "jaccard", verbose = TRUE )
complexList |
A named list where each element is a character vector of protein identifiers representing a complex. |
minSize |
Minimum complex size. Defaults to 3. |
maxSize |
Maximum complex size. Defaults to 500. |
mergeThreshold |
Numeric (0-1). Threshold for merging. Defaults to **0.90** (strict) to preserve distinct variants. |
similarityMethod |
Metric for merging. Defaults to **"jaccard"**. Options: * '"jaccard"': (Default) 'Intersection / Union'. Penalizes size differences. Best for preserving specific variants. * '"overlap"': 'Intersection / Min(A,B)'. Merges subsets into parents. Use only if you want to aggressively reduce data. * '"matching_score"': 'Intersection^2 / (SizeA * SizeB)'. Geometric approach. * '"dice"': '2 * Intersection / (SizeA + SizeB)'. |
verbose |
Logical. |
**Systems Biology Rationale:** To preserve the functional diversity of the input landscape, this function defaults to a conservative **Jaccard** similarity with a high threshold (0.90).
* **Trust the Input:** We assume the upstream clustering method identified biologically relevant variants (e.g., a complex with vs. without a regulatory subunit). * **Minimal Merging:** We only merge complexes if they are effectively synonyms (nearly identical composition).
We discourage using "overlap" or "matching_score" for this step, as they tend to merge sub-complexes into parents, destroying the specific functional signals you wish to visualize.
A list containing: * 'refinedComplexes': The final list of merged complexes. * 'mergeMap': A tibble mapping original IDs to final IDs.
Qingzhou Zhang <[email protected]>
Performs enrichment analysis for each complex against a GMT background.
runComplexEnrichment( complexList, gmt, pAdjustMethod = "Benjamini", pValueCutoff = 0.05, verbose = TRUE )runComplexEnrichment( complexList, gmt, pAdjustMethod = "Benjamini", pValueCutoff = 0.05, verbose = TRUE )
complexList |
A named list of protein complexes (character vectors). |
gmt |
A named list of gene sets (character vectors). |
pAdjustMethod |
Method for multiple testing correction ("Benjamini", "Bonferroni", "FDR"). Defaults to "Benjamini". |
pValueCutoff |
Adjusted p-value cutoff. Defaults to 0.05. |
verbose |
Logical. |
**Systems Biology Rationale:** To support the generation of a specific and diverse landscape, this function calculates and returns **Fold Enrichment** and **Term Size** in addition to standard p-values.
- **Fold Enrichment** is used by downstream functions to prioritize specific biological labels over generic ones. - **Term Size** (PopHits) allows you to filter out overly broad terms (e.g., those containing > 10
A named list of tibbles. Each tibble contains: - 'ID': Term ID/Name - 'Description': Term Description - 'p.adjust': Adjusted p-value - 'Fold': Fold Enrichment (Observed/Expected) - 'TermSize': Number of genes in the term (Background) - 'Count': Number of genes in the term (Overlap)
Qingzhou Zhang <[email protected]>
Launches a Shiny application that renders a 'ComplexMap' object as an interactive Cytoscape.js network. Nodes are colored by functional domain, sized by protein count, and fully filterable via sidebar controls.
runComplexMapApp( cmap, prune = TRUE, prune_method = "top_k", k = 5, weight_quantile = 0.75, port = NULL, launch.browser = TRUE, verbose = TRUE )runComplexMapApp( cmap, prune = TRUE, prune_method = "top_k", k = 5, weight_quantile = 0.75, port = NULL, launch.browser = TRUE, verbose = TRUE )
cmap |
A 'ComplexMap' object. |
prune |
Logical. Whether to prune edges before launching. Default 'TRUE'. |
prune_method |
Pruning method: '"top_k"' or '"quantile"'. Default '"top_k"'. |
k |
Integer. Top-k edges per node when 'prune_method = "top_k"'. Default '5'. |
weight_quantile |
Numeric (0-1). Quantile threshold for '"quantile"' method. Default '0.75'. |
port |
Optional integer port for the Shiny server. |
launch.browser |
Logical. Open browser automatically. Default 'TRUE'. |
verbose |
Logical. |
Launches the Shiny app (invisibly returns 'NULL').
Mean-centers and rescales raw layout coordinates to a fixed pixel range suitable for Cytoscape.js.
scaleLayoutForCytoscape(x, y, range = c(-500, 500))scaleLayoutForCytoscape(x, y, range = c(-500, 500))
x |
Numeric vector of x coordinates. |
y |
Numeric vector of y coordinates. |
range |
Numeric vector of length 2 giving target range. Default 'c(-500, 500)'. |
A 'list' with elements 'x' and 'y', both rescaled.
Converts a 'ComplexMap' object into a Cytoscape.js-compatible JSON string, with scaled layout positions. This JSON is consumed directly by the Shiny/Cytoscape.js interactive explorer.
toCytoscapeJSON( cmap, prune = TRUE, prune_method = "top_k", k = 5, weight_quantile = 0.75, coord_range = c(-500, 500), verbose = TRUE )toCytoscapeJSON( cmap, prune = TRUE, prune_method = "top_k", k = 5, weight_quantile = 0.75, coord_range = c(-500, 500), verbose = TRUE )
cmap |
A 'ComplexMap' object (with layout coordinates in the node table). |
prune |
Logical. Whether to prune the network before export. Default 'TRUE'. |
prune_method |
Pruning method passed to 'pruneNetwork()'. Default '"top_k"'. |
k |
Integer. Top-k edges per node if 'prune_method = "top_k"'. Default '5'. |
weight_quantile |
Numeric. Quantile threshold if 'prune_method = "quantile"'. Default '0.75'. |
coord_range |
Numeric length-2 vector for coordinate scaling. Default 'c(-500, 500)'. |
verbose |
Logical. |
A JSON string suitable for 'window.complexmapElements' in JavaScript.