Psy-Fer / SquiggleKit

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

SquigglePlot.py does not result in anything #35

Open sem0036 opened 4 years ago

sem0036 commented 4 years ago

Hello, after running this command python SquigglePlot.py -p /home/lab/Nano/lytic.fast5 it seems as if it is working and says "Done" but I am unable to see anything. I have tried to save .pdf and save_path and nothing shows up. What could I be doing wrong?

Psy-Fer commented 4 years ago

Hello,

Is it a multi-fast5 file? (multiple raw signals in a single file, usually with a file size of 80mb or higher) If so could you try running the same command with the -m flag added?

so something like python SquigglePlot.py -p /home/lab/Nano/lytic.fast5 -m

Let me know how that goes :)

(I need to switch multi-fast5 on as default, i'll add it to my TODO list) Cheers, James

sem0036 commented 4 years ago

Thank you for the quick response! The command you gave me additionally says "done" lab@csm-minionpc:~/SquiggleKit$ python SquigglePlot.py -p /home/lab/SquiggleKit/lytic.fast5 -m --save lytic.pdf --save_path ~/img Done after the common but nothing results from the command. I'm sure I might be missing something but I'm not getting any error messages so I don't know what to fix in terms of image generation.

Psy-Fer commented 4 years ago

That's weird.

I'll run some tests and see if I can track this down. I'll get back to you soon.

James

sem0036 commented 4 years ago

I managed to just generate signals using Squiggle Pull because I ultimately wanted to use Motif Seq. I managed to get Motif Seq running (mostly, I guess, that's why I'm here haha). However, I'm getting the following output, and I don't really know where to go with it.

command python3 MotifSeq.py -s lytic.tsv -i 19_kmer.fa > lytic_19.fa (do I have to create a model using scrappie? On full documentation is goes through this path, but on the quick start is allows just a kmer file and signal file, is this the possible issue?) and this is what I get: `**

python3: Unrecognised base 85 in read Traceback (most recent call last): File "MotifSeq.py", line 521, in main() File "MotifSeq.py", line 156, in main model, m_order, L = convert_fasta(args.fasta_input, args.scrappie_model) File "MotifSeq.py", line 398, in convert_fasta signal = scrappy.sequence_to_squiggle(l, model=mod).data(as_numpy=True, sloika=False) File "/home/lab/.local/lib/python3.5/site-packages/scrappy/init.py", line 448, in sequence_to_squiggle raise RuntimeError('An unknown error occurred whilst encoding sequence.') RuntimeError: An unknown error occurred whilst encoding sequence. Segmentation fault (core dumped)`

Sorry for all the questions.

sem0036 commented 4 years ago

Sorry, the command I used was actually python3 MotifSeq.py -s lytic.tsv -i 19_kmer.fa > lytic_19.tsv my bad for the typo

Psy-Fer commented 4 years ago

Hey, Sorry for the bugs. I've been meaning to do an overhaul. But yes, I moved scrappie into MotifSeq to make it a little easier.

Otherwise, check the structure of your 19_kmer.fa file, and ensure that is only has LF not CRLF or CR at the end of each line. ie, only ends with \n not \r\n or \r (windows and mac respectively do this with most editors). It looks like scrappie is having a having a hard time reading the file, which looks to be mostly caused by the last character of the sequence.

Let me know how that goes, or if you need me to elaborate more on how to fix that.

Also, no worries about the questions. We ask until we know, that's what makes us scientists :)

sem0036 commented 4 years ago

I've seemingly gotten everything to start working! One last question, do you think MotifSeq would ever be able to incorporate looking at RNA?

Psy-Fer commented 4 years ago

Oh great.

Yea, it already can look at RNA. You just have to change the flag for which scrapie model to use. However it won't give you bit probability, as I have not modelled that.

sem0036 commented 4 years ago

When I try to generate the RNA model and incorporate that into the MotifSeq.py it tells me IndexError: list index out of range. Without modeling and just using the .fa file it will run. What could I be doing wrong now?

Psy-Fer commented 4 years ago

Can you show me the command you used for that?

Jenny-dan commented 4 years ago

Hello,

I meet the same problem. After I enter the command: (SquiggleKit-env) dzha@DESKTOP-4U9JHDU:/mnt/d/ape/Squigglekit$ python SquigglePlot.py -i /mnt/d/ape/SquiggleKit/example/test.fast5

It returns nothing but Done(SquiggleKit-env) dzha@DESKTOP-4U9JHDU:/mnt/d/ape/Squigglekit$ What could I do?

Thanks!

Psy-Fer commented 4 years ago

Hello,

I'll have a look and get back to you soon. Sorry for the Inconvenience.

James

Psy-Fer commented 4 years ago

Hello,

I ran the following command on my Ubuntu 18.04 system

python3 SquigglePlot.py -i example/test.fast5

inside the repo folder, and it works.

Is your system set up to draw the plots using matplotlib? If it is Linux, you may need to set up Tk/Tkinter to be used with matplotlib. If it is windows or mac, i'm not really sure off the top of my head.

I would first check to see if you can plot anything with the same python environment.

Try running something like

import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel('some numbers')
plt.show()

and see if it opens a plot window.