import Fast5File
import sys

def run(parser, args):

	for fast5 in Fast5File.Fast5FileSet(args.files):

		if args.start_time or args.end_time:
			read_start_time = fast5.get_start_time()
			read_end_time = fast5.get_end_time()
			if args.start_time and args.start_time > read_start_time:
				fast5.close()
				continue
			if args.end_time and args.end_time < read_end_time:
				fast5.close()
				continue

		fas = fast5.get_fastas(args.type)
		
		# high quality 2D: means there are more nanopore events on the 
		# complement strand than on the template strand. We also
		# require there to be a 2D base-called sequence from Metrichor.
		if args.high_quality:
			if (fast5.get_complement_events_count() <= \
			   fast5.get_template_events_count()) or not fast5.has_2D():
				fast5.close()
				continue

		# norem quality 2D : means there are less (or equal) nanopore 
		# events on the complement strand than on the template strand. 
		# We also require there to be a 2D base-called sequence from Metrichor.
		if args.normal_quality:
			if (fast5.get_complement_events_count() > \
			   fast5.get_template_events_count()) or not fast5.has_2D():
				fast5.close()
				continue

		for fa in fas:
			if fa is None or \
			len(fa.seq) < args.min_length:			
				continue

			print fa

		fast5.close()


@@ -1242,16 +1242,83 @@
 n_length
+ or %5C%0A%09%09%09len(fa.seq) %3E args.max_length and %5C%0A%09%09%09args.max_length %3E 0
 :%09%09%09%0A%09%09%09
@@ -1322,24 +1322,27 @@
 %09%09%09%09continue
+%09%09%09
 %0A%0A%09%09%09print f

Update fasta.py