Skip to content
Snippets Groups Projects
Unverified Commit 23e5ef2a authored by touzet's avatar touzet Committed by GitHub
Browse files

Bug on helical position fixed

parent 260e6b0b
No related branches found
No related tags found
No related merge requests found
......@@ -20,15 +20,10 @@ def Pmask_distance(seq1, seq2):
return -1
r=0
for c1, c2 in zip(seq1, seq2):
match (c1,c2):
case ('P', 'P'):
if c1=='P' and c2=='P':
None
case ('P',_) :
elif c1=='P'or c2=='P':
r=r+1
case (_,'P'):
r=r+1
case _:
None
return r
def find_markers_single_sequence(seq, set_of_digested_peptides, dict_of_model_markers, set_of_markers):
......@@ -40,7 +35,6 @@ def find_markers_single_sequence(seq, set_of_digested_peptides, dict_of_model_ma
# for each marker of dict_of_model_markers (characterized by a *code*) find the best location in the sequence seq.
# output: set of markers
helical_start=sequences.helical_region(seq)[0]
set_of_found_codes=set() # contains the set of codes for model markers found in the current sequence
set_of_raw_digested_peptides={pep.sequence() for pep in set_of_digested_peptides}
......@@ -97,7 +91,6 @@ def find_markers_single_sequence(seq, set_of_digested_peptides, dict_of_model_ma
elif d<found_markers[code][1] or (d==found_markers[code][1] and d2<found_markers[code][2]):
found_markers[code]=(pos,d,d2, marker_seq)
for code in found_markers:
(pos,d,d2, marker_seq)=found_markers[code]
l=len(marker_seq)
......@@ -114,6 +107,7 @@ def find_markers_single_sequence(seq, set_of_digested_peptides, dict_of_model_ma
dict["Sequence"]=new_sequence
dict["Begin"]= pos+1
dict["Length"]=l
print("Helical start"+str(helical_start)+" / start"+str(pos) )
if helical_start is not None and pos>helical_start:
dict["Hel"]=pos-helical_start+2
dict["End"]=pos+l
......@@ -162,6 +156,8 @@ def check_helix_position(set_of_markers, set_of_new_markers):
for m in set_of_new_markers:
if m.helical() is None:
set_of_dubious_markers.add(m)
elif m.code() not in dict_codes:
continue
elif m.helical()==dict_codes[m.code()]:
m=markers.post_comment(m,"Expected position in helical region. ")
set_of_correct_sequences.add(m.sequence())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment