hellenthal-group-ucl / fastglobetrotter Goto Github PK
View Code? Open in Web Editor NEWfaster haplotype-based admixture inference and dating software
License: Other
faster haplotype-based admixture inference and dating software
License: Other
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.