I would like to remove a row from my file if it contains a letter other than A, C, G, or T. So that [‘TC’, ‘CY’, ‘GS’, ‘GA’, ‘CT’] will become [‘TC’, ‘GA’, ‘CT’].
The files will have an unknown number of rows and will contain patterns of 2 or more letters in any order. In addition, I do not know the other letters that are present (Y or S or something else).
How would I go about setting up a program for this preferably in Python? I already can import my file and read the rows.
Thanks!
You can solve it with a simple regular expression and a list comprehension.