<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hi All adegenet guru,</div>
<div><br>
</div>
<div>I am having troubles getting <i>df2genind</i> function to find the correct number of alleles in my dataset.</div>
<div><br>
</div>
<div>My data are SNPs data (2 alleles at each locus). The genotypes are encoded in one single column such as 0=reference homozygote, 1=SNP homozygote and 2=heterozygote. And I importe them as data frame from a comma separated .csv file.</div>
<div><br>
</div>
<div>When I apply the function df2genind,</div>
<div><br>
</div>
<div>
<div>genind <- df2genind(locus, sep=",", ncode=1, NA.char="NA", ploidy=2)</div>
<div><br>
</div>
<div>the genind object returned is as follow:</div>
<div><br>
</div>
<div>/// GENIND OBJECT /////////</div>
<div><br>
</div>
<div> // 1 individual; 2,078 loci; 5,752 alleles; size: 1.2 Mb</div>
<div><br>
</div>
<div> // Basic content</div>
<div>   @tab:  1 x 5752 matrix of allele counts</div>
<div>   @loc.n.all: number of alleles per locus (range: 2-3)</div>
<div>   @loc.fac: locus factor for the 5752 columns of @tab</div>
<div>   @all.names: list of allele names for each locus</div>
<div>   @ploidy: ploidy of each individual  (range: 2-2)</div>
<div>   @type:  codom</div>
<div>   @call: .local(x = x, i = i, j = j, drop = drop)</div>
<div><br>
</div>
<div> // Optional content</div>
<div>   - empty -</div>
</div>
<div><br>
</div>
<div>There should be only 4,158 alleles in the object and not 5,752. Is there a problem with using this type of 0,1,2 code for the genotypes? Should my input have 2 columns for each genotype ?</div>
<div><br>
</div>
<div>Thanks for your support!</div>
<div><br>
</div>
<div>Cheers, Laura</div>
</body>
</html>