Giter Site home page Giter Site logo

Comments (6)

ivokwee avatar ivokwee commented on June 23, 2024 1

I would debug the error. Sometimes people have just 500-1000 genes. So it is a good edge case.

from playbase.

phisanti avatar phisanti commented on June 23, 2024

The error seems to come from the function compute_testGenesets in compute2-geneset.R. Apparently, there is a hard limit to gene set size. If a gene set has lower than 15 genes, then it won't select any column for further analysis. Here is the code:

  ## filter gene sets on size
  cat("Filtering gene sets on size...\n")
  gmt.size <- Matrix::colSums(G != 0)
  size.ok <- (gmt.size >= 15 & gmt.size <= 400)
  G <- G[, which(size.ok)]

Here we have two options:

  1. We can reduce the limit or making it relative to the input data.
  2. Try some kind of try-catch method so that the script can continue but the geneset will be skipped.

Any suggestion @ivokwee @ncullen93?

from playbase.

ncullen93 avatar ncullen93 commented on June 23, 2024

Yeah a try-catch method would be best. I'm not sure if this error occurs in the omicsplayground platform or if this issue is caught before this code gets run. This is a good example of why all data catching code should be in playbase and not in omicsplayground. Looping in @ivokwee on this.

from playbase.

phisanti avatar phisanti commented on June 23, 2024

Ok, taking on account that last comment, I came up with the following solution:

  # If dataset is too small that size.ok == 0, then select top 100
  if (sum(size.ok) == 0) {
    top_100gs <- head(sort(gmt.size,decreasing = TRUE), 100)
    size.ok <- names(gmt.size) %in% names(top_100gs)
  }
  

Injecting this code in compute_testGenesets after calculating size.ok should solve the issue. This way, there will always be at least 100 genesets. Let me know what you think, @ncullen93 @ivokwee.

from playbase.

ivokwee avatar ivokwee commented on June 23, 2024

Yes that's a good solution. But please test.

from playbase.

phisanti avatar phisanti commented on June 23, 2024

I can confirm the edit works in the Playbase tests as well as in the omicsplayground

from playbase.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.