conversion of a genlight object into a genpop object
1
0
Entering edit mode
3.7 years ago

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.5k views
ADD COMMENT
0
Entering edit mode
3.1 years ago

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]

ADD COMMENT
0
Entering edit mode

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?

ADD REPLY

Login before adding your answer.

Traffic: 3443 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6