Coder Social home page Coder Social logo

Comments (2)

JEFworks avatar JEFworks commented on July 19, 2024

Hi Simona,

Thanks for your patience.

It looks like the error is stemming from this code in hb$summarizeResults:

rgs <- cnvs[["allele-based"]][["all"]]
retest <- results[["allele-based"]]
del.loh.allele.prob <- do.call(rbind, lapply(retest, function(x) x))
vi1 <- rowSums(del.loh.allele.prob > 0.75) > min.num.cells
del.loh.allele.prob <- del.loh.allele.prob[vi1, ]
names <- apply(as.data.frame(rgs), 1, paste0, collapse = ":")
rownames(del.loh.allele.prob) <- paste0("del.loh.", names[vi1])
cnvs[["allele-based"]][["del.loh"]] <<- rgs[vi1]
summary[["allele-based"]] <<- del.loh.allele.prob
colnames(del.loh.allele.prob) <- paste0("del.loh.allele.", colnames(del.loh.allele.prob))
df <- cbind(as.data.frame(rgs), avg.del.loh.allele = rowMeans(del.loh.allele.prob), del.loh.allele.prob)

because, as you aptly noted, rgs <- cnvs[["allele-based"]][["all"]] has 15 alterations identified. But del.loh.allele.prob has been filtered to only the alternations affecting more than min.num.cells with greater than 75% posterior probability. In hindsight this should probably also be modified to take a parameter to allow users to have greater stringency on the posterior probability filter.

The fastest hack-y "fix" I believe is to just set min.num.cells = 0 instead of the default = 2.

The correction would be to have:

df <- cbind(as.data.frame(rgs[vi1]), avg.del.loh.allele = rowMeans(del.loh.allele.prob), del.loh.allele.prob)

Can you please double check that the following code works for you?

rgs <- hb$cnvs[["allele-based"]][["all"]]
retest <- hb$results[["allele-based"]]
del.loh.allele.prob <- do.call(rbind, lapply(retest, function(x) x))
min.num.cells <- 2
vi1 <- rowSums(del.loh.allele.prob > 0.75) > min.num.cells
del.loh.allele.prob <- del.loh.allele.prob[vi1, ]
names <- apply(as.data.frame(rgs), 1, paste0, collapse = ":")
rownames(del.loh.allele.prob) <- paste0("del.loh.", names[vi1])
colnames(del.loh.allele.prob) <- paste0("del.loh.allele.", colnames(del.loh.allele.prob))
df <- cbind(as.data.frame(rgs[vi1]), avg.del.loh.allele = rowMeans(del.loh.allele.prob), del.loh.allele.prob)
print(df)

If it works, I can make the appropriate corrections to the repo and acknowledge you in the commit message.

Thanks,
Jean

from honeybadger.

csimona avatar csimona commented on July 19, 2024

Hi Jean,

Thanks for the reply and for the fix; the code works for me.

from honeybadger.

Related Issues (20)

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.