Skip to content
Snippets Groups Projects
Commit e75d9ee8 authored by Léo Schneider's avatar Léo Schneider Committed by Schneider Leo
Browse files

cutting routine

parent 7803c43a
No related branches found
No related tags found
No related merge requests found
...@@ -31,11 +31,24 @@ def cut(seq, format): ...@@ -31,11 +31,24 @@ def cut(seq, format):
for i in range(l): for i in range(l):
if seq[i] == 'A' or seq[i] == 'L': if seq[i] == 'A' or seq[i] == 'L':
if i < l - 1 and seq[i + 1] != 'P': if i < l - 1 and seq[i + 1] != 'P':
cuts.append(i) cuts.append(i + 1)
if format == 'numerical': if format == 'numerical':
for i in range(l): for i in range(l):
if seq[i] == 1 or seq[i] == 10: if seq[i] == 1 or seq[i] == 10:
if i < l - 1 and seq[i + 1] != 13: if i < l - 1 and seq[i + 1] != 13:
cuts.append(i) cuts.append(i + 1)
return cuts return cuts
def cut_with_ind(seq, ind_list):
l = []
size = len(seq)
ind_list.append(size)
for i in range(len(ind_list) - 1):
if i == 0:
l.append(seq[:ind_list[i]])
l.append(seq[ind_list[i]:ind_list[i + 1]])
return l
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment