GithubHelp home page GithubHelp logo

Comments (3)

suzkel avatar suzkel commented on June 10, 2024 1

AHA It does work with a subset.
I have some individuals who were not assigned to a population, leading to the error.

Thank you for the suggestion!!

from hierfstat.

zkamvar avatar zkamvar commented on June 10, 2024

One thing to note is that your data may be malformed.

You mention:

I have a data set of 4451 individuals and 473 SNPs.

But your data show:

4,386 individuals; 473 loci; 946 alleles

which indicates that you have lost 65 samples somewhere.

Moreover, the error here indicates that you have missing data in your ploidy definitions:

Error in if (any(object@ploidy < 1L)) { :
missing value where TRUE/FALSE needed

Also, given that you mention that specific data set, I'm assuming you are following http://popgen.nescent.org/StartSNP.html as an example?

  • Do you get the same error on a sub-set of your data?
  • Can you provide a reproducible example?
  • What does the result of unique(ploidy(myData)) look like?

The above may better help us figure out what's going on.

from hierfstat.

zkamvar avatar zkamvar commented on June 10, 2024

Excellent! Thank you for posting a description of the solution :)

If it helps, I would also recommend to have sanity checks throughout your script so that if anything changes, you'll know when it happened:

## read in data and format it --------------------
## ...

# Number of individuals expected
stopifnot(nInd(dat) == 4451)

# Number of loci expected
stopifnot(nLoc(dat) == 473)

# Number of populations expected
stopifnot(nPop(dat) == 9) 

## run analyses here -----------------------------
## ...

from hierfstat.

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.