def test_header_vs_population_sample_ids(self): """Check that the sample IDs parsed from the population arguement match those in the VCF file. NOTE: In practice the populations arguement can contain fewer samples and populations than actually contained in the VCF file. """ header = VCF.set_header(self.bgzip_path) header_sample_ids = [item for count, item in enumerate(header) if count >= 9] populations_dict = VCF.parse_populations_list(self.populations_list) populations_sample_ids = [i for l in populations_dict.values() for i in l] # Check both unique IDs and equal length self.assertEqual(set(header_sample_ids), set(populations_sample_ids)) self.assertEqual(len(header_sample_ids), len(populations_sample_ids))
def test_header_to_ordereddict_parsing(self): header = VCF.set_header(self.bgzip_path) self.assertEqual(header,self.header_dict)