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

IndexError: tuple index out of range #37

Open
Sendong98 opened this issue Jan 26, 2024 · 4 comments
Open

IndexError: tuple index out of range #37

Sendong98 opened this issue Jan 26, 2024 · 4 comments

Comments

@Sendong98
Copy link

Hi
I'm trying to do some imputation checks by masking the genotype data and it worked well with the original file but always get errors when I use the file that I added random 9(missing value) into the genotype file:
File "/home1/p314480/.local/lib/python3.10/site-packages/alphaimpute2/Imputation/BurrowsWheelerLibrary.py", line 65, in setup_library
bw_loci = np.array(range(self.haplotypes.shape[1]), dtype = np.int64)
IndexError: tuple index out of range
How could I solve this problem? Thank you!

@gregorgorjanc
Copy link
Member

@Sendong98 this is odd. Can you provide a reproducible example?

@Sendong98
Copy link
Author

Of course, here's an example for the Alphaimpute example genotype file: I added random 9 and got the error during imputation.
original file (genotype and pedigree data )downloaded from https://github.com/AlphaGenes/AlphaImpute2/tree/main/example masked 10% genotype data generated by adding random missing value
command used: AlphaImpute2 -genotypes genotypes_mask10.txt -pedigree pedigree.txt -out test -writekey genotypes -onlykeyed -cycles 10 -maxthreads 12
genotypes_mask10.txt
genotypes_original.txt
pedigree.txt

@yqiqichen
Copy link
Contributor

I can reproduce the error on my end. And I will try to identify the cause of the error.

@yqiqichen
Copy link
Contributor

I have found out the cause of the error. It is because if there are a lot of '9' in 'genotypes.txt' file, 'self.haplotypes' of function 'setup_library' in file 'BurrowsWheelerLibrary.py' has shape (0,), but we use self.haplotypes.shape[1], which does not exist and leads to the error. I have now modified the function 'setup_library'.

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

3 participants