We know there are 20 Amino Acids('A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y').
Now my query sequence is like: KAQTAHIVLEDGTKMKGYSFGHPSSVA of length 27 and "K" is in the center of the sequence. That means 13 amino acids are at the left of K and the other 13 are at the right of K.
It can be represented as: P(K)=R-13R-12R-11R-10R-9R-8R-7R-6R-5R-4R-3R-2R-1KR+1R+2R+3R+4R+5R+6R+7R+8R+9R+10R+11R+12R+13.
Where "-" notation is for left and "+" notation is for right.
Now what is the conditional probability of R-13 given that its closest neighbor is R-12? I mean P-13(R-13|R-12)=?
And what is the non conditional probability of R-1? or P-1(R-1)=?
I am confused at this point as I can not understand how to calculate the probability in this case. And it would be very helpful if anyone provided me python code for calculating conditional probability mentioned above.