If any cancerous growths are found, they can also be taken out for further examination. This is called a biopsy. Biopsies are also done to test for certain bacteria that cause lung infections or pneumonia.