SquiggleKit icon indicating copy to clipboard operation
SquiggleKit copied to clipboard

SquigglePlot.py does not result in anything

Open sem0036 opened this issue 5 years ago • 13 comments

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?

sem0036 avatar Apr 23 '20 20:04 sem0036

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

Psy-Fer avatar Apr 24 '20 06:04 Psy-Fer

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.

sem0036 avatar Apr 24 '20 16:04 sem0036

That's weird.

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

James

Psy-Fer avatar Apr 28 '20 09:04 Psy-Fer

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: `**********************************************************

  • z-score, p-value, probability, etc. are based on *
  • preliminary experimental modeling only             *
    
  •            Use at own risk                         *
    

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 avatar Apr 28 '20 19:04 sem0036

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

sem0036 avatar Apr 28 '20 19:04 sem0036

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 :)

Psy-Fer avatar Apr 29 '20 05:04 Psy-Fer

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

sem0036 avatar Apr 29 '20 22:04 sem0036

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.

Psy-Fer avatar Apr 30 '20 00:04 Psy-Fer

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?

sem0036 avatar Apr 30 '20 18:04 sem0036

Can you show me the command you used for that?

Psy-Fer avatar May 01 '20 00:05 Psy-Fer

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!

Jenny-dan avatar Jun 16 '20 15:06 Jenny-dan

Hello,

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

James

Psy-Fer avatar Jun 16 '20 15:06 Psy-Fer

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.

Psy-Fer avatar Jul 01 '20 10:07 Psy-Fer