I have a string that holds nucleotide values. I want to mark all nucleotides on this string with 0 and 1. Here the A G C T values can be in any position.
for example
str = 'AGCTAGG'
and I want to keep an extra value on this string that I can change later.
initially 0 assigned to all values:
new-str = {A:0,G:0,C:0,T:0,A:0,G:0,G:0}
Later I want to assign 1 to nucleotide that I want:
new-str = {A:1,G:0,C:1,T:0,A:0,G:1,G:0}
The letters will be kept in the order in the string.
What is the best method that I can use here?
Also the defaultdict didn't give me what I wanted.
dict
defaultdict
hashmap