Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in if (alt == "less") { : missing value where TRUE/FALSE needed #8

Open
Rseq opened this issue Feb 2, 2022 · 3 comments
Open

Comments

@Rseq
Copy link

Rseq commented Feb 2, 2022

Hi,

Thanks for this package.
I'm trying to use it, but I keep receiving the following error:

head(bedGR_1)
GRanges object with 6 ranges and 0 metadata columns:
      seqnames          ranges strand
         <Rle>       <IRanges>  <Rle>
  [1]     chr1   761416-878458      *
  [2]     chr1   838814-878458      *
  [3]     chr1   931306-949452      *
  [4]     chr1  931306-1168929      *
  [5]     chr1   947693-958248      *
  [6]     chr1 1165102-1220140      *
  -------

head(bedGR_2)
GRanges object with 6 ranges and 3 metadata columns:
         seqnames              ranges strand |
            <Rle>           <IRanges>  <Rle> |
    AluY     chr1   25165801-25166089      - |
  AluY_1     chr1 150994893-150995191      - |
  AluSq2     chr1 167772065-167772362      + |
    MIRb     chr1 209714985-209715230      - |
  AluSx1     chr1     1048298-1048591      + |
    MIR3     chr1   11534182-11534347      - |
---------

result <- regioneR::overlapPermTest(A= bedGR_1, B= bedGR_2, ntimes=50)

Error in if (alt == "less") { : missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In mclapply(seq_len(ntimes), randomize_and_evaluate, ...) :
  all scheduled cores encountered errors in user code
2: In mean.default(rand.ev, na.rm = TRUE) :
  argument is not numeric or logical: returning NA

I'm using R version 4.1.1 (2021-08-10) -- "Kick Things" and the latest regioneR version 1.26.1

Any idea of what is creating this error?

Thanks

@abedkurdi
Copy link

Hi Rseq,
I encountered the same error. I just removed the rownames for the GRanges objects.

names(bedGR_1) <- NULL
names(bedGR_2) <- NULL

I did that and the problem is gone.

@vincent-hanlon
Copy link

Hi all,

I too have encountered this error. In my case, it was because some of the input regions had negative widths (start > end).

I found that running with mc.cores=1 gave a more informative error message for testing.

@bernatgel
Copy link
Owner

Hi all,

This problem usually appears when one of the permutations failed for some reason and instead of the result of the evaluation function it returns a NULL or an NA. The problem is that when multicore parallel computation is used, the actual error message is lost and what you see is the error generated by the NULL. This is why setting mc.cores=1 or force.parallel=FALSE gives you the actual error message and why the solution is different for each user.

We'll try to add, at least, a more informative error message suggesting to use serial computation to see the actual error.

Bernat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants