[adegenet-forum] find.clusters missing values

Thibaut Jombart thibautjombart at gmail.com
Tue Aug 2 16:26:14 CEST 2016


Hi Marta,

the function find.clusters has methods for matrix and data.frame objects.
Easiest way to proceed is use 'tab' to extract allele frequencies from your
genind object and replace missing values, and then use find.clusters on it.

For instance:

> data(microbov)
> summary(microbov)

// Number of individuals: 704
// Group sizes: 50 50 51 30 50 50 47 61 31 55 50 50 49 30 50
// Number of alleles per locus: 9 7 12 5 11 9 7 12 13 9 13 16 14 14 14 10
10 19 11 13 17 12 16 13 12 15 8 22 21 9
// Number of alleles per group: 251 235 143 179 194 212 146 196 176 200 213
186 191 168 188
*// Percentage of missing data: 2.32 %*
// Observed heterozygosity: 0.55 0.54 0.69 0.45 0.64 0.6 0.29 0.59 0.68
0.58 0.66 0.71 0.6 0.71 0.8 0.64 0.45 0.64 0.65 0.63 0.66 0.66 0.59 0.74
0.68 0.77 0.62 0.69 0.68 0.44
// Expected heterozygosity: 0.71 0.6 0.78 0.54 0.79 0.76 0.49 0.69 0.83
0.77 0.77 0.82 0.75 0.76 0.89 0.75 0.63 0.77 0.75 0.78 0.77 0.77 0.77 0.84
0.74 0.89 0.69 0.77 0.89 0.56

> x <- tab(microbov, freq=TRUE, *NA.method="mean"*) # replace missing
values here
> g <- find.clusters(x)
Choose the number PCs to retain (>=1):
....

Best
Thibaut


--
Dr Thibaut Jombart
Lecturer, Department of Infectious Disease Epidemiology
Imperial College London
https://sites.google.com/site/thibautjombart/
https://github.com/thibautjombart
Twitter: @TeebzR <https://twitter.com/TeebzR>

On 1 August 2016 at 14:18, Marta Piotrowska <Marta.Piotrowska at sruc.ac.uk>
wrote:

> Dear Members,
>
>
>
> I am trying to use find.cluster function in adegenet package for my
> microsat data analysis but I can’t find anywhere information if it accepts
> missing values. I tried NAs but it seems not to like it. I know that one
> way around it is to remove all the samples with missing values but I
> wondered if there is alternative allowing me to keep the missing values?
>
>
>
> I will be grateful for your help.
>
>
>
> Regards,
>
> Marta
>
>
>
>
>
> *Marta Piotrowska, PhD.*
>
> *Postdoctoral Researcher*
>
> *Crop and Soil Systems Group*
>
> *SRUC*
>
> *West Mains Road*
>
> *Edinburgh EH9 3JG*
>
>
>
> *Phone: 01315354294*
>
> *Marta.Piotrowska at sruc.ac.uk <Marta.Piotrowska at sruc.ac.uk>*
>
>
>
>
>
>
>
>
>
> Please don't print this e-mail unless you really need to.
>
> This e-mail message is confidential to the intended recipient at the email
> address to which it has been addressed. If the message has been received by
> you in error, it may not be disclosed to or used by anyone other than the
> intended addressee, nor may it be copied in any way. If it is not intended
> for you please inform us, immediately, then delete it from your system. If
> the content is not about the business of the organisation then the message
> is not from us nor is it sanctioned by us. Anything in this e-mail or its
> attachments which does not relate to SRUC's or SAC Commercial Limited's
> official business is neither given nor endorsed by SRUC or SAC Commercial
> Limited.
>
> SRUC
> A Charitable company limited by guarantee, Scottish Charity Number:
> SC003712.
> Registered in Scotland, Company Number: SC103046 - Registered Office:
> Peter Wilson Building, King’s Buildings, West Mains Road, Edinburgh EH9 3JG
> SAC Commercial Limited, an SRUC company
> Registered in Scotland, Company Number: SC148684 - Registered Office:
> Peter Wilson Building, King’s Buildings, West Mains Road, Edinburgh EH9 3JG
>
> _______________________________________________
> adegenet-forum mailing list
> adegenet-forum at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20160802/44ac40ea/attachment.html>


More information about the adegenet-forum mailing list