This is a test version of Biostars. For the public version, visit https://www.biostars.org.
conversion of a genlight object into a genpop object

How to convert a genind object into genpop object? i have tried but i am unable to assign individuals into populations. I request a simple method or a tip for the conversion

snp r

1 answer

genpop objects are created from genind objects using genind2genpop:

here is a sample conversion for genind to genpop using the nancycats data provided in adegenet package

data(nancycats)

catpop <- genind2genpop(nancycats)

#

Converting data from a genind to a genpop object...

#

...done.

catpop

/// GENPOP OBJECT /////////

#

// 17 populations; 9 loci; 108 alleles; size: 28.5 Kb

#

// Basic content

@tab: 17 x 108 matrix of allele counts

@loc.n.all: number of alleles per locus (range: 8-18)

@loc.fac: locus factor for the 108 columns of @tab

@all.names: list of allele names for each locus

@ploidy: ploidy of each individual (range: 2-2)

@type: codom

@call: genind2genpop(x = nancycats)

#

// Optional content

@other: a list containing: xy

catpop$tab[1:5,1:10]

Although you answered the question in the original post, what about the question as posed in the subject line of this conversation.... Can you convert a genlight object into a genpop object?

Log in to answer this question.