[adegenet-forum] genind object too big for sPCA?

Judy (Duffie), Caroline JudyC at si.edu
Wed Nov 8 15:50:06 CET 2017


Update - I tried running the same script on a computer with 64 GB of memory. Same issues.

On Nov 7, 2017, at 12:13 PM, Judy (Duffie), Caroline <JudyC at si.edu<mailto:JudyC at si.edu>> wrote:

Hi all,

I’m having trouble running an sPCA on a genind object (10.6Mb) that contains about 160 individuals and 6500 SNPs - When I run the command: 'mySpca <- spca(data, ask=FALSE, type=1, scannf=FALSE)” R crashes - i.e. I get the “whirling ball of death” and the program becomes unresponsive.

I’ve seen some older messages on the forum that similarly report problems with larger genind objects, but responses indicate that there shouldn’t be a memory issue (http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2012-June/000513.html).   I’m running on a MBP  with 16 GB of memory.

Any tips or tricks for running an object of this size? Interestingly I’ve been able to run a PCA and DAPC without issue.

#Convert structure file to a genind object.
> data <- read.structure("~/Documents/Trochilus/second_chapter/Analysis/structure/input/GBS_all_pop_pheno.stru",
+ n.ind=158,
+ n.loc=6451,
+ onerowperin=TRUE,
+ col.lab=1,
+ col.pop=2,
+ col.others=3:8,
+ row.marknames=0,
+ ask=FALSE,
+  )

 Converting data from a STRUCTURE .stru file to a genind object...

> #add xy data as a separate element in the list $other
> other(data)$xy <- other(data)$X[, 5:6]
> mode(other(data)$xy) <- "numeric"
> colnames(other(data)$xy) <- c("x", "y")
> #define strata
> strata(data) <- as.data.frame(other(data)$X[, 1:3])
> nameStrata(data) <-c("sex","phenotype", "HI")
>
> # add jitter
> data$other$xy <-jitter(data$other$xy, factor = 1, amount = NULL)

>  mySpca <- spca(data, ask=FALSE, type=1, scannf=FALSE)


Caroline D. Judy
PhD Candidate (LSU)
Peter Buck Predoctoral Fellow (NMNH)
email: judyc at si.edu<mailto:judyc at si.edu>




Caroline D. Judy
PhD Candidate (LSU)
Peter Buck Predoctoral Fellow (NMNH)
email: judyc at si.edu<mailto:judyc at si.edu>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20171108/b7afa6e5/attachment-0001.html>


More information about the adegenet-forum mailing list