[SOLVED] r2fast error

Questions about GenABEL (aka *ABEL) suite of packages
Forum rules
Please remember not to post any sensitive data on this public forum.
The first few posts of newly registered users will be moderated in order to filter out any spammers.

When get a solution to the problem you posted, please change the topic name (e.g. from "how to ..." to "[SOLVED] how to ..."). This will make it easier for the community to follow the posts yet to be attended.
kkoech
Posts: 3
Joined: Mon Jan 06, 2014 1:05 pm

[SOLVED] r2fast error

Postby kkoech » Mon Jan 06, 2014 1:19 pm

Dear all,

when computing r^2 for all pairwise SNP combinations on an snp.data object from 1300 individuals with ~600.000 SNPs I am getting the following error:

Code: Select all

> ld <- r2fast(data=BYDtypedQC)
Error in double(data@nsnps * data@nsnps) : vector size cannot be NA
In addition: Warning message:
In data@nsnps * data@nsnps : NAs produced by integer overflow
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C             
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] genetics_1.3.8.1   mvtnorm_0.9-9996   gtools_3.1.1       gdata_2.13.2       combinat_0.0-8   
[6] GenABEL_1.8-0      GenABEL.data_1.0.0 MASS_7.3-29       

loaded via a namespace (and not attached):
[1] tools_3.0.2


Any clue to solving this would be much appreciated,

Best,
Karl
Last edited by kkoech on Wed Jan 08, 2014 10:07 am, edited 2 times in total.

Nicola Pirastu
GenABEL senior expert
GenABEL senior expert
Posts: 151
Joined: Wed Feb 09, 2011 3:24 pm

Re: r2fast error

Postby Nicola Pirastu » Wed Jan 08, 2014 9:27 am

Dear Karl,

I think you are asking too much from your computer, I think that the problem is that if you try to compute all pairwise comparison it will result in a huge matrix 600.000*600.000 which is really too much.
It also does not really make sense to estimate r2 on SNPs either on different chromosomes or too far away.

Have you tryed to use the function on a smaller set of adiacent SNPs?

Best.

Nicola

kkoech
Posts: 3
Joined: Mon Jan 06, 2014 1:05 pm

Re: r2fast error

Postby kkoech » Wed Jan 08, 2014 10:19 am

Dear Nicola,

thanks for your reply, I was guessing at that - it does work with a couple of 10.000 SNPs. I wanted to do LD pruning for ancestry component computation and thought r2fast would be a good option for an R only pipeline. Now I'll have to outsource this part to PLINK again - or is there some hidden option in r2fast to force it to work only on SNPs within some defined window-size such as is possible in PLINK?

Best,
Karl



Nicola Pirastu wrote:Dear Karl,

I think you are asking too much from your computer, I think that the problem is that if you try to compute all pairwise comparison it will result in a huge matrix 600.000*600.000 which is really too much.
It also does not really make sense to estimate r2 on SNPs either on different chromosomes or too far away.

Have you tryed to use the function on a smaller set of adiacent SNPs?

Best.

Nicola

lckarssen
Site Admin
Site Admin
Posts: 322
Joined: Tue Jan 04, 2011 3:04 pm
Location: Utrecht, The Netherlands

Re: [SOLVED] r2fast error

Postby lckarssen » Wed Jan 08, 2014 11:28 am

Have you tried the snpsubset option of the r2fast() function?
-------
Lennart Karssen
PolyOmica
The Netherlands
-------

kkoech
Posts: 3
Joined: Mon Jan 06, 2014 1:05 pm

Re: [SOLVED] r2fast error

Postby kkoech » Wed Jan 08, 2014 12:35 pm

I've seen the option but with it you need to explicitly state the index of the snps you want to do the computation on. So up front I'd need to write non-generic code to filter the SNP conditional on the SNPs that are available from the array platform used. Either I'll do that or use PLINK which has this functionality implemented and then import results to R. Anyhow, thanks a lot for your help and suggestions.


lckarssen wrote:Have you tried the snpsubset option of the r2fast() function?


Return to “GenABEL”

Who is online

Users browsing this forum: No registered users and 1 guest