I've found some database on the internet that list all discovered antigens and their epitopes. So how do scientists discover a new antigen? Do they try to inject them into the body to see if it causes an immune response or not? And finally if it's an antigen, how do they know their epitopes?
Okay, you have a few questions building on top of each other (rephrased the questions for clarity):
How do scientists discover a new antigen?
There are multiple ways to this, which are applied for different purposes.
In order to discover a natural antigen, which is recognised by an antibody normally produced by the immune system, one would first have get hold of this specific antibody. This would be an approach to reproduce or understand the effective response of the immune system against a pathogen (e.g. a virus).
In order to get hold of the antibody (and ideally the coding DNA sequence for it), researchers have to use the pathogen, or parts of it and find the antibodies (or B cells) that bind to it. To do this the pathogen (particles) could be fixed to a column and after running blood through the column the respective antibodies and B cells will remain in the column. Then the DNA of these cells can be sequences, or the antibody can be further purified.
In most cases however, scientists want to find a not-yet existing antibody against an antigen, which leads us to:
Do scientists try to inject antigens to the body to see if it causes an immune response or not?
Yes, this is done - but only with animals (mostly rats, rabbits & goats). Polyclonal antibodies can be extracted directly from the blood of these animals, but most often monoclonal antibodies are needed for research or medical purposes. The process required for these is much more complicated, but leads to a cell lines which can then be used to produce the desired antibody in greater quantities.
How do scientists know the corresponding epitope to an antibody?
There are multiple ways to find the exact epitope of an antibody, all of which are commonly described as epitope mapping.
The most common methods are based either on site-directed mutagenesis of the antigen to see which positions (amino acids) are crucial for binding of the antibody, or on peptide fragments of the antigen, which can still be bound by the antibody.
I would like to just add to Nicolai answer.
What is an antigen ?
First, and Nicolai said this, but I just want to make it clear, an antigen is anything that antibodies bind. That is distinct from and immunogen which is a type of antigen that causes your immune system to produce antibodies. But an antigen does not necessarily have to be an immunogen.
Peptides, sugars, nucleic acids and lipids are all common antigens, but peptides are probably what you would be most familiar with. Usually, most sugars and lipids have a hard time producing an immune response on their own and generally are coupled with a protein (peptide). This makes sense because your body naturally produces lots of sugars and lipids and if you made antibodies to all of them, it would end up attacking itself.
How is an antigen discovered?
There are two ways to approach this.
- Antibody First Approach
Let's say a person get's infected with some unknown virus but ends up surviving. The next step would be to do two things:
Culture the virus so scientist can study it in the lab. You need to culture most virus so you can grow an unlimited amount in vitro. It would be a really tough task to go out and naturally find all the virus you needed to study.
Genotype the virus. It is necessary to know the viral genome so we can manipulate the genes and see what their effect is.
We can start making changes of the virus changing various components of the genome. We could see how that changes binding to the patient's serum.Since the serum contains antibodies that will bind the virus, the serum will often neutralise or test positive for binding antibodies. Now if we change gene A from the virus and the serum still binds/neutralises, we can assume gene A is not the antigen which made an immune response in the patient. If gene B is mutated and the serum stops binding, we can assume gene B is the antigen of the unknown virus.
- Antigen first approach
If we only have the virus and don't have an infected patient, then we would have to inject it into model organisms to find out the antigen. However, since we know an incredible amount of viral species we can probably make a best guess on what the antigen component of the virus is.
For instance, in 2012, when a patient fell ill, they sequenced a virus in them which was found to be a close relative to Coronavirus. Since they know that Coronavirus primary antigen is its spike protein, they rightly assumed that the gene that was closely related to the spike protein of the unknown virus was also the primary antigen. That virus turned out to be Middle East respiratory syndrome coronavirus which the main antigen is the spike protein.