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

ValueError: cannot reshape array of size 0 into shape (0,newaxis) #2

Open
yeeus opened this issue Jan 14, 2025 · 11 comments
Open

ValueError: cannot reshape array of size 0 into shape (0,newaxis) #2

yeeus opened this issue Jan 14, 2025 · 11 comments
Assignees

Comments

@yeeus
Copy link

yeeus commented Jan 14, 2025

In the last step to predict gene expression, I got an error:

Traceback (most recent call last):
  File "path/SVEN/predict_expression.py", line 89, in <module>
    model_prediction("ref")
  File "path/SVEN/predict_expression.py", line 36, in model_prediction
    anno_whole = anno_whole[:, :, filter_index].reshape(anno_whole.shape[0], -1)
ValueError: cannot reshape array of size 0 into shape (0,newaxis)

I'm not sure what happened due to such a huge project...

@XL-1748
Copy link

XL-1748 commented Jan 14, 2025

I'm having the same problem.

@gao-ge gao-ge assigned gao-ge and freshmanfresh and unassigned gao-ge Jan 14, 2025
@freshmanfresh
Copy link
Collaborator

@yeeus Could you provide more specific information on this: your input and what commands you execute?

@yeeus
Copy link
Author

yeeus commented Jan 14, 2025

You can try this test file test.vcf.gz.
All I did was follow your instruction about predicting effects of SVs on gene expression level.
And in the last step I got above error.

Acturally, I got another error in the step prepare_data.py, but it seemed everything was normal and I got the outputs for the next step.

python ~/softwares/SVEN/prepare_data.py --type sv test.vcf
path/mambaforge/envs/sven/bin/bedtools
##### Success: extract bed file. #####
terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoll
##### Success: extract sequences from bed file. #####
##### Processing 0 sequence pairs. #####
##### Success: sequence one-hot encoding. #####

@freshmanfresh

This comment was marked as outdated.

@yeeus
Copy link
Author

yeeus commented Jan 15, 2025

image
Actually this SV was within a gene... :-(

@XL-1748
Copy link

XL-1748 commented Jan 16, 2025

But, I was using your test_sv.vcf file and followed your process (predicting SV effect on gene expression levels) and got the same error.

@freshmanfresh
Copy link
Collaborator

@yeeus @XL-1748 I have identified the error. The error was with bedtools. You can install bedtools 2.26.0 by conda install bioconda::bedtools=2.26.0 . We have also updated Installation document and prepare_data.py. Can you update files and bedtools and try again?

@XL-1748
Copy link

XL-1748 commented Jan 17, 2025

After updating, no errors were reported in the previous steps, but the same error as before occurred in the last step (using the test_sv.vcf )
`##### Predict with fast mode... #####

Loading annotations...

Traceback (most recent call last):
File "/home/ubuntu/liuhong/SVEN-0.1.0/SVEN-0.1.0/predict_expression.py", line 89, in
model_prediction("ref")
File "/home/ubuntu/liuhong/SVEN-0.1.0/SVEN-0.1.0/predict_expression.py", line 36, in model_prediction
anno_whole = anno_whole[:, :, filter_index].reshape(anno_whole.shape[0], -1)
ValueError: cannot reshape array of size 0 into shape (0,newaxis)`

@freshmanfresh
Copy link
Collaborator

@XL-1748 Can you provide all commands and full outpus (including previous steps) as a log file?

@XL-1748
Copy link

XL-1748 commented Jan 17, 2025

test_sv1.log

@freshmanfresh
Copy link
Collaborator

@XL-1748 you should remove the work dir work_dir and then run the codes. I will add "remove temp files" function later.

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

4 participants