Psy-Fer / SquiggleKit

SquiggleKit: A toolkit for manipulating nanopore signal data
MIT License
120 stars 23 forks source link

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() #61

Open vetmohit89 opened 1 year ago

vetmohit89 commented 1 year ago

Hello,

I have generated data.tsv file from squigglePull.py using multi fast5 file. Now, I am trying to run squigglePlot.py but getting below error when I am using data.tsv file as input file.

Here is the input command I used: python SquigglePlot.py --signal data.tsv

The error message I am getting: Traceback (most recent call last): File "SquigglePlot.py", line 473, in main() File "SquigglePlot.py", line 214, in main if not sig: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Please help.

Psy-Fer commented 1 year ago

Hello,

I'm currently away until the 10th of Jan.

You should be able to use squiggle plot on the fast5 files directly. Squiggle pull is going to be deprecated very soon in favour of reading slow5 files.

I hope this helps until I get back.

James

vetmohit89 commented 1 year ago

Thank you so much for prompt response. But I am not sure if we are giving all fast5 files as input file or individual file to run squigglePlot. I have 150 fast5 files from a single sample.

Psy-Fer commented 1 year ago

If you run the command something like this

python3 ./SquigglePlot.py -i data.fast5 --no_show --save test.png --save_path ./test

This will plot every read in the data.fast5 multi fast5 file.

If you have multiple single fast5 files in a path, you can run the same command like this

python3 ./SquigglePlot.py -p data/ --single --no_show --save test.png --save_path ./test

where --single will tell it to expect single fast5 files.

I have also fixed the sig.any() bug you are getting when using a signal file input that you are currently doing. So you can just do a git pull on the repo and try again with your current commands.

Let me know if this helps.

James

vetmohit89 commented 1 year ago

Thank you so much for your help. It worked.