Debian Codegraph @

poretools/times.py

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 from . import Fast5File
2 from time import strftime, localtime
3 import sys
4
5 #logging
6 import logging
7 logger = logging.getLogger('poretools')
8
9 def run(parser, args):
•10 print('\t'.join(['channel', 'filename', 'read_length',
11 'exp_starttime', 'unix_timestamp', 'duration',
12 'unix_timestamp_end', 'iso_timestamp', 'day',
•13 'hour', 'minute']))
14
15 for fast5 in Fast5File.Fast5FileSet(args.files):
16 if fast5.is_open:
17
18 fq = fast5.get_fastq()
19
20 start_time = fast5.get_start_time()
21 if start_time is None:
22 logger.warning("No start time for %s!" % (fast5.filename))
23 fast5.close()
24 continue
25
26 if fq is not None:
27 read_length = len(fq.seq)
28 else:
29 read_length = 0
30
31 lt = localtime(start_time)
•32 print("\t".join([str(fast5.get_channel_number()),
33 str(fast5.filename),
34 str(read_length),
35 str(fast5.get_exp_start_time()),
36 str(start_time), \
37 str(fast5.get_duration()),
38 str(fast5.get_end_time()),
39 strftime('%Y-%m-%dT%H:%M:%S%z', lt),
40 strftime('%d', lt),
41 strftime('%H', lt),
•42 strftime('%M', lt)]))
43 fast5.close()