Giter Site home page Giter Site logo

Error in if (nMinor < 0) { : missing value where TRUE/FALSE needed Calls: callSubclones -> determine_copynumber about battenberg HOT 4 CLOSED

wedge-lab avatar wedge-lab commented on August 29, 2024
Error in if (nMinor < 0) { : missing value where TRUE/FALSE needed Calls: callSubclones -> determine_copynumber

from battenberg.

Comments (4)

sdentro avatar sdentro commented on August 29, 2024 1

Thanks for reporting this issue and many thanks for the fix @lydiayliu ! Closing this ticket now.

from battenberg.

Sames-Jtudd avatar Sames-Jtudd commented on August 29, 2024

I have the same error. The error orginated in the follwing line of the command Battenberg:::determine_copynumber
33 nMinor = (rho - 1 + (1 - l) * psi * 2^(LogR/gamma))/rho

the reason was that l was "NA". l is derived from the BAFsegment file segment column, which were all NA in my case. Not sure why. If you figure it out let me know.

from battenberg.

keiranmraine avatar keiranmraine commented on August 29, 2024

We see this frequently and abandon the analysis of these samples. It would be useful if there was an appropriate error message indicating the cause of this.

from battenberg.

lydiayliu avatar lydiayliu commented on August 29, 2024

I also ran into this issue with our bwa-mem2 aligned samples to GRCh38 that are of East Asian ancestry.

After following the line of inquiry given above, I confirmed that the error is due to l being NA in

nMinor = (rho - 1 + (1 - l) * psi * 2^(LogR/gamma))/rho

in Battenberg:::determine_copynumber.
This is due to the .BAFsegment. file containing NA for stretches of multiple chromosomes. Following this problem upstream I realized that in the _alleleFrequencies_chr files, the problematic regions have good depth = 0.

Further investigation revealed that the reason there is no depth in those regions is because the regions have ALT CONTIGS where all the reads were aligned to instead, resulting in depth = 0 in the alleleCounter result for the regions.

I'm trying to avoid the problematic regions (since they are very small anyways) by adding a check to skip the segment if nMinor is NA.

Update: was able to avoid this issue and skip the problematic short contigs with read depth of 0. In the determine_copynumber function, add

    if (is.na(nMinor)) {
        print('SKIPPING NA NMINOR')
        next
    }

before the problematic line

    # Increase nMajor and nMinor together, to avoid impossible combinations (with negative subclonal fractions)
    if (nMinor<0) {

from battenberg.

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.