Spaces:
Sleeping
Sleeping
Create mutant_constructor.py
Browse files- mutant_constructor.py +13 -0
mutant_constructor.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def ConstructMutant_using_MutationString(wildtype_sequence,mutation):
|
| 2 |
+
|
| 3 |
+
digits = [c for c in mutation if c.isdigit()]
|
| 4 |
+
actualresidues=[residue for residue in mutation if residue.isalpha()]
|
| 5 |
+
digits_to_string="".join(digits)
|
| 6 |
+
digits_to_int=int(digits_to_string)
|
| 7 |
+
|
| 8 |
+
pythonb_index_adjusted_digits=digits_to_int-1
|
| 9 |
+
print(pythonb_index_adjusted_digits)
|
| 10 |
+
|
| 11 |
+
mutated_string=wildtype_sequence[:pythonb_index_adjusted_digits] + actualresidues[1] + wildtype_sequence[pythonb_index_adjusted_digits +1:]
|
| 12 |
+
print(mutated_string)
|
| 13 |
+
return mutated_string
|