bcm-uga / pcadapt

Performing highly efficient genome scans for local adaptation with R package pcadapt v4
https://bcm-uga.github.io/pcadapt
37 stars 10 forks source link

read.pcadapt(pool.data, type = "pool") throws error #10

Closed jkreinz closed 4 years ago

jkreinz commented 6 years ago

I've formatted my poolseq data where rows are pops and columns are snp markers. I keep getting the following error when using read.pcadapt, which occurs even on the example data:

filename <- read.pcadapt(pool.data, type = "pool") Error in read.pcadapt(pool.data, type = "pool") : Argument input.filename has to be a character string.

privefl commented 6 years ago

Hello @jkreinz,

We are currently working on a new version of pcadapt (4.0.0). You can get the development version with devtools::install_github("privefl/pcadapt"). This is still a work in progress but it should work for poolseq data using

pool_data <- read.pcadapt(pool.data, type = "pool")
pcadapt(pool_data)

You can find the documentation (also in progress) there.

jkreinz commented 6 years ago

Hi Florian,

I’ve tried to install the new version using devtools::install_github("privefl/pcadapt”), however I keep getting the following error (on several platforms).

ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2' ld: library not found for -lgfortran clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [pcadapt.so] Error 1 ERROR: compilation failed for package ‘pcadapt’

Thanks, Julia

On Feb 22, 2018, at 3:40 AM, Florian Privé notifications@github.com<mailto:notifications@github.com> wrote:

Hello @jkreinzhttps://github.com/jkreinz,

We are currently working on a new version of pcadapt (4.0.0). You can get the development version with devtools::install_github("privefl/pcadapt"). This is still a work in progress but it should work for poolseq data using

pool_data <- read.pcadapt(pool.data, type = "pool") pcadapt(pool_data)

You can find the documentation also (in progress) therehttps://github.com/privefl/pcadapt/blob/master/vignettes/pcadapt.Rmd#g-detecting-local-adaptation-with-pooled-sequencing-data.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bcm-uga/pcadapt/issues/10#issuecomment-367605953, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOV0tZ6Bp6Dqbf23x-3h06AprQpUaEagks5tXSfugaJpZM4SOHTE.

privefl commented 6 years ago

Hum, on several platforms, are you sure? It is a well-known Mac issue with RcppArmadillo. Yet, I don't know why RcppArmadillo is still a dependency in the new version..

Please see this blog post.

mblumuga commented 6 years ago

The blog post mentioned by @privefl should provide solutions to your installation issue. This issue can arise because pcadapt 4.0 depends on Rcpp.

privefl commented 6 years ago

RcppArmadillo*

jkreinz commented 6 years ago

Thanks for your advice. I’ve gotten the new install working, however upon running the pcadapt function, I keep getting the following error and haven’t been able to debug it.

res <- pcadapt(filename) Error in 1:p : argument of length 0

I assume this is an issue with my input file, but my pool.data file is the same input format as your example: 2 rows for each pool and 2882974 columns representing my snps. Due to ulimit constraints, I am unable to import the file in this format as there are too many columns, so as work around, I import a transposed version and then transpose again once in R. This is the format of the final pool.data file before running read.pcadapt and pcadapt.

[cid:3DA07312-0D19-4023-B09D-0E1DCA903064@utoronto.ca]

Thanks for your assistance, Julia

On Feb 23, 2018, at 3:28 AM, Florian Privé notifications@github.com<mailto:notifications@github.com> wrote:

Hum, on several platforms, are you sure? It is a well-known Mac issue with RcppArmadillo. Yet, I don't know why RcppArmadillo is still a dependency in the new version..

Please see this blog posthttps://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks--lgfortran-and--lquadmath-error/.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bcm-uga/pcadapt/issues/10#issuecomment-367942707, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOV0ta6LUR0Wi9o6T1PU_OTECk1Z5bkQks5tXnadgaJpZM4SOHTE.

mblumuga commented 6 years ago

Can you try the new version of pcadapt which is available on https://github.com/privefl/pcadapt/.

Main changes concern Pooled-Seq data. Score plot, scree plot, and get.pc functions available for Pooled-seq data.

Will be glad to read your remarks if you have any.

jkreinz commented 6 years ago

Thought I was using the newest version, but somehow not. Now using the new version, pcadapt will run, but I get the following error:

Error in fun(A, k, nu, nv, opts, mattype = "matrix") : nrow(A) and ncol(A) should be at least 3

Is it only possible to run if you have 3 or more pools? In my case I have two that I am especially interested in comparing.

Thanks, Julia

On Mar 8, 2018, at 5:57 AM, mblumuga notifications@github.com<mailto:notifications@github.com> wrote:

Can you try the new version of pcadapt which is available on https://github.com/privefl/pcadapt/.

Main changes concern Pooled-Seq data. Score plot, scree plot, and get.pc functions available for Pooled-seq data.

Will be glad to read your remarks if you have any.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bcm-uga/pcadapt/issues/10#issuecomment-371454072, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOV0tcKIT6KVd1wTktG2FyRZDcCm6_TLks5tcQ6PgaJpZM4SOHTE.

mblumuga commented 6 years ago

With 3 pools, it works fine. However, it is true that there is a bug with 2 pools. We are working on it right now.

mblumuga commented 6 years ago

@jkreinz we fix the pbm with 2 pools. Can you try the new version please available at https://github.com/privefl/pcadapt/

jkreinz commented 6 years ago

Thanks for the update.

New error when running res <- pcadapt(filename):

Warning message: In res[pass] <- (zscores - median(zscores[pass]))^2 : number of items to replace is not a multiple of replacement length

On Mar 8, 2018, at 12:40 PM, mblumuga notifications@github.com<mailto:notifications@github.com> wrote:

@jkreinzhttps://github.com/jkreinz we fix the pbm with 2 pools. Can you try the new version please available at https://github.com/privefl/pcadapt/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bcm-uga/pcadapt/issues/10#issuecomment-371564382, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AOV0tcPotgZKcHPq67z46kjIHjrK9Zdeks5tcW0WgaJpZM4SOHTE.

mblumuga commented 6 years ago

How many pools do you have? Would it be possible for you to send me part of your data (1 contig, 1 chromosome) so that I can replicate your bug.

privefl commented 6 years ago

You can reproduce the bug with

pool.file <- system.file("extdata/pool3pops", package = "pcadapt")

pool.data <- as.matrix(read.table(pool.file))[1:2, ]
pool.data[, 1] <- c(0, 0.05)

pool.data <- read.pcadapt(pool.data, type = "pool")
pcadapt(pool.data)
mblumuga commented 6 years ago

@jkreinz we fix the pbm you mentionned. Can you try the new version available at https://github.com/privefl/pcadapt/