[adegenet-forum] Different versions giving different results
LAURA NICOLE WOODINGS
17869067 at students.latrobe.edu.au
Mon Feb 29 20:19:10 CET 2016
Hi,
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?
Below are my commands for the old version and v2.0.1 :
Old version commands
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)
summary(pop1to3_bp75_cnt75_cl96)
# Percentage of missing data:
[1] 5.308846
sum(is.na(pop1to3_bp75_cnt75_cl96$tab))
[1] 7510
pop1to3_bp75_cnt75_cl96NoNA <- na.replace(pop1to3_bp75_cnt75_cl96,"0")
Replaced 7510 missing values
pop1to3_757596clust<- find.clusters(pop1to3_bp75_cnt75_cl96NoNA)
Choose the number PCs to retain (>=1):
110
Choose the number of clusters (>=2:
2
pop1to3_dapc_bp75_cnt75_cl96 <- dapc(pop1to3_bp75_cnt75_cl96NoNA, pop=pop1to3_757596clust$grp)
Choose the number PCs to retain (>=1):
25
Choose the number discriminant functions to retain (>=1):
1
assignplot(pop1to3_dapc_bp75_cnt75_cl96)
2.0.1 verion commands:
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) #doesn't read missing data without NA.char specified
summary_75_100_98 <- summary(pop1to3_bp757596)
# Percentage of missing data:
[1] 5.308846
sum(is.na(tab(pop1to3_bp757596)))
[1] 7514
pop1to3_bp757596NoNA <- tab(pop1to3_bp757596, NA.method="zero")
pop1to3_757596clust_2nd<- find.clusters(pop1to3_bp757596NoNA)
Choose the number PCs to retain (>=1):
100
Choose the number of clusters (>=2:
2
pop1to3_dapc_bp757596<- dapc(pop1to3_bp757596NoNA, grp=pop1to3_757596clust_2nd)
Choose the number PCs to retain (>=1):
25
Choose the number discriminant functions to retain (>=1):
1
assignplot(pop1to3_dapc_bp757596)
Any help would be greatly appreciated.
Thanks
Laura
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20160229/d97513ca/attachment.html>
More information about the adegenet-forum
mailing list