[adegenet-forum] error on find.clusters
Jombart, Thibaut
t.jombart at imperial.ac.uk
Sun Dec 15 06:25:30 CET 2013
Dear Ann,
your script looks good to me, so it may be a quirk in find.clusters.
Can you please send me a sample dataset / code to reproduce the error off the ML?
Best
Thibaut
--
######################################
Dr Thibaut JOMBART
MRC Centre for Outbreak Analysis and Modelling
Department of Infectious Disease Epidemiology
Imperial College - School of Public Health
St Mary’s Campus
Norfolk Place
London W2 1PG
United Kingdom
Tel. : 0044 (0)20 7594 3658
t.jombart at imperial.ac.uk
http://sites.google.com/site/thibautjombart/
http://adegenet.r-forge.r-project.org/
________________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Willyard, Ann [Willyard at hendrix.edu]
Sent: 14 December 2013 20:40
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] error on find.clusters
On my way to DAPC, I am stuck on an error finding clusters:
> grp <- find.clusters(a, max.n.clust=40)
Error in if (nf > rank) nf <- rank : missing value where TRUE/FALSE needed
I imported an SSR matrix that has 1022 individuals, 6 loci, and 47 populations:
>df <- read.loci(file.choose(), loci.sep=",", col.pop=2, col.loci=3:8)
And created a Genuind object using
>loci<-df[,3:8]
>pop<-df[,2]
>sample<-df[,1]
>a <- df2genind (loci, ncode=3, sep = ",", missing = NA, ploidy = 1, >pop=pop, ind.names=sample)
And confirmed that it is in the correct format using:
print(a, details = TRUE)
#####################
### Genind object ###
#####################
- genotypes of individuals -
S4 class: genind
@call: df2genind(X = loci, sep = ",", ncode = 3, ind.names = sample,
pop = pop, missing = NA, ploidy = 1)
@tab: 1022 x 6 matrix of genotypes
@ind.names: vector of 1022 individual names
@loc.names: vector of 6 locus names
@loc.nall: number of alleles per locus
@loc.fac: locus factor for the 6 columns of @tab
@all.names: list of 6 components yielding allele names for each locus
@ploidy: 1
@type: codom
Optionnal contents:
@pop: factor giving the population of each individual
@pop.names: factor giving the population of each individual
@other: - empty -
I am running 32 bit R version on a Windows 7 PC. I unintalled my R vers. 2.15.3 and installed R. vers. 3.0.2.
I have adegenet vers. 1.3-9.2. According to your web page, this is the most recent stable version, although adegenet-basics.pdf indicates that the adegenet version should be 1.4.
I have loaded the adegenet, pegas, MASS, and ade4 libraries.
I have searched the FAQ and every other source I can think of.
Help for an adegenet newbie will be most appreciated. NSF proposal deadline is looming ……
Ann Willyard
Assistant Professor
Hendrix College
1600 Washington Ave
Conway AR 72032
501-450-1376
Willyard at hendrix.edu
More information about the adegenet-forum
mailing list