I have 2 lists, list1
and list2
, of protein sequences of the same given gene in different strains. In list1
are reported amino-acid sequences from resistant strains, and in list2
are reported amino-acid sequences from susceptible strains. Each item of each list is an amino-acid sequence.
I want to filter out (in Python 3) from list1
all of the variants that are also present in list2
. The final aim is to have a list of the sequences that have unique mutations that are not in the 2nd list. The mutations can be of any type (e.g., indels, mismatches).
All the sequences are of at least 90% identity to some reference sequence (filtered out the low matches using seq alignment).
Any enlightenment / package / tool for this job will be appreciated!
Toy example:
a
, b
, c
: amino-acids
For this input:
- Reference seq:
aaabbb
- Resistant strains:
list1
= [aacbbc, ababbb] - Susceptible strains:
list2
= [aacbbb, aaabbc]
The expected output would be: [ababbb], since the mutations in list2
cancels out the item aacbbc.
Of course this is a simple example and it is possible to have more complex scenarios (e.g., longer indels and mismatches).