Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Not all three ind/snp/geno files present #84

Closed
kawu001 opened this issue Jul 8, 2021 · 6 comments
Closed

Error: Not all three ind/snp/geno files present #84

kawu001 opened this issue Jul 8, 2021 · 6 comments

Comments

@kawu001
Copy link

kawu001 commented Jul 8, 2021

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

@bodkan
Copy link
Owner

bodkan commented Jul 8, 2021

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).

@kawu001
Copy link
Author

kawu001 commented Jul 8, 2021

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

  1. Could it be that my AdmixTools path is not correct?
  2. Am I missing any additional package that I'm supposed to install?

@bodkan
Copy link
Owner

bodkan commented Jul 8, 2021

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:

  1. Open your terminal, then type in 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?
  2. Open R in the same terminal session. Type in
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.


  1. Could it be that my AdmixTools path is not correct?
  2. 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.

@bodkan
Copy link
Owner

bodkan commented Jul 11, 2021

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.

@kawu001
Copy link
Author

kawu001 commented Jul 12, 2021

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.

@bodkan
Copy link
Owner

bodkan commented Feb 12, 2022

Closing due to inactivity. Happy to reopen again if necessary.

@bodkan bodkan closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants