sei-framework icon indicating copy to clipboard operation
sei-framework copied to clipboard

UnboundLocalError: local variable 'i' referenced before assignment

Open ghm17 opened this issue 1 year ago • 4 comments

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

ghm17 avatar Mar 14 '23 20:03 ghm17

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

kathyxchen avatar Mar 15 '23 19:03 kathyxchen

The selene version is 0.5.1.

ghm17 avatar Mar 15 '23 19:03 ghm17

Change the file suffix to .fa or .fasta.

lihaicheng7003 avatar Apr 15 '23 05:04 lihaicheng7003

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?

kathyxchen avatar May 03 '23 20:05 kathyxchen