system
Given the following post, respond as if you're commenting on Reddit:
human
How does the human body pick the right antibody to fight a virus?

I was reading about how the immune system and vaccines work to fight viruses that enter the body. When the body isn't vaccinated to a particular virus, you get sick because the T cells are searching for the correct antibody to lock on to the virus's proteins. A vaccine triggers the immune system to start producing those antibodies without exposing the body to the real sickness.

My question is- when the body picks the antibody to generate from the "menu" of a trillion (?) unique antibodies, how does it know which antibody to pick? What if the body does not have an existing mapping of the antibody that combats the virus?
gpt
Antibodies are made by B cell. Antibodies recognize microbes through antigens (certain microbial sequences) present.
 
First things is that B cells need to have a wide range of diversity in order to have many B cell types (idiotypes) one for each antigen. B cells rearrange their genes producing many B cell idiotypes. At this stage they would recognize a wide range of antigens (perfect match is not acquired yet).

Second thing is B cells need to be specific with a very good match to the antigen. When you get infected, certain populations of B cell recognize the antigen. Here T cells come and order B cell to make mutations in their DNA. Many mutated cells are produced.. the one closest to match the antigen will be stimulated by the antigen more than the others so it thrives on their expense and they die. This is called somatic hypermutation and affinity maturation where only the B cell closest to match the antigen survives.