You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
What is Pellagra and explain in detail?
Pellagra  is a disease caused by a lack of the vitamin niacin (vitamin B3). Symptoms include inflamed skin, diarrhea, dementia, and sores in the mouth. Areas of the skin exposed to either sunlight or friction are typically affected first. Over time affected skin may become darker, stiffen, peel, or bleed.There are two main types of pellagra, primary and secondary. Primary pellagra is due to a diet that does not contain enough niacin and tryptophan. Secondary pellagra is due to a poor ability to use the niacin within the diet. This can occur as a result of alcoholism, long-term diarrhea, carcinoid syndrome, Hartnup disease, and a number of medications such as isoniazid. Diagnosis is typically based on symptoms and may be assisted by urine testing.Treatment is with either niacin or nicotinamide supplementation. Improvements typically begin within a couple of days. General improvements in diet are also frequently recommended. Decreasing sun exposure via sunscreen and proper clothing is important while the skin heals. Without treatment death may occur. The disease occurs most commonly in the developing world, often as a disease of poverty associated with malnutrition, specifically sub-Saharan Africa.

Signs and symptoms
The classic symptoms of pellagra are diarrhea, dermatitis, dementia, and death ("the four Ds").
A more comprehensive list of symptoms includes:

Sensitivity to sunlight
Dermatitis (characteristic "broad collar" rash known as casal collar)
Hair loss
Swelling
Smooth, beefy red glossitis (tongue inflammation)
Trouble sleeping
Weakness
Mental confusion or aggression
Ataxia (lack of coordination), paralysis of extremities, peripheral neuritis (nerve damage)
Diarrhea
Dilated cardiomyopathy (enlarged, weakened heart)
Eventually dementiaJ. Frostigs and Tom Spies—according to Cleary and Cleary—described more specific psychological symptoms of pellagra as:

Psychosensory disturbances (impressions as being painful, annoying bright lights, odors intolerance causing nausea and vomiting, dizziness after sudden movements),
Psychomotor disturbances (restlessness, tense and a desire to quarrel, increased preparedness for motor action), as well as
Emotional disturbancesIndependently of clinical symptoms, blood level of tryptophan or urinary metabolites such as 2-pyridone/N-methylniacinamide ratio <2 or NAD/NADP ratio in red blood cells can diagnose pellagra. The diagnosis is confirmed by rapid improvements in symptoms after doses of niacin (250–500 mg/day) or niacin enriched food.

Pathophysiology
Pellagra can develop according to several mechanisms, classically as a result of niacin (vitamin B3) deficiency, which results in decreased nicotinamide adenine dinucleotide (NAD). Since NAD and its phosphorylated NADP form are cofactors required in many body processes, the pathological impact of pellagra is broad and results in death if not treated.
The first mechanism is simple dietary lack of niacin. Second, it may result from deficiency of tryptophan, an essential amino acid found in meat, poultry, fish, eggs, and peanuts that the body uses to make niacin. Third, it may be caused by excess leucine, as it inhibits quinolinate phosphoribosyl transferase (QPRT) and inhibits the formation of niacin or nicotinic acid to nicotinamide mononucleotide (NMN) causing pellagra like symptoms to occur.Some conditions can prevent the absorption of dietary niacin or tryptophan and lead to pellagra. Inflammation of the jejunum or ileum can prevent nutrient absorption, leading to pellagra, and this can in turn be caused by Crohns disease. Gastroenterostomy can also cause pellagra. Chronic alcoholism can also cause poor absorption which combines with a diet already low in niacin and tryptophan to produce pellagra. Hartnup disease is a genetic disorder that reduces tryptophan absorption, leading to pellagra.
Alterations in protein metabolism may also produce pellagra-like symptoms. An example is carcinoid syndrome, a disease in which neuroendocrine tumors along the GI tract use tryptophan as the source for serotonin production, which limits the available tryptophan for niacin synthesis. In normal patients, only one percent of dietary tryptophan is converted to serotonin; however, in patients with carcinoid syndrome, this value may increase to 70%.  Carcinoid syndrome thus may produce niacin deficiency and clinical manifestations of pellagra.  Anti-tuberculosis medication tends to bind to vitamin B6 and reduce niacin synthesis, since B6 (pyridoxine) is a required cofactor in the tryptophan-to-niacin reaction.
Several therapeutic drugs can provoke pellagra.  These include the antibiotics isoniazid, which decreases available B6 by binding to it and making it inactive, so it cannot be used in niacin synthesis, and chloramphenicol; the anti-cancer agent fluorouracil; and the immunosuppressant mercaptopurine.

Treatment
If untreated, pellagra can kill within four or five years. Treatment is with nicotinamide, which has the same vitamin function as niacin and a similar chemical structure, but has lower toxicity. The frequency and amount of nicotinamide administered depends on the degree to which the condition has progressed.

Epidemiology
Pellagra can be common in people who obtain most of their food energy from corn, notably rural South America, where maize is a staple food. If maize is not nixtamalized, it is a poor source of tryptophan, as well as niacin. Nixtamalization corrects the niacin deficiency, and is a common practice in Native American cultures that grow corn, but most especially in Mexico and the countries of Central America. Following the corn cycle, the symptoms usually appear during spring, increase in the summer due to greater sun exposure, and return the following spring. Indeed, pellagra was once endemic in the poorer states of the U.S. South, such as Mississippi and Alabama, where its cyclical appearance in the spring after meat-heavy winter diets led to it being known as "spring sickness" (particularly when it appeared among more vulnerable children), as well as among the residents of jails and orphanages as studied by Dr. Joseph Goldberger.Pellagra is common in Africa, Indonesia, and China. In affluent societies, a majority of patients with clinical pellagra are poor, homeless, alcohol-dependent, or psychiatric patients who refuse food. Pellagra was common among prisoners of Soviet labor camps (the Gulags).  In addition, pellagra, as a micronutrient deficiency disease, frequently affects populations of refugees and other displaced people due to their unique, long-term residential circumstances and dependence on food aid. Refugees typically rely on limited sources of niacin provided to them, often peanuts (which, in Africa, may be supplied in place of local groundnut staples, such as the Bambara or Hausa groundnut); the instability in the nutritional content and distribution of food aid can be the cause of pellagra in displaced populations. In the 2000s, there were outbreaks in countries such as Angola, Zimbabwe and Nepal. In Angola specifically, recent reports show a similar incidence of pellagra since 2002, with clinical pellagra in 0.3% of women and 0.2% of children and niacin deficiency in 29.4% of women and 6% of children related to high untreated corn consumption.In other countries such as the Netherlands and Denmark, even with sufficient intake of niacin, cases have been reported. In this case, deficiency might happen not just because of poverty or malnutrition but secondary to alcoholism, drug interaction (psychotropic, cytostatic, tuberculostatic or analgesics), HIV, vitamin B2 and B6 deficiency, or malabsorption syndromes such as Hartnup disease and carcinoid tumors.

History
Native American cultivators who first domesticated corn (maize) prepared it by nixtamalization, in which the grain is treated with a solution of alkali such as lime. Nixtamalization makes the niacin nutritionally available and prevents pellagra. When maize was cultivated worldwide, and eaten as a staple without nixtamalization, pellagra became common.
Pellagra was first described for its dermatological effect in Spain in 1735 by Gaspar Casal. He explained that the disease causes dermatitis in exposed skin areas such as hands, feet and neck and that the origin of the disease is poor diet and atmospheric influences. His work published in 1762 by his friend Juan Sevillano was titled Historia Natural y Medicina del Principado de Asturias or Natural and Medical History of the Principality of Asturias (1762). This led to the disease being known as "Asturian leprosy", and it is recognized as the first modern pathological description of a syndrome. It was an endemic disease in northern Italy, where it was named, from Lombard, as "pell agra" (agra = holly-like or serum-like; pell = skin) by Francesco Frapolli of Milan. With pellagra affecting over 100,000 people in Italy by the 1880s, debates raged as to how to classify the disease (as a form of scurvy, elephantiasis or as something new), and over its causation. In the 19th century, Roussel started a campaign in France to restrict consumption of maize and eradicated the disease in France, but it remained endemic in many rural areas of Europe. Because pellagra outbreaks occurred in regions where maize was a dominant food crop, the most convincing hypothesis during the late 19thcentury, as espoused by Cesare Lombroso, was that the maize either carried a toxic substance or was a carrier of disease. Louis Sambon, an Anglo-Italian doctor working at the London School of Tropical Medicine, was convinced that pellagra was carried by an insect, along the lines of malaria. Later, the lack of pellagra outbreaks in Mesoamerica, where maize is a major food crop, led researchers to investigate processing techniques in that region.

Pellagra was studied mostly in Europe until the late 19th century when it became epidemic especially in the southern United States. In the early 1900s, pellagra reached epidemic proportions in the American South. Between 1906 and 1940 more than 3 million Americans were affected by pellagra with more than 100,000 deaths, yet the epidemic resolved itself right after dietary niacin fortification. Pellagra deaths in South Carolina numbered 1,306 during the first ten months of 1915; 100,000 Southerners were affected in 1916. At this time, the scientific community held that pellagra was probably caused by a germ or some unknown toxin in corn. The Spartanburg Pellagra Hospital in Spartanburg, South Carolina, was the nations first facility dedicated to discovering the cause of pellagra. It was established in 1914 with a special Congressional appropriation to the U.S. Public Health Service (PHS) and set up primarily for research. In 1915, Dr. Joseph Goldberger, assigned to study pellagra by the Surgeon General of the United States, showed it was linked to diet by observing the outbreaks of pellagra in orphanages and mental hospitals.  Goldberger noted that children between the ages of 6 and 12 (but not older or younger children at the orphanages) and patients at the mental hospitals (but not doctors or nurses) were the ones who seemed most susceptible to pellagra. Goldberger theorized that a lack of meat, milk, eggs, and legumes made those particular populations susceptible to pellagra.  By modifying the diet served in these institutions with "a marked increase in the fresh animal and the leguminous protein foods," Goldberger was able to show that pellagra could be prevented. By 1926, Goldberger established that a diet that included these foods, or a small amount of brewers yeast, prevented pellagra.
Goldberger experimented on 11 prisoners (one was dismissed because of prostatitis). Before the experiment, the prisoners were eating the prison fare fed to all inmates at Rankin Prison Farm in Mississippi. Goldberger started feeding them a restricted diet of grits, syrup, mush, biscuits, cabbage, sweet potatoes, rice, collards, and coffee with sugar (no milk). Healthy white male volunteers were selected as the typical skin lesions were easier to see in Caucasians and this population was felt to be those least susceptible to the disease, and thus provide the strongest evidence that the disease was caused by a nutritional deficiency. Subjects experienced mild, but typical cognitive and gastrointestinal symptoms, and within five months of this cereal-based diet, 6 of the 11 subjects broke out in the skin lesions that are necessary for a definitive diagnosis of pellagra. The lesions appeared first on the scrotum. Goldberger was not given the opportunity to experimentally reverse the effects of diet-induced pellagra as the prisoners were released shortly after the diagnoses of pellagra were confirmed. In the 1920s, he connected pellagra to the corn-based diets of rural areas rather than infection as contemporary medical opinion would suggest. Goldberger believed that the root cause of pellagra amongst Southern farmers was limited diet resulting from poverty, and that social and land reform would cure epidemic pellagra. His reform efforts were not realized, but crop diversification in the Southern United States, and the accompanying improvement in diet, dramatically reduced the risk of pellagra. Goldberger is remembered as the "unsung hero of American clinical epidemiology". Though he identified that a missing nutritional element was responsible for pellagra, he did not discover the specific vitamin responsible.
In 1937, Conrad Elvehjem, a biochemistry professor at the University of Wisconsin-Madison, showed that the vitamin niacin cured pellagra (manifested as black tongue) in dogs. Later studies by Dr. Tom Spies, Marion Blankenhorn, and Clark Cooper established that niacin also cured pellagra in humans, for which Time Magazine dubbed them its 1938 Men of the Year in comprehensive science.Research conducted between 1900 and 1950 found the number of cases of women with pellagra was consistently double the number of cases of affected men. This is thought to be due to the inhibitory effect of estrogen on the conversion of the amino acid tryptophan to niacin. Some researchers of the time gave a few explanations regarding the difference.Gillman and Gillman related skeletal tissue and pellagra in their research in South Africans. They provide some of the best evidence for skeletal manifestations of pellagra and the reaction of bone in malnutrition. They claimed radiological studies of adult pellagrins demonstrated marked osteoporosis. A negative mineral balance in pellagrins was noted, which indicated active mobilization and excretion of endogenous mineral substances, and undoubtedly impacted the turnover of bone. Extensive dental caries were present in over half of pellagra patients. In most cases, caries were associated with "severe gingival retraction, sepsis, exposure of cementum, and loosening of teeth".

Etymology
The word pellagra comes from the Lombard words "pell" (skin) and "agra" (fem. sour).

United States
Pellagra was first reported in 1902 in the United States, and has "caused more deaths than any other nutrition-related disease in American history", reaching epidemic proportions in the American South during the early 1900s. Poverty and consumption of corn were the most frequently observed risk factors, but the exact cause was not known, until groundbreaking work by Joseph Goldberger. A 2017 National Bureau of Economic Research paper explored the role of cotton production in the emergence of disease; one prominent theory is that "widespread cotton production had displaced local production of niacin-rich foods and driven poor Southern farmers and mill workers to consume milled Midwestern corn, which was relatively cheap but also devoid of the niacin necessary to prevent pellagra." The study provided evidence in favor of the theory: there were lower pellagra rates in areas where farmers had been forced to abandon cotton production (a highly profitable crop) in favor of food crops (less profitable crops) due to boll weevil infestation of cotton crops (which occurred randomly).The whole dried corn kernel contains a nutritious germ and a thin seed coat that provides some fiber. There are two important considerations for using ground whole-grain corn.

The germ contains oil that is exposed by grinding, thus whole-grain cornmeal and grits turn rancid quickly at room temperature and should be refrigerated.
Whole-grain cornmeal and grits require extended cooking times as seen in the following cooking directions for whole-grain grits:"Place the grits in a pan and cover them with water. Allow the grits to settle a full minute, tilt the pan, and skim off and discard the chaff and hulls with a fine tea strainer. Cook the grits for 50 minutes if the grits were soaked overnight or else 90 minutes if not."
Most of the niacin in mature cereal grains is present as niacytin, which is niacin bound up in a complex with hemicellulose which is nutritionally unavailable. In mature corn this may be up to 90% of the total niacin content. The preparation method of nixtamalization using the whole dried corn kernel made this niacin nutritionally available and reduced the chance of developing pellagra. Niacytin is concentrated in the aleurone and germ layers which are removed by milling. The milling and degerming of corn in the preparation of cornmeal became feasible with the development of the Beall degerminator, which was originally patented in 1901 and was used to separate the grit from the germ in corn processing. However, this process of degermination reduces the niacin content of the cornmeal.
Casimir Funk, who helped elucidate the role of thiamin in the etiology of beriberi, was an early investigator of the problem of pellagra