Skip to content

Error in reduceSimMatrix for pattern 4: Scores vector does not contain all terms in the similarity matrix #8

@sarahtanja

Description

@sarahtanja

Summary

When running the semantic similarity reduction with rrvgo's reduceSimMatrix() for the interaction gene pattern 4 (at lines ~1143-1149 in code/08_go/08_GO.qmd), an error occurs:

Error in reduceSimMatrix(simMatrix.4, scores = scores.4, threshold = 0.8, :
  Scores vector does not contain all terms in the similarity matrix

Details

  • The analysis works as expected for patterns 1-3, but fails on pattern 4 (which only contains a single gene/GO term) when calling reduceSimMatrix().
  • The error message suggests a mismatch between the scores vector and the similarity matrix terms.
  • Upstream, the GO enrichment for pattern 4 is performed on only one gene, which may be the root cause.

Steps to Reproduce

  1. Run the code block at lines 1143-1149 in code/08_go/08_GO.qmd.
  2. Error is thrown when calling reduceSimMatrix(simMatrix.4, scores = scores.4, threshold = 0.8, orgdb = "org.Ce.eg.db").

Expected Behavior

  • The function should either handle the edge case of a single GO term gracefully (e.g., return the term itself), or provide a more informative message.

Environment

  • File: code/08_go/08_GO.qmd
  • R packages: rrvgo, goseq, dplyr, etc.
  • Input: Only 1 gene/GO term in pattern 4.

Possible Solution

  • Add an explicit check for the number of terms in the similarity matrix or scores before calling reduceSimMatrix(), or handle single-term cases upstream.

Screenshots/Error Output

Error in reduceSimMatrix(simMatrix.4, scores = scores.4, threshold = 0.8, :
  Scores vector does not contain all terms in the similarity matrix

This issue tracks the failure of GO term reduction for a single-gene DGE pattern. See lines 1143-1149 in the analysis notebook for details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions