arq5x / poretools

a toolkit for working with Oxford nanopore data
MIT License
239 stars 90 forks source link

Poretools not finding start times for 1D data #127

Open aminards opened 7 years ago

aminards commented 7 years ago

I am working with MinION data generated in December 2016. Trying to run poretools times and get the warning message: poretools:No start time for .....fast5! This data was generated with MinKnow version 1.1.21 so it doesn't seem that the latest update to poretools should fix my problem. I am using poretools 0.6.0. Any ideas on what the problem is?

The command I am using is: poretools times /home/smith/pass

nickloman commented 7 years ago

Try the very latest HEAD release (i.e. download from Github).

aminards commented 7 years ago

Thank you for the suggestion to install the latest HEAD release. Unfortunately, this gives me a different error when I try to run times. Below is the result of running poretools times. What do I need to change?

poretools times /home/smith/Small-subset-of-FAST5-files channel filename read_length exp_starttime unix_timestamp duration unix_timestamp_end iso_timestamp day hour minute Traceback (most recent call last): File "/userSoftware/poretools-20170306/install/bin/poretools", line 9, in load_entry_point('poretools==0.6.0', 'console_scripts', 'poretools')() File "/userSoftware/poretools-20170306/install/lib/python2.7/site-packages/poretools-0.6.0-py2.7.egg/poretools/poretools_main.py", line 538, in main args.func(parser, args) File "/userSoftware/poretools-20170306/install/lib/python2.7/site-packages/poretools-0.6.0-py2.7.egg/poretools/poretools_main.py", line 55, in run_subtool submodule.run(parser, args) File "/userSoftware/poretools-20170306/install/lib/python2.7/site-packages/poretools-0.6.0-py2.7.egg/poretools/times.py", line 42, in run strftime('%M', lt)]) TypeError: sequence item 0: expected string, int found

aminards commented 7 years ago

We ended up fixing the problem. One of the elements in the join call was an int and it seems that join only joins strings. Here is the fix that got it working for me:

diff -u times.py.02170417 times.py
--- times.py.20170417   2017-04-05 16:31:34.103550000 -0400
+++ times.py    2017-04-17 11:03:57.174007269 -0400
@@ -29,7 +29,8 @@
                                read_length = 0

                        lt = localtime(start_time)
-                       print "\t".join([fast5.get_channel_number(),
+                       print "\t".join( [
+                                str( fast5.get_channel_number() ),
                                fast5.filename,
                                str(read_length),
                                str(fast5.get_exp_start_time()),
@@ -39,5 +40,6 @@
                                strftime('%Y-%m-%dT%H:%M:%S%z', lt),
                                strftime('%d', lt),
                                strftime('%H', lt),
-                               strftime('%M', lt)])
+                               strftime('%M', lt)
+                                ] )
                        fast5.close()
``
eburgueno commented 7 years ago

Hello, we had the same issue with some of our data. I can confirm that @aminards fix above solves the problem.

morgancolp commented 7 years ago

Hi, We are having the same issue @aminards was prior to the installation of HEAD. We had the latest version of HEAD installed on our server but we haven't got to the next error (the one fixed by modifying the python script), we're still on the previous one. Is there anything we have to do to point poretools to the new version of HEAD, or anything like that? Or is something else also going wrong?

sarah872 commented 6 years ago

times_changed.txt

I am having the same problem. Could someone upload the updated times.py please? I cannot get it working...