comparison find_subsequences.py @ 7:99f356eeba15 draft

planemo upload commit 7ff6d582464c6b7183e1acd421272167f8a2433f
author bgruening
date Tue, 05 Apr 2016 15:26:05 -0400
parents 53c20f28562e
children
comparison
equal deleted inserted replaced
6:53c20f28562e 7:99f356eeba15
32 def simple_pattern_search(sequence, pattern, outfile, strand='+'): 32 def simple_pattern_search(sequence, pattern, outfile, strand='+'):
33 """ 33 """
34 Simple regular expression search. This is way faster than the complex search. 34 Simple regular expression search. This is way faster than the complex search.
35 """ 35 """
36 bed_template = '%s\t%s\t%s\t%s\t%s\t%s\n' 36 bed_template = '%s\t%s\t%s\t%s\t%s\t%s\n'
37 for match in re.finditer( str(pattern), str(sequence.seq) ): 37 for match in re.finditer( str(pattern), str(sequence.seq), re.IGNORECASE ):
38 outfile.write(bed_template % (sequence.id, match.start(), match.end(), sequence.description, '', strand)) 38 outfile.write(bed_template % (sequence.id, match.start(), match.end(), sequence.description, '', strand))
39 39
40 40
41 def complex_pattern_search(sequence, pattern, outfile, strand='+'): 41 def complex_pattern_search(sequence, pattern, outfile, strand='+'):
42 """ 42 """