Commit 56ae4986 authored by Pauline Pommeret's avatar Pauline Pommeret
Browse files

[trx] Adding 72 central bp feature to match()

parent bdcb8913
......@@ -43,17 +43,27 @@ def pair_score(string, TRX):
return TRX[max(potential)]
def match(sequence, TRX):
def match(sequence, TRX, center=False):
"""
Translates a raw ``sequence`` into a list of values of ``TRX``.
Position i studies phosphate between nlt i and i+1
72 pb center
"""
sequence_TRX = {}
# Use of str(sequence) instead of sequence.tostring() because the
# documentation says so nowaday (25/11/2014)
sequence = str(sequence)
for position in xrange(0, len(sequence)-1):
if center:
length = 72
offset = int((len(sequence) - length)/2)
else:
length = len(sequence) - 1
offset = 0
for position in xrange(offset, offset+length):
if position == 0:
sequence_TRX[position] = pair_score(sequence[position:position+2], TRX)
elif position == len(sequence)-2:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment