A nasopharyngeal swab and the similar technique nasopharyngeal aspirate are methods of collecting a sample from the back of the nose and throat. They are used for the diagnosis of pertussis as well as a number of other viral infections.