Closed kawu001 closed 2 years ago
Hi, first of all, are you sure that your path to the EIGENSTRAT trio is correct? I.e. that your prefix corresponds to the correct path to the data?
For instance, I see this:
gondolin:~
$ ls ~/Downloads/MontisAdmixR
snps.geno snps.ind snps.snp
So the files are in ~/Downloads/MontisAdmixR
.
Then I can do this in R:
> prefix <- "~/Downloads/MontisAdmixR/snps"
> data <- eigenstrat(prefix)
> data
EIGENSTRAT object
=================
components:
ind file: /Users/martin_petr/Downloads/MontisAdmixR/snps.ind
snp file: /Users/martin_petr/Downloads/MontisAdmixR/snps.snp
geno file: /Users/martin_petr/Downloads/MontisAdmixR/snps.geno
>
Based on what you wrote, my assumption is that you forgot to add the part of the path that is shared by all three files (snps
) to the prefix.
I don't see any problem with the files. Or at least nothing that would prevent admixr from loading them. I don't know what vcf2eigenstrat.py
is so I can't vouch for the actual contents of the files (i.e. I have not attempted to run any analysis on them).
I copied the files to downloads, and used this codes. I got same error: Not all three ind/snp/geno files present. I also tried using the example data, but I got another error.
snp_data <- eigenstrat(download_data()) Error in utils::download.file("https://bioinf.eva.mpg.de/admixr/snps.tar.gz", : 'wget' call had nonzero exit status
- Could it be that my AdmixTools path is not correct?
- Am I missing any additional package that I'm supposed to install?
If the package tells you that the files are not present, this means that your path is simply not correct. This is literally what the eigenstrat()
function does, as you can verify it in the code of the package. I ran the code on your data and it works. There's no magic, it simply checks for the presence of those files at your path.
Please do the following:
ls <path to the directory where you think is your data>
and paste here the entire output that you get. Are the three files there?library(admixr)
data <- eigenstrat("here put the exact path to those files, excluding the .ind/.snp/.geno suffix")
Please paste here exactly what you typed in R, including the path.
- Could it be that my AdmixTools path is not correct?
- Am I missing any additional package that I'm supposed to install?Am I missing any additional package that I'm supposed to install?
Both of these might be true. However, this has nothing to do with the error you're getting. Let's focus on solving your issue first.
Did you have any success?
One more piece of information that I can provide: in your initial message you write that you specified the prefix as
data_prefix <- "./MontisAdmixR"
However, given the structure of the zipped EIGENSTRAT data that you provided (which has a common prefix snps.{geno,snp,ind}
it should be rather
data_prefix <- "./MontisAdmixR/snps"
?
This is, in fact, what I did in my reply.
Not yet! I get the directory right, however, it's still same error. My Admixtools is installed on my school's linux server, while R is installed on windows. So I think linking both AdmixTools and AdmixR is the problem. Right now, I'm trying to install ubuntu on my windows so that I can install R and AdmixTools on it.
Closing due to inactivity. Happy to reopen again if necessary.
Hi Martin,
I tried running AdmixR in R after installing admixtools in R and as well as on ubuntu. I converted into eigenstrat using "vcf2eignestrat.py" I got the 3 files (.ind, .snp and .geno).
I created the .Renviron and I linked the path from my ubuntu (admixtools).
Finally, I tried loading the data using this command,
set data prefix
data_prefix <- "./MontisAdmixR" data_prefix
read in data
snps <- eigenstrat(data_prefix)
I got this error... "Error: Not all three ind/snp/geno files present"
Kindly check out the files and probably proffer a solution.
Thank you,
Bashir MontisAdmixR.zip