How much does a single mutation/alteration of a nucleotide affect the presence of a transcription factor binding site (TFBS)? I am from computer science background(Obviously). I want to make a general assumption about the number of mutated bases in a TFBS to minimize the binding affinity?
I haven't worked on TFBSs but I really, really doubt you will be able to do this. In mutations, like in real estate, it's location, location, location. It isn't a question of how many mutations but what mutations and where. TFBSs are usually described using position weight matrices, precisely because that's how you can show the importance of different changes in different positions.
Here are a couple of random Google image search results for "transcription factor binding sites logo":
(This was taken from here and you might want to read through it.)
(source: Front. Genet., 23 February 2016 | https://doi.org/10.3389/fgene.2016.00024)
The main take home messages from these images are:
Different positions have different importance and potential to disrupt binding. In the first image, I would expect that changing the T at position -3 to anything else would be pretty bad. However, changing an A to a T at -8 would likely be neutral.
Different TFs have very different binding sites and very different binding site lengths. Look at panel B of the second image. That one appears to be a very conservative site and likely any change would be deleterious. Conversely, changing any of the nucleotides of the 17bp spacer shown in panel A would likely not be important as long as you don't change the length.
Please note that I have not done more than glance at the sources I took these from, so my inferences may well be wrong, I only use them to illustrate the general point: you cannot really put a number to this. You will always need to look at each specific change and each specific position. In some cases, a single change can disrupt binding while in others multiple changes might have no effect at all.
You might want to look into TFBS databases like JASPAR or TRANSFAC.
Every motif has a score. The score is calculated from the number of times each base was observed in that motif in the genome (I'm not sure how exactly these are calculated). Higher numbers indicate that this motif was found more frequently, which we take as a proxy for it providing better binding.
The Ensembl VEP can give you the score change for a mutated motif in the output, so this may be the easiest way to analyse this.
The motifbreakR package for R I believe does something like what you want to do;
If you're looking for a general rule as to what kind of mutations/where in the motif mutations will significantly affect motif binding, I suggest generating a lot of sequences with simulated SNP's (single nucleotide polymorphisms) and seeing how these score against the particular motif. Then, you will have a large(ish) database of sequences with one base pair difference from the motif and their corresponding score. This will allow you to judge what kinds of mutations affect the score the most.
Furthermore, you could somehow make a distribution of scores versus mutations and generate an empirical p-value to determine statistical significance (for instance, such and such mutation caused a score that was in the lowest 5% of scores for all mutations). You would know better than me how to do this, since your background is in CS and my PhD subject is genetics.
To make an assumption about the number of bases that need to be mutated, do this for one, two, three, etc. simulated SNP's.