calico / basenji

Sequential regulatory activity predictions with deep convolutional neural networks.
Apache License 2.0
409 stars 125 forks source link

ImportError when running basenji_test_genes.py (gene expression predictions) #67

Open ai358 opened 4 years ago

ai358 commented 4 years ago

Hello David,

I would like to use your gene expression prediction modules on my sequences that contain disease-associated SNPs. I have run the lines as explained in the tutorial, but in step 6 python3 basenji_test_genes.py -o ../tutorials/output/gencode_chr9_test --rc -s --table ../tutorials/models/params_small.txt ../tutorials/models/heart/model_best.tf ../tutorials/data/gencode_chr9.h5

I get the _ImportError: cannot import name 'infer_replicates' from 'basenji_testreps'. I launched the script in conda environment created as described in your package installation section.

Thank your for your help.

davek44 commented 4 years ago

Sorry about that. That script is obsolete for the latest version of the code. I'm working on a more effective approach to make a gene-specific predictions.

For predicting SNPs, I suggest using basenji_sad.py

ai358 commented 4 years ago

Hi, Thank you for your answer and for redirecting me to the relevant script. I ran basenji_sad.py but I think the tutorial is not updated and I can't make it work.

python3 ../bin/basenji_sad.py --cpu -f ../tutorials/data/hg19.ml.fa -g ../tutorials/data/human.hg19.genome --h5 -o output/rfx6_sad --rc --shift "1,0,-1" -t data/heart_wigs.txt models/params_small.json models/heart/model_best.tf data/rs339331.vcf Traceback (most recent call last): File "../bin/basenji_sad.py", line 400, in <module> main() File "../bin/basenji_sad.py", line 55, in main default='%s/data/hg19.fa' % os.environ['BASENJIDIR'], File "/home/ai358/miniconda3/envs/bassenji/lib/python3.7/os.py", line 679, in __getitem__ raise KeyError(key) from None KeyError: 'BASENJIDIR' In addition, some options no longer exist (-g and --h5), Could you please show me how to use basenji_sad.py?

Thanks a lot

davek44 commented 4 years ago

Sorry about that. I'll update the tutorial. In the meantime, it should work if you drop the -g and --h5 options and set the BASENJIDIR environmental variable as suggested in the installation instructions https://github.com/calico/basenji/blob/master/README.md

davek44 commented 3 years ago

In case it's still beneficial to you, I just pushed an update to the tutorials.