categorical/count independent variable in regression I have a variable snpA that is the genotype of a particular polyorphism of a patient genomic region. Let's say the genotype can be A or B and everyone has 2 copies, patients can be AA, AB, BB. I have to insert this variable to understand its effect on a poisson regression model:
glm(CAs ~ Age + Exposure + C(snpA), family = poisson(), data = db)

I am wondering this is a correct way of considering the effect of snpA as the idea is that the AA patients are protected, AB are at low risk and BB are at high risk. Or it would be more advisable to treat it in some continuous or random effect way? It would be advisable to use it as a random effect?
 A: Since you say :

the effect of snpA as the idea is that the AA patients are protected, AB are at low risk and BB are at high risk.

this implies that you should fit snpA as a fixed effect, not random. Besides, since it has only 3 levels and the levels you have are the total population of such levels for that genotype, it would not make much sense to consider it as random.
Your model:

glm(CAs ~ Age + Exposure + C(snpA), family = poisson(), data = db)


seems to be correct, for your research question, however it would be more standard to write it as:

glm(CAs ~ Age + Exposure + snpA, family = "poisson", data = db)


You mention in comments to the question that 

probably due to numeric problems for the groups the p is significant only for group AB and not BB. I was wondering if there was some other method to insert them in such cases.

To answer your research question, "the effect of snpA" you should centre your attention on the effect size - ie, the estimates for each level of snpA, and not on the p-values. p-values are a function of sample size and if you have a very small sample for some levels then it is quite likely that your study did not have sufficient power in order to detect a "significant" effect. For this reason it is always a good idea to conduct a power analysis prior to collecting data. 
