Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,6 +59,7 @@ def find_new_boundary_repeats(fragments, final_repeats, overlap=50):
|
|
59 |
def process_protein_sequence(sequence, analysis_type, overlap=50):
|
60 |
fragments = fragment_protein_sequence(sequence)
|
61 |
final_repeats = defaultdict(int)
|
|
|
62 |
for fragment in fragments:
|
63 |
if analysis_type in ["Hetero", "Both"]:
|
64 |
fragment_repeats = find_hetero_amino_acid_repeats(fragment)
|
@@ -70,9 +71,15 @@ def process_protein_sequence(sequence, analysis_type, overlap=50):
|
|
70 |
for k, v in new_repeats.items():
|
71 |
final_repeats[k] += v
|
72 |
if analysis_type in ["Homo", "Both"]:
|
73 |
-
|
74 |
-
for k, v in
|
75 |
final_repeats[k] += v
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
return final_repeats
|
77 |
|
78 |
def process_excel(excel_data, analysis_type):
|
|
|
59 |
def process_protein_sequence(sequence, analysis_type, overlap=50):
|
60 |
fragments = fragment_protein_sequence(sequence)
|
61 |
final_repeats = defaultdict(int)
|
62 |
+
homo_repeats = {}
|
63 |
for fragment in fragments:
|
64 |
if analysis_type in ["Hetero", "Both"]:
|
65 |
fragment_repeats = find_hetero_amino_acid_repeats(fragment)
|
|
|
71 |
for k, v in new_repeats.items():
|
72 |
final_repeats[k] += v
|
73 |
if analysis_type in ["Homo", "Both"]:
|
74 |
+
homo_repeats = find_homorepeats(sequence)
|
75 |
+
for k, v in homo_repeats.items():
|
76 |
final_repeats[k] += v
|
77 |
+
if analysis_type == "Hetero" or "Both":
|
78 |
+
for k, v in homo_repeats.items():
|
79 |
+
if k in final_repeats:
|
80 |
+
final_repeats[k] -= v
|
81 |
+
if final_repeats[k] <= 0:
|
82 |
+
del final_repeats[k]
|
83 |
return final_repeats
|
84 |
|
85 |
def process_excel(excel_data, analysis_type):
|