Git Product home page Git Product logo

entropart's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

entropart's Issues

DivPart - correction to non-integer values

Dear Eric,

I am trying to analyse diversity in microsat data using your package (I am interested in estimating genetic differentiation at the regional and population levels) and encountered the following 'problem': when using DivPart with biased=F and Correction="Best" settings, I get warnings that correction cannot be applied to non-integer Ns values, but the object created indicate that correction has been applied.

Here is a reproducable example:

library(entropart)
library(adegenet)
data(nancycats)
loclist<-seploc(nancycats)
df_gendat<-as(loclist[[2]], "data.frame") #we use only one locus (the second in this example)
df_gendat<-df_gendat[complete.cases(df_gendat),]
df_reduced<-df_gendat[1:180,]
pop_list<-c(rep("pop1",15),rep("pop2",25),rep("pop3",15),rep("pop4",25),rep("pop5",20),rep("pop6",20),rep("pop7",25),rep("pop8",15),rep("pop9",20)) #populations (9 populations in total)
reg_list<-c(rep("two",40),rep("three",60),rep("four",80)) #regions (3 regions in total; the first region consists of two populations, the second consists of three populations and the third consists of four populations, respectively)
df2_gendat<-cbind(reg_list,pop_list,df_reduced)
abun<-t(rowsum(df2_gendat[,3:ncol(df2_gendat)],df2_gendat$pop_list,na.rm=T))
two<-cbind(abun[,"pop1"],abun[,"pop2"]); colnames(two)<-c("pop1","pop2")
three<-cbind(abun[,"pop3"],abun[,"pop4"],abun[,"pop5"]); colnames(three)<-c("pop3","pop4","pop5")
four<-cbind(abun[,"pop6"],abun[,"pop7"],abun[,"pop8"],abun[,"pop9"]); colnames(four)<-c("pop6","pop7","pop8","pop9")
MC_two <- MetaCommunity(Abundances = two)
MC_three <- MetaCommunity(Abundances = three)
MC_four <- MetaCommunity(Abundances = four)
merged_total <- MergeMC(list(MC_two, MC_three, MC_four),Weights=c(2,3,4))
est_obs<-DivPart(q=1, merged_total, Biased=F, Correction="Best")
summary(est_obs)

Should I ignore these warnings? It may be related to unequal sample sizes (i.e. number of individuals) within populations - at least I do not get this warning when I set the number of individuals to be equal in all populations here.

Thank you for your help in advance!

Best wishes,
Zoltán

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.