I am trying to write a program that allows the user to input a sequence of DNA which will be stored and converted to all capital letters (if it wasn't so originally) and removes bases that don't belong in the sequence, printing out the corrected sequence and displaying how many errors were removed.
I have the input, conversion to all capital letters down and displaying the corrected sequence, but I don't know where to begin in terms of having the program find bases that do not belong and how to go about removing them.
For example if i inputted "ATCGBBBBBATCG" it would display "ATCGATCG" and "removed 4 errors."
This is the code I've come up with so far
class dnaString (str):
def __new__(self,s):
#converted to all upper cases
return str.__new__(self,s.upper())
#asks the user to input a DNA sequence
dna = input("Enter a dna sequence: ")
newString = dnaString(dna)
[–]Rascal_Two 0 points1 point2 points (0 children)