The study was conducted in Mwanza City, North-western Tanzania from April 2007 to March 2009. The study was a part of a TB and nutrition study (ClinicalTrials.org, registration number NCT00311298) in which pulmonary TB (PTB) patients were treated according to the national guidelines for TB  and randomized to receive micronutrients and energy-protein supplements in different amounts.
The patients were treated according to national guidelines. In Tanzania, HIV testing is offered as part of the routine medical management of TB patients  in line with the UNAIDS statement 2004 . The HIV prevalence among incident TB cases is estimated to be 47% (year 2007) . Antiretroviral treatment is available for HIV patients and is prescribed in accordance with WHO guidelines [15, 16]. Prophylactic P. jirovecii treatment of HIV-positive adults with co-trimoxazole is offered to WHO stage 3 (which includes PTB) patients, to patients with symptomatic HIV disease and to asymptomatic HIV-positive individuals with CD4 count <200 cells per mm3 .
Patient recruitment and eligibility
PTB patients diagnosed at two hospitals and two health centres and about to start treatment under the national TB programme were approached for participation in the study. Exclusion criteria were: age below 15 years, pregnancy, terminal illness (judged unlikely to survive for 48 hours), and not staying in Mwanza for the entire 5 month follow-up period. Patients who did not show up for 5 month follow-up and could not be traced were considered as defaulted.
One household contact and one neighbourhood control was recruited for each sputum smear-positive TB patient. With the acceptance from the PTB patient, staff from the study team visited the house of the PTB patient and chose a participant by lot among the eligible household members. Lot-selected sex- and age-matched neighbourhood controls were identified with the assistance of the local ten-cell-leaders among eligible residents of the area.
The national ethics committees in Denmark and Tanzania approved the study. All participants were informed orally in their local tongue (Kiswahili or Sukuma language) and in writing (Kiswahili) before written consent were obtained and they were free to withdraw from the study at any time. Pre-HIV test counselling was provided to the study subjects. All study subjects who were tested for HIV received post-HIV test counselling regardless of the result. If the HIV test was positive the subject was referred to the local HIV programme.
All patients produced three sputum samples, of which at least one was a morning sample, for microscopic examination after Ziehl-Neelsen staining. As part of this study, an extra sample was obtained for control microscopy (Auramine-O staining) and culture on Lowenstein-Jensen solid media at the Zonal Reference Laboratory at Bugando Medical Centre.
PTB positive patients had a positive culture and/or microscopy positive result. PTB negative patients had a negative culture and were found negative by microscopy but were considered eligible for TB treatment on clinical suspicion and chest X-ray, often after lack of improvement following two weeks of presumptive broad spectrum antibiotic treatment. The choices of antibiotics varied and a presumptive curative treatment was expected to cure bacterial pneumonia.
HIV testing and CD4 counts
HIV testing was performed using Determine HIV 1/2 (Inverness Medical Innovations, Inc., Delaware, USA) and Capillus HIV-1/HIV-2 (Trinity Biotech Plc., Wicklow, Ireland). If discordance was found between the two tests a confirmatory ELISA test was performed (Organon Uniform II, Organon Teknia, NL). CD4 cell count was determined using Partec Cyflow counter (Partec, GmbH, Münster, FRG).
Oral wash specimens
All patients enrolled in the study had the oral wash procedure performed within the first week of diagnosis and treatment initiation of TB. The controls had the oral wash procedure performed at the same day as all other measurements were taken. The participants were fasting since midnight and were asked to postpone brushing their teeth until after the oral wash, which included rinsing/gargling the mouth with 10 ml of sterile saline for 1 min. The procedure was monitored by a staff member. The samples were collected in sterile tubes and centrifuged at 3000 × g for 30 min. One ml of sediment was stored frozen at -80°C until transfer to Denmark on dry ice.
Detection of P. jirovecii from oral wash specimens
DNA was extracted from oral wash specimens by Chelex extraction and 2 μl of the supernatant was used for touch-down-PCR detecting a fragment of the P. jirovecii mitochondrial large subunit rRNA gene as previously described [10, 11]. An internal process control was included for detecting the presence of Taq DNA polymerase inhibitors or suboptimal reaction conditions. Positive results were confirmed by two different PCRs amplifying mitochondrial small subunit rRNA and major surface glycoprotein of P. jirovecii , respectively.
A specimen was regarded as positive for P. jirovecii when at least two of the tests were positive. If inhibition was observed, the test was repeated with 1 μl of the sample as template.
In order to validate the presence of human DNA in the samples an additional PCR was performed for the detection of a 307 bp fragment of human betaglobin.
Data were collected daily onto data collection forms, checked for accuracy and entered into EpiData version 3.1 (The EpiData Association, Odense, Denmark, 2008). Data were exported to STATA 10.1 (StataCorp, College Station, Texas, USA, 2009) for statistical analysis. Fishers exact test was used to assess significant associations among categorical variables. For numerical data Wilcoxon-Mann-Whitney test was used.