2 Read the made-for field and split them up into different affiliations
3 while fixing the different spellings for some of our users
7 script_dir = os.path.split(__file__)[0]
8 settings_path = os.path.join(script_dir, 'htsworkflow','frontend')
9 os.environ['DJANGO_SETTINGS_MODULE'] = 'htsworkflow.frontend.settings'
11 from htsworkflow.frontend.samples import models as samples
14 # names ( {'target name': ('current name', 'current name') )
22 'Andrew Medina-Marino',
40 'Angela Stathopoulos',
50 'Adam Rosenthal': ('Adam Rosenthal',),
51 'Adler Dillman': ('Adler Dillman',),
53 'Ali/EHD': ('Ali/EHD',),
54 'Ali/PWS': ('Ali/PWS',),
55 'Andrew Medina-Marina': ('Andrew Medina-Marino',),
56 'Andrew Medina-Marino': ('Andrew Medina-Marino',),
57 'Brian': ('Brian Williams',),
58 'Brian Williams': ('Brian Williams',),
59 'Davidson': ('Davidson',),
60 'Elowitz': ('Elowitz',),
61 'Erich Schwarz': ('Erich Schwarz',),
62 'Erich Schwartz': ('Erich Schwarz',),
63 'Georgi Warinov': ('Georgi Warinov',),
64 'Gilberto Desalvo': ('Gilberto Desalvo',),
65 'Gilberto Hernandez': ('Gilberto Hernandez',),
66 'Gordon Kwan': ('Gordon Kwan',),
67 'Gordon': ('Gordon Kwan',),
68 'Alpha-Hudson': ('Hudson-Alpha',),
69 'Hudson-Alpha': ('Hudson-Alpha',),
70 'James Puckett': ('James Puckett',),
71 'Jingli Zhang, Rothenberg': ('Jingli Zhang', 'Ellen Rothenberg',),
72 'Jingli Zhang': ('Jingli Zhang',),
73 'Jose Luis': ('Jose Luis',),
74 'Katherine Fisher': ('Katherine Fisher',),
75 'Katherine, Gigio': ('Katherine Fisher', 'Gilberto Desalvo',),
76 'Meyerowitz': ('Meyerowitz',),
77 'Ryan, Demo': ('Ryan', 'Demo',),
78 'Stathopoulos': ('Angela Stathopoulos',),
79 'Steve Kuntz': ('Steven Kuntz',),
80 'Steven Kuntz': ('Steven Kuntz',),
82 'Tristan': ('Tristan',),
83 'Yuling Jiao': ('Yuling Jiao',),
84 u'Anil Ozdemir': (u'Anil Ozdemir',),
89 aff = samples.Affiliation(name=name)
90 affiliations[name] = aff
93 for lib in samples.Library.objects.all():
94 made_list = name_map[lib.made_for]
95 assert type(made_list) == type((None,))
98 lib.affiliations.add(affiliations[n])
101 if __name__ == "__main__":
102 print "don't run this unless you know what its for"
103 print "it converts the caltech 'made_for' field into a set of"
104 print "affiliations."
106 print "The user lists are hard coded and exist mostly for my"