kausmees / GenoCAE

Convolutional autoencoder for genotype data
BSD 3-Clause "New" or "Revised" License
15 stars 10 forks source link

GCAE cannot run 'project' with a phenotype, how to fix? #21

Closed richelbilderbeek closed 2 years ago

richelbilderbeek commented 2 years ago

Dear GenoCAE maintainers,

Thanks for GenoCAE and its Continuous Integration (GitHub Actions) script!

When I run GenoCAE with the added/experimental phenotype, I can now (thanks to #19) train the neural network. Great!

However, when I want to project the genotypes I get the wrong error messages that are too early.

Training goes great, as confirmed by this example GitHub Actions log:

 python3 run_gcae.py train --datadir example_tiny --data issue_2_bin --model_id M1  --epochs 20 --save_interval 2  --train_opts_id ex3  --data_opts_id b_0_4 --pheno_model_id=p1

The last line of the output is also clear:

Done training. Wrote to /home/runner/work/GenoCAE/GenoCAE/ae_out/ae.M1.ex3.b_0_4.issue_2_bin.p1

Note the .p1 addition to the folder name, which is not there when not working with a phenotype.

When I start using the project option, that I copy from the doc, I get unexpected and/or too early error messages:

When I run on GHA like this:

python3 run_gcae.py project --datadir example_tiny --data issue_2_bin --model_id M1 --train_opts_id ex3 --data_opts_id b_0_4 --superpops example_tiny/HO_superpopulations --pheno_model_id=p1

I get the error:

Invalid command. Run 'python run_gcae.py --help' for more information.

as if the --pheno_model_id=p1 is not supported yet.

Sure, I can delete that flag altogether, but then I get:

FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/GenoCAE/GenoCAE/ae_out/ae.M1.ex3.b_0_4.issue_2_bin/weights'

Note the absence of .p1 in the folder name.

The error I expect would be that the dataset used (issue_2_bin) would not work with the file specified with --superpops example_tiny/HO_superpopulations (although it might work by sheer luck).

How can I use project on a neural net that can also do a phenotype?

richelbilderbeek commented 2 years ago

Fixed it by changing the doc,see https://github.com/richelbilderbeek/GenoCAE/commit/1c8a2146a28d3032a85c83ecb4996b2fa0e42ced#diff-05ab121c88a6290f5ab0ddab63bcb942da189507ce0dc7affc35a187226cdad0