[adegenet-forum] Reading SNP data as a genind oblect

Grant Gillis grant.j.gillis at gmail.com
Thu Jun 21 17:31:31 CEST 2012


Great.  Thanks!

As a follow up.  I had hoped to do an spca on my SNP data but it seems to
be just too big for the memory.  I haven't been able to find out whether it
is possible to do an spca on a genlight oblect.  It appears not to be.  Is
this true?

Many thanks again.

On 21 June 2012 14:26, Jombart, Thibaut <t.jombart at imperial.ac.uk> wrote:

> Hello,
>
> the problems comes from the format of the raw data. Two alleles from a
> given locus should be a single column, possibly with a separator such as
> "/". Here, alleles are on separate columns.
>
> Cheers
>
> Thibaut
>
> --
> ######################################
> Dr Thibaut JOMBART
> MRC Centre for Outbreak Analysis and Modelling
> Department of Infectious Disease Epidemiology
> Imperial College - School of Public Health
> St Mary’s Campus
> Norfolk Place
> London W2 1PG
> United Kingdom
> Tel. : 0044 (0)20 7594 3658
> t.jombart at imperial.ac.uk
> http://sites.google.com/site/thibautjombart/
> http://adegenet.r-forge.r-project.org/
> ________________________________________
> From: adegenet-forum-bounces at lists.r-forge.r-project.org [
> adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Grant
> Gillis [grant.j.gillis at gmail.com]
> Sent: 21 June 2012 13:22
> To: adegenet-forum at lists.r-forge.r-project.org
> Subject: [adegenet-forum] Reading SNP data as a genind oblect
>
> Dear List,
>
> I have SNP data structured as below.  This seems to be accepted as a
> genind object however the obj at tab suggests to me something strange is
> going on.  Too many alleles per locus.  Any tips as to where I'm going
> wrong would be much appreciated.
>
> Cheers,
> Grant
>
>
>
> > dat <- structure(c("A", "A", "A", "G", "G", "G", "A", "G", "NA", "G",
> + "G", "NA", "A", "A", "A", "A", "G", "A", "A", "C", "A", "A",
> + "C", "C"), .Dim = c(3L, 8L), .Dimnames = list(c("genot. 1", "genot. 2",
> + "genot. 3"), c("1", "1", "2", "2", "3", "3", "4", "4")))
>
>
>         1   1   2    2    3   3   4   4
> genot. 1 "A" "G" "A"  "G"  "A" "A" "A" "A"
> genot. 2 "A" "G" "G"  "G"  "A" "G" "C" "C"
> genot. 3 "A" "G" "NA" "NA" "A" "A" "A" "C"
> >
> >
> >
>
>
> > obj <- df2genind(dat, ploidy=2, missing = NA)
> >
> >
> > obj at tab
>  L1.1 L1.2 L1.3 L1.4 L2.1 L2.2 L2.3 L2.4 L2.5 L3.1 L3.2 L3.3 L3.4 L3.5
> L4.1 L4.2 L4.3 L4.4 L4.5 L4.6
> 1  0.5  0.5  0.5  0.5  0.5  0.5  0.0  0.5  0.5  0.5  0.5  0.5  0.5  0.0
>  0.5  0.5  0.0  0.5  0.5  0.0
> 2  0.5  0.5  0.5  0.5  0.5  0.0  0.5  0.5  0.5  0.5  0.5  0.5  0.0  0.5
>  0.5  0.0  0.5  0.5  0.0  0.5
> 3  0.5  0.5  0.5  0.5   NA   NA   NA   NA   NA  0.5  0.5  0.5  0.5  0.0
>  0.5  0.5  0.0  0.5  0.0  0.5
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20120621/db1a1e2f/attachment.html>


More information about the adegenet-forum mailing list