originbio-component1 / mutant_constructor.py
Junaidb's picture
Create mutant_constructor.py
54d5049 verified
raw
history blame contribute delete
565 Bytes
def ConstructMutant_using_MutationString(wildtype_sequence,mutation):
digits = [c for c in mutation if c.isdigit()]
actualresidues=[residue for residue in mutation if residue.isalpha()]
digits_to_string="".join(digits)
digits_to_int=int(digits_to_string)
pythonb_index_adjusted_digits=digits_to_int-1
print(pythonb_index_adjusted_digits)
mutated_string=wildtype_sequence[:pythonb_index_adjusted_digits] + actualresidues[1] + wildtype_sequence[pythonb_index_adjusted_digits +1:]
print(mutated_string)
return mutated_string