Skip to content

Commit

Permalink
Add additional species that are now supported because of MHCflurry
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Jul 29, 2020
1 parent d0f5222 commit b648217
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 19 deletions.
30 changes: 28 additions & 2 deletions lib/calculate_reference_proteome_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,38 @@ def __init__(self, input_file, input_fasta, output_file, match_length=8, species
self.file_type = file_type
self.species_to_organism = {
'human': 'Homo sapiens',
'mouse': 'Mus musculus',
'atlantic salmon': 'Salmo salar',
'black-headed spider monkey': 'Ateles fusciceps',
'blue monkey': 'Cercopithecus mitis',
'bonobo': 'Pan paniscus',
'bornean orangutan': 'Pongo pygmaeus',
'brown-mantled tamarin': 'Saguinus fuscicollis',
'chimpanzee': 'Pan troglodytes',
'macaque': 'Macaca',
'common marmoset': 'Callithrix jacchus',
'common squirrel monkey': 'Saimiri sciureus',
'cottontop tamarin': 'Saguinus oedipus',
'cow': 'Bos taurus',
'crab-eating macaque': 'Macaca fascicularis',
'dog': 'Canis lupus familiaris',
"Geoffroy's tamarin": 'Saguinus geoffroyi',
'golden lion tamarin': 'Leontopithecus rosalia',
'gorilla': 'Gorilla gorilla',
'grivet': 'Chlorocebus aethiops',
'hamadryas baboon': 'Papio hamadryas',
'horse': 'Equus caballus',
'lar gibbon': 'Hylobates lar',
'mouse': 'Mus musculus',
'moustached tamarin': 'Saguinus mystax',
'olive baboon': 'Papio anubis',
'pig': 'Sus scrofa',
'rainbow trout': 'Oncorhynchus mykiss',
'rhesus macaque': 'Macaca mulatta',
'sheep': 'Ovis aries',
'southern pig-tailed macaque': 'Macaca nemestrina',
'stump-tailed macaque': 'Macaca arctoides',
'white-faced saki': 'Pithecia pithecia',
'white-fronted spider monkey': 'Ateles belzebuth',
'yellow baboon': 'Papio cynocephalus',
}

def reference_match_headers(self):
Expand Down
63 changes: 46 additions & 17 deletions lib/prediction_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,24 +190,53 @@ def check_alleles_valid(cls, alleles):

@classmethod
def species_for_allele(self, allele):
if allele.startswith('HLA'):
return 'human'
elif allele.startswith('Patr'):
return 'chimpanzee'
elif allele.startswith('Mamu'):
return 'macaque'
elif allele.startswith('BoLA'):
return 'cow'
elif allele.startswith('Eqca'):
return 'horse'
elif allele.startswith('H-2'):
return 'mouse'
elif allele.startswith('H2'):
return 'mouse'
elif allele.startswith('SLA'):
return 'pig'
allele_to_species = {
'HLA' : 'human',
'DP' : 'human',
'DQ' : 'human',
'DR' : 'human',
'Atbe': 'white-fronted spider monkey',
'Atfu': 'black-headed spider monkey',
'BoLA': 'cow',
'Caja': 'common marmoset',
'Cemi': 'blue monkey',
'Chae': 'grivet',
'DLA' : 'dog',
'Eqca': 'horse',
'Gogo': 'gorilla',
'H-2' : 'mouse',
'H2' : 'mouse',
'Hyla': 'lar gibbon',
'Lero': 'golden lion tamarin',
'Maar': 'stump-tailed macaque',
'Mafa': 'crab-eating macaque',
'Mamu': 'rhesus macaque',
'Mane': 'southern pig-tailed macaque',
'Onmy': 'rainbow trout',
'Ovar': 'sheep',
'Paan': 'olive baboon',
'Pacy': 'yellow baboon',
'Paha': 'hamadryas baboon',
'Papa': 'bonobo',
'Patr': 'chimpanzee',
'Pipi': 'white-faced saki',
'Popy': 'bornean orangutan',
'Safu': 'brown-mantled tamarin',
'Sage': "Geoffroy's tamarin",
'Samy': 'moustached tamarin',
'Saoe': 'cottontop tamarin',
'Sasa': 'atlantic salmon',
'Sasc': 'common squirrel monkey',
'SLA' : 'pig',
}

species = [v for k,v in allele_to_species.items() if allele.startswith(k)]
if len(species) == 1:
return species[0]
elif len(species) == 0:
raise Exception("Unable to determine species for allele {}".format(allele))
else:
return 'human'
raise Exception("Multiple matching species found for allele {}".format(allele))

@classmethod
def parse_allele_cutoff_file(cls):
Expand Down

0 comments on commit b648217

Please sign in to comment.