Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with FST script #1

Open
vincenzolandi opened this issue Jul 12, 2021 · 0 comments
Open

problem with FST script #1

vincenzolandi opened this issue Jul 12, 2021 · 0 comments

Comments

@vincenzolandi
Copy link

vincenzolandi commented Jul 12, 2021

Dear Dr. Giannico, thank you to submitting the script...I am running it but i get an error:
Error in if (popelem[1] == popelem[2]) { :
missing value where TRUE/FALSE needed

ehan I execute these lines..

pairwise population matrix FST calculation

for(i in poplevels) {
for(j in poplevels) {
popelem= unlist(strsplit(res[i,j],"/"))

#takes selection of samples an population to use for each pair
flag<- pop_code %in% c(popelem[1],popelem[2])
samp.sel<- sample.id[flag]
pop.sel<- pop_code[flag]

if (popelem[1]==popelem[2]){result="0"}else{
  result = snpgdsFst(genofile, sample.id=samp.sel, population=as.factor(pop.sel), 
                     autosome.only=FALSE, method="W&C84")
}
res[i,j]=as.character(result)

}
}

thank you in advance for help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant