FunctionLab / sei-framework

code to run sei and obtain sei and sequence class predictions
Other
92 stars 6 forks source link

UnboundLocalError: local variable 'i' referenced before assignment #16

Open ghm17 opened 1 year ago

ghm17 commented 1 year ago

Hi, I was trying to predict the chromatin profiles by running sh 1_sequence_prediction.sh $input_filepath $genome_version $outdir --cuda but got the following errors. Can anyone helps for this? Thanks in advance.

Input argments: test.vcf test hg19 --cuda use_cuda: True Setting random seed = 999 Traceback (most recent call last): File "1_sequence_prediction.py", line 73, in parse_configs_and_run(configs) File "/home/users/hmguo/.local/lib/python3.6/site-packages/selene_sdk/utils/config_utils.py", line 351, in parse_configs_and_run execute(operations, configs, current_run_output_dir) File "/home/users/hmguo/.local/lib/python3.6/site-packages/selene_sdk/utils/config_utils.py", line 251, in execute analyze_seqs.get_predictions(**predict_info) File "/home/users/hmguo/.local/lib/python3.6/site-packages/selene_sdk/predict/model_predict.py", line 595, in get_predictions strand_index=strand_index) File "/home/users/hmguo/.local/lib/python3.6/site-packages/selene_sdk/predict/model_predict.py", line 438, in get_predictions_for_bed_file sequences = sequences[:i % self.batch_size + 1, :, :] UnboundLocalError: local variable 'i' referenced before assignment

kathyxchen commented 1 year ago

Hi @ghm17 , what version of selene are you using? This might be a bug that we fixed in the latest version.

ghm17 commented 1 year ago

The selene version is 0.5.1.

lihaicheng7003 commented 1 year ago

Change the file suffix to .fa or .fasta.

kathyxchen commented 1 year ago

Thanks @lihaicheng7003 good catch -- @ghm17 did you ever figure this out? From your error it looks like you are passing in a VCF to sequence prediction, when VCF should be used with the variant effect prediction scripts?