Error while running readAndMerge()

Create issue
Issue #21 resolved
Former user created an issue

When running readAndMerge(), I get the error below:

Merging samples... Computing merged scores...

Computing sample scaling factors...

Reading NPerBin file... Computing normalisation scores... Error in if (any(x == 0)) { : missing value where TRUE/FALSE needed

Do you know what's going on? The design contains few probes (~7,000) and was sequenced at a depth of 150 M read pairs. It was processed with Hicup, resulting in about 45 M unique read pairs. I'm happy to share input files, etc. Thank you.

My baitmap file: chr10 3087701 3088476 7113 element.1958|2013 chr10 3088476 3089176 7114 element.1958|1651;element.1958|2884 chr10 3089176 3089599 7115 element.1958|4834 chr10 3850804 3851989 8890 element.1837|584

My chinput file:

samplename=test-1 bamname=test-1 baitmapfile=probes-MboI_fragments-new.baitmap_4col.txt digestfile=MboI.rmap

baitID otherEndID N otherEndLen distSign 1011481 6143 1 458 NA 1011481 33352 1 345 NA ... 1011481 992102 1 937 -7574305 1011481 995451 1 332 -6350954 ... 1011481 1011510 1 116 12420 1011481 1011511 1 145 12551

Comments (9)

  1. Mikhail Spivakov

    I don't think we've encountered this error previously. Can you please share a minimal chinput file that reproduces the error, along with all your design files?

  2. Mikhail Spivakov

    Hi, thanks!

    Please also share all four of your design files and the output of sessionInfo(), and we'll look into this.

  3. Mikhail Spivakov

    Hi Noboru,

    I've had a look and this is simply an interface issue pertaining to readAndMerge() always expecting to see >1 sample. If you've got just one sample, please use readSample() instead. We'll fix this, however, to make sure that readSample() is invoked automatically when a single sample is supplied, and update the package accordingly.

    Thanks for the report!

    Best wishes, Mikhail

  4. Noboru Sakabe

    Thanks for looking into this. I used readSample() and didn't get that error (although I've used readAndMerge() in other single replicate data sets with no problem). However, I'm getting other errors now:

    Computing scaling factors...
    Computing binwise means...
    The following viewpoints couldn't be robustly normalised (too sparse?) and will be removed:
    [1] [0,1]    (1,3]    [0,1]B2B (1,3]B2B
    Levels: [0,1] (1,3] [0,1]B2B (1,3]B2B
    Error in plot.window(xlim, ylim, log = log, ...) : 
      need finite 'ylim' values
    Calls: chicagoPipeline ... eval -> eval -> barplot -> barplot.default -> plot.window
    In addition: Warning messages:
    1: In min(x) : no non-missing arguments to min; returning Inf
    2: In max(x) : no non-missing arguments to max; returning -Inf
    Execution halted`

    This is a 6,500 probe data set, my previous ones had 50,000, could this be the problem? Thank you.

  5. Mikhail Spivakov

    If by probes you mean baited/captured fragments, this number is still high enough - Chicago can easily handle <1000 baits. The problem you're having is more likely due to the small number of observed interactions with non-zero counts.

    This problem arises when Chicago is trying to pool other ends together by their noise properties (proxied by the number of trans-counts that each of them generates) to compute other end-wise normalisation factors s_i. I'm not sure without seeing your data what exactly went wrong, but this procedure has failed.

    The good news is that while this step increases the precision of interaction calling somewhat, it is not strictly necessary. So you can try calling interactions without s_i's - that is, normalising the data purely based on bait-specific properties.

    To do so, simply run all functions executed by chicagoPipeline() manually in the same order as listed in this function's code, but skipping normaliseOtherEnds(). You'll get a few warnings about s_i's missing when running estimateBrownianComponent() as a result, but these are to be expected.

    If you have enough power in your data for all steps other than s_i estimation, this should solve your problem. I'm a little concerned (also looking at your trans-count bins listed in your error report below as viewpoints) that you may need higher-coverage data overall to get sensible results. But certainly try this out and see if it's the case.

  6. Noboru Sakabe

    Hi, Mikhail, I ran Chicago as you recommended and it ran to completion. Thanks for your assistance! I also suspect that these data don't have a lot of interactions, and probably why Chicago is struggling.

    This is what I ran:

    cd = normaliseBaits(cd)
    # skipping normaliseOtherEnds()
    cd = estimateTechnicalNoise(cd)
    cd = estimateDistFun(cd)
    cd = estimateBrownianNoise(cd)
    cd = getPvals(cd)
    cd = getScores(cd)

    I hope the errors I got help you implement some error handling in future versions! Thanks again.

  7. Log in to comment