Giter Site home page Giter Site logo

fastglobetrotter's People

Contributors

sahwa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

aiyacharley

fastglobetrotter's Issues

Error in "findpeak()" function - potentially derived from error when defining "wsize"

Hi,

I recently ran fastGLOBETROTTER according to the guidelines and examples provided in this github repository ("FastGLOBETROTTER_Instructions.pdf" and "FastGLOBETROTTER_Tutorial.pdf"). When using my own data, depending on the input files used I encountered the following error:

Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases
Calls: findpeak -> lm -> lm.fit

Eventually, I traced down this error to the chunk of code defining findpeak() that starts around line 160.

 findpeak  = function  (ourmix,means,bin.width)
 {
   dom = which(ourmix ==max(ourmix))
   new = means[length(ourmix)*(dom-1)+dom,]
   ##if (dim(means)[2] > 100) {wsize = 100  ## !!!!! pongsakorn orig !!!!!!!!
   ##} else  {wsize = round(dim(means)[2]/4)}  ## !!!!! pongsakorn orig !!!!!!!!
   wsize = round(dim(means)[2]/2) ## !!!!! garrett change (now can remove up to half the original -- fitted -- x-axis) !!!!!!!!
 ...
     while (j < wsize && ((j+i)<(dim(means)[2]-10)))  ## !!!!! garrett change (now must keep the last 10 gridpoints at least) !!!!!!!!
     {
       temp = lm(new[j:(j+i)]~c(j:(j+i)))
       ...
      }
 }

In my case, the new vector defined at the start of this function only had non-NA values before a certain element (in my case [,75]), yet wsize was set at roughly 140. This meant that temp could only be defined until the 75th element of new before lm() generated the aforementioned error by pulling the NA value found in the 76th element of new.

I ended up working around this issue by using part of the initial code by Pongsakorn found in the commented line 163: I modified the definition of wsize so that the denominator was 4 instead of 2 in line 164:

 wsize = round(dim(means)[2]/4) 

This solved the issue for me, but I would be grateful if you could take a look at it to see whether this correction was wrong.

Thanks in advance,

Guillem

running got error: address (nil), cause 'memory not mapped'

Hi,

I performed fastGLOBETROTTER by R < fastGLOBETROTTER/fastGLOBETROTTER.R paramfile.txt samplefile.txt recomfile.txt 1 --no-save > out, but got the following error:

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
 1: coancestry.curves(ploidy, ind.id.vec, samples.filein, recomrates.filein,     bin.width, num.bins, (1:length(dists.shift))[dists.shift ==         min(dists.shift)][1] - 1, donor.pops.all, donor.label.vec,     recipient.label.vec, weightmin, gridweightMAXcutoff, tempweights,     nrow(weights.mat))
 2: matrix(coancestry.curves(ploidy, ind.id.vec, samples.filein,     recomrates.filein, bin.width, num.bins, (1:length(dists.shift))[dists.shift ==         min(dists.shift)][1] - 1, donor.pops.all, donor.label.vec,     recipient.label.vec, weightmin, gridweightMAXcutoff, tempweights,     nrow(weights.mat)), byrow = TRUE, ncol = num.bins)
An irrecoverable exception occurred. R is aborting now ...

I also tested the memory by R < fastGLOBETROTTER/fastGLOBETROTTER.R paramfile.txt samplefile.txt recomfile.txt mem --no-save > out and it told me:

[1] "number of targets: 45"
[1] "number of bins: 291"
[1] "number of donors in mode1: 77"
[1] "number of donors after merging in mode2: 12"
[1] "Mode 1 requires memory of 1.6 G."
[1] "Mode 2 requires memory of 1 G (may provide less precise inference)."
[1] "Mode 3 generally requires much less memory but can take longer time."
[1] "(Note that, for larger estimated memory usage, these estimates may be off by 1G or so.)"

So I guess the error was not caused by the memory size of my cluster.

Then I tested the same parameters and dataset using GLOBETROTTER. It runs normally, but hasn't finished yet. I mean I really don't know GLOBETROTTER makes sense or not. But fastGLOBETROTTER can't work.

How do I solve this error?

Best wishes,
Xiaobo

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.