<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi all,
<div class=""><br class="">
</div>
<div class="">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.  </div>
<div class=""><br class="">
</div>
<div class="">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 (<a href="http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2012-June/000513.html" class="">http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2012-June/000513.html</a>).
   I’m running on a MBP  with 16 GB of memory.</div>
<div class=""><br class="">
</div>
<div class="">Any tips or tricks for running an object of this size? Interestingly I’ve been able to run a PCA and DAPC without issue.</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">#Convert structure file to a genind object. </div>
<div class="">> data <- read.structure("~/Documents/Trochilus/second_chapter/Analysis/structure/input/GBS_all_pop_pheno.stru", </div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>n.ind=158, </div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>n.loc=6451, </div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>onerowperin=TRUE,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>col.lab=1,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>col.pop=2,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>col.others=3:8,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>row.marknames=0,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>ask=FALSE,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span> )</div>
<div class=""><br class="">
</div>
<div class=""> Converting data from a STRUCTURE .stru file to a genind object... </div>
<div class=""><br class="">
</div>
<div class="">> #add xy data as a separate element in the list $other</div>
<div class="">> other(data)$xy <- other(data)$X[, 5:6]</div>
<div class="">> mode(other(data)$xy) <- "numeric"</div>
<div class="">> colnames(other(data)$xy) <- c("x", "y")</div>
<div class="">> #define strata</div>
<div class="">> strata(data) <- as.data.frame(other(data)$X[, 1:3])</div>
<div class="">> nameStrata(data) <-c("sex","phenotype", "HI")</div>
<div class="">> </div>
<div class="">> # add jitter</div>
<div class="">> data$other$xy <-jitter(data$other$xy, factor = 1, amount = NULL) </div>
<div class=""><br class="">
</div>
<div class="">>  mySpca <- spca(data, ask=FALSE, type=1, scannf=FALSE)</div>
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">
Caroline D. Judy<br class="">
PhD Candidate (LSU)<br class="">
Peter Buck Predoctoral Fellow (NMNH)<br class="">
email: <a href="mailto:judyc@si.edu" class="">judyc@si.edu</a><br class="">
<br class="">
<br class="">
</div>
</div>
<br class="">
</div>
</body>
</html>