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: arrays used as indices must be of integer (or boolean) type #28

Open
nafusco22 opened this issue Apr 5, 2022 · 1 comment

Comments

@nafusco22
Copy link

Hello,

I am trying to run locator on a .vcf file. I keep running into the error below. I have tried adjusting the chromosome codes in the VCF to be numeric only to solve this problem. No matter what I change I keep getting this error. I am not sure if this has to do with the format of my files or the installation of the program.

I am attempting to run this line:

python locator.py --vcf 403_VCF_locator_4.vcf.gz --sample_data Locator_XY.txt --out Locator_403

And get this error:
WARNING:tensorflow:period argument is deprecated. Please use save_freq to specify the frequency in number of batches seen.
Traceback (most recent call last):
File "/gpfs/ycga/home/naf35/install/locator/scripts/locator.py", line 381, in
train,test,traingen,testgen,trainlocs,testlocs,pred,predgen=split_train_test(ac,locs)
File "/gpfs/ycga/home/naf35/install/locator/scripts/locator.py", line 219, in split_train_test
predgen=np.transpose(ac[:,pred])
IndexError: arrays used as indices must be of integer (or boolean) type

The files I used are attached. Your assistance is much appreciated.
403_VCF_locator_6.vcf.gz
Locator_XY.txt
e

-Nicole Fusco

@cjbattey
Copy link
Collaborator

Hi Nicole,

Sorry for the late reply. The error is because there aren't any unknown locations in the --sample_data coordinates file. You can pick a set of samples to predict by replacing their locations with NA. E.g. Here's an edited version of your file set up to predict the first 15 samples.

Locator_XY.txt

Run with:

locator.py --vcf ~/Downloads/403_VCF_locator_6.vcf.gz --sample_data ~/Downloads/Locator_XY.txt --out ~/Desktop/test

CJ

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