ericmarcon / entropart Goto Github PK
View Code? Open in Web Editor NEWEntropy Partitioning to Measure Diversity
Home Page: https://ericmarcon.github.io/entropart/
Entropy Partitioning to Measure Diversity
Home Page: https://ericmarcon.github.io/entropart/
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
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.