[adegenet-forum] creating genlight object from 48K SNP data file

Jombart, Thibaut t.jombart at imperial.ac.uk
Wed Sep 14 18:27:24 CEST 2011


Hello Linda, 

nop, it shouldn't take so long. There may be an issue in the initial data table.

Here is an example run on my laptop, with a dataset of identical size:

> dat <- matrix(sample(0:1, 1192*48e3, replace=TRUE),nrow=1192) # fake data matrix
> dat[1:10,1:10]
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
 [1,]    0    1    1    1    0    0    0    1    0     0
 [2,]    0    1    0    0    0    0    0    0    0     1
 [3,]    0    0    1    0    1    1    0    1    1     1
 [4,]    0    1    0    0    0    1    0    0    1     1
 [5,]    0    0    1    1    1    1    0    1    1     0
 [6,]    0    0    1    1    0    0    1    1    0     0
 [7,]    1    1    1    0    0    0    0    1    1     0
 [8,]    0    0    0    0    1    0    0    1    0     1
 [9,]    1    0    0    0    1    0    0    0    1     0
[10,]    0    0    0    1    1    0    1    1    1     1
> dim(dat)
[1]  1192 48000

> system.time(x <- new("genlight", dat))
Loading required package: multicore
   user  system elapsed 
   4.60    0.18    9.15 
####

In this example, converting the data took 4.6 seconds. 

Can you try with a smaller subset of your data and/or check that all entries are integers ranging from 0 to the ploidy of your data, or NAs?

Cheers

Thibaut


________________________________________
From: Linda Rutledge [lrutledge at trentu.ca]
Sent: 14 September 2011 16:30
To: Jombart, Thibaut
Subject: Re: [adegenet-forum] creating genlight object from 48K SNP data file

Hi Thibaut,

Thanks. It is now all working for the tutorial dataset. I do run the newest version of R. Sorry for the confusion.

However, I am having difficulty creating a genlight file of my data (1192 individuals at 48K loci). It has now been running for about 30 minutes under:

Command was:

> SNPdata <- read.table("Myfile.txt", header = TRUE, fill = TRUE, sep = "\t")
> SNPforR <- new("genlight", SNPdata)

Is that a normal amount of time for this type of large file? Or should I abort?

Regards,
Linda

On 2011-09-13, at 6:44 PM, Jombart, Thibaut wrote:

> Hello Linda,
>
> actually, this should not be an error but merely a warning. To disable it, use:
> ###
> x <- new("genlight", dat, multicore=FALSE)
> ###
>
> but this is really cosmetic. Information on the multicore package can be found on CRAN:
> http://cran.r-project.org/web/packages/multicore/index.html
>
> It seems to work on MacOS X. Are you really using R 1.4? This version must be outdated by a few centuries: we're now at R 2.13.1. I would be surprised to see the latest version of adegenet working in R1.4 - or anything beside a t-test. You should definitely use the current version, and give "install.packages("multicore") a try.
>
> All the best
>
> Thibaut.
>
>
> ________________________________________
> From: adegenet-forum-bounces at r-forge.wu-wien.ac.at [adegenet-forum-bounces at r-forge.wu-wien.ac.at] on behalf of Linda Rutledge [lrutledge at trentu.ca]
> Sent: 13 September 2011 22:16
> To: adegenet-forum at r-forge.wu-wien.ac.at
> Subject: [adegenet-forum] creating genlight object from 48K SNP data file
>
> Hi,
>
> I have been going through the adegenet-genomics tutorial but when I enter the commands:
>
>> dat <- list(toto=c(1,1,0,0), titi=c(NA,1,1,0), tata=c(NA,0,3, NA))
>> x <- new("genlight", dat)
>
> I get the error message:
>
> Loading required package: multicore
> Warning message:
> In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
> there is no package called 'multicore'
>
> I can't find any information about multicore package nor nothing on the archive.
>
> Eventually I want to do a PCA on 48K SNPs of 1100 individuals that is coded as individuals in rows and each SNP column labelled with chromosome location. Coding is integers -1, 0, 1, 2. (example of first 4 snps shown below).
>
> chr1.100091560 chr1.100112448 chr1.100116609 chr1.100127203
> 1              0              2              0              2
> 2              2              1              1              1
> 3              0              2              0              2
> 4              0              1              1              2
> 5              0             -1              1              2
>
> I run Mac OX 10.6.8 and R1.4.0
>
> Hope someone out there can help. Thanks.
>
> Linda
> _______________________________________________
> 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



More information about the adegenet-forum mailing list