<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</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,</div>
<div><br>
</div>
<div>I am using DAPC to find genetic clusters within my data. The problem I am having is that I was using an older version (I’m not sure what version) of adegenet to do the analysis and I have upgraded to version 2.0.1. I wanted to rerun a DAPC and it wouldn’t
 work with commands and the files that had been created and worked in the older version (I suspect this was because I had used na.replace to replace missing data values). I have now got the data to work by replacing the missing data with  tab(pop1to3_bp75_cnt100_cl98,
 NA.method="zero") but the results I am getting for group assignment in the new version (Cluster 1: 20, Cluster 2: 67) are different to what I was getting before (Cluster 1: 84, Cluster 2: 4) . I don’t think that the missing data is being replaced properly
 in my read.structure file. Also the tab() command turns the file from a genind object to a data frame, is that meant to happen?</div>
<div>Below are my commands for the old version and v2.0.1 :</div>
<div><br>
</div>
<div>Old version commands</div>
<div><br>
</div>
<div>
<div>pop1to3_bp75_cnt75_cl96 <- read.structure("../noreps_pop1to3_neutral_75bp_cnt75_cl96_2-16_ml80._maf0.10_missing0.8_hwe0.001.stru", n.ind=87, n.loc=813, onerowperind=TRUE, col.lab=1, col.pop=2, row.marknames=1)</div>
<div>summary(pop1to3_bp75_cnt75_cl96)</div>
<div># Percentage of missing data:  </div>
<div>[1] 5.308846</div>
<div>sum(is.na(pop1to3_bp75_cnt75_cl96$tab))</div>
<div>[1] 7510</div>
<div>pop1to3_bp75_cnt75_cl96NoNA <- na.replace(pop1to3_bp75_cnt75_cl96,"0")</div>
<div>  Replaced 7510 missing values</div>
<div>pop1to3_757596clust<- find.clusters(pop1to3_bp75_cnt75_cl96NoNA)</div>
<div>Choose the number PCs to retain (>=1): </div>
<div>  110</div>
<div>Choose the number of clusters (>=2: </div>
<div>                                 2</div>
<div>pop1to3_dapc_bp75_cnt75_cl96 <- dapc(pop1to3_bp75_cnt75_cl96NoNA, pop=pop1to3_757596clust$grp)</div>
<div>    Choose the number PCs to retain (>=1): </div>
<div>    25</div>
<div>   Choose the number discriminant functions to retain (>=1): </div>
<div>    1</div>
</div>
<div>assignplot(pop1to3_dapc_bp75_cnt75_cl96)</div>
<div><br>
</div>
<div>2.0.1 verion commands:</div>
<div>
<div>pop1to3_bp757596 <- read.structure("../noreps_pop1to3_neutral_75bp_cnt75_cl96_2-16_ml80._maf0.10_missing0.8_hwe0.001.stru", n.ind=87, n.loc=813, onerowperind=TRUE, col.lab=1, col.pop=2, row.marknames=1, NA.char=0)<span class="Apple-tab-span" style="white-space:pre">
</span>#doesn’t read missing data without NA.char specified</div>
<div>summary_75_100_98 <- summary(pop1to3_bp757596)</div>
<div># Percentage of missing data:  </div>
<div>[1] 5.308846</div>
<div>sum(is.na(tab(pop1to3_bp757596)))</div>
<div>[1] 7514</div>
<div>pop1to3_bp757596NoNA <- tab(pop1to3_bp757596, NA.method="zero")</div>
<div>pop1to3_757596clust_2nd<- find.clusters(pop1to3_bp757596NoNA)</div>
<div>Choose the number PCs to retain (>=1): </div>
<div>  100</div>
<div>Choose the number of clusters (>=2: </div>
<div>  2</div>
<div>pop1to3_dapc_bp757596<- dapc(pop1to3_bp757596NoNA, grp=pop1to3_757596clust_2nd)</div>
<div>Choose the number PCs to retain (>=1): </div>
<div>                                 25</div>
<div>Choose the number discriminant functions to retain (>=1): </div>
<div>                                 1</div>
</div>
<div>assignplot(pop1to3_dapc_bp757596)</div>
<div><br>
</div>
<div>Any help would be greatly appreciated.</div>
<div><br>
</div>
<div>Thanks</div>
<div>
<div><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" face="Calibri">Laura</font></font></div>
</div>
</body>
</html>