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',
49 'Adam Rosenthal': ('Adam Rosenthal',),
50 'Adler Dillman': ('Adler Dillman',),
52 'Ali/EHD': ('Ali/EHD',),
53 'Ali/PWS': ('Ali/PWS',),
54 'Andrew Medina-Marina': ('Andrew Medina-Marino',),
55 'Andrew Medina-Marino': ('Andrew Medina-Marino',),
56 'Brian': ('Brian Williams',),
57 'Brian Williams': ('Brian Williams',),
58 'Davidson': ('Davidson',),
59 'Elowitz': ('Elowitz',),
60 'Erich Schwarz': ('Erich Schwarz',),
61 'Erich Schwartz': ('Erich Schwarz',),
62 'Georgi Warinov': ('Georgi Warinov',),
63 'Gilberto Desalvo': ('Gilberto Desalvo',),
64 'Gordon Kwan': ('Gordon Kwan',),
65 'Gordon': ('Gordon Kwan',),
66 'Alpha-Hudson': ('Hudson-Alpha',),
67 'Hudson-Alpha': ('Hudson-Alpha',),
68 'James Puckett': ('James Puckett',),
69 'Jingli Zhang, Rothenberg': ('Jingli Zhang', 'Ellen Rothenberg',),
70 'Jingli Zhang': ('Jingli Zhang',),
71 'Jose Luis': ('Jose Luis',),
72 'Katherine Fisher': ('Katherine Fisher',),
73 'Katherine, Gigio': ('Katherine Fisher', 'Gigio',),
74 'Meyerowitz': ('Meyerowitz',),
75 'Ryan, Demo': ('Ryan', 'Demo',),
76 'Stathopoulos': ('Angela Stathopoulos',),
77 'Steve Kuntz': ('Steven Kuntz',),
78 'Steven Kuntz': ('Steven Kuntz',),
80 'Tristan': ('Tristan',),
81 'Yuling Jiao': ('Yuling Jiao',),
86 aff = samples.Affiliation(name=name)
87 affiliations[name] = aff
90 for lib in samples.Library.objects.all():
91 made_list = name_map[lib.made_for]
92 assert type(made_list) == type((None,))
95 lib.affiliations.add(affiliations[n])
98 if __name__ == "__main__":
99 print "don't run this unless you know what its for"
100 print "it converts the caltech 'made_for' field into a set of"
101 print "affiliations."
103 print "The user lists are hard coded and exist mostly for my"